I wanted to be able to read the messages with a mail reader. I have a mail
account that receives log monitoring and status information from various
servers that I oversee. They send those fairly regularly (dial-ups send me
their IP numbers each time they reconnect, for example), and for my
purposes, only the most recent e-mail is relevant. This rc file here works
well:
MAILSUBJECT=`grep -e "^subject" -i | sed 's/[Ss]ubject. //g'`
:0 ic:mail.lock
| rm -rf $HOME/files.mail/"$MAILSUBJECT"
:0 c:mail.lock
$HOME/files.mail/"$MAILSUBJECT"
:0 i:mail.lock
| cat $HOME/files.mail/* > /var/spool/mail/$LOGNAME
For anybody who may be interested...
Lee Howard
At 12:38 PM 6/25/00 -0500, guenther+procmail(_at_)gac(_dot_)edu wrote:
Lee Howard <faxguy(_at_)server(_dot_)deanox(_dot_)com> writes:
Hi. I have a number of clients that have dial-up internet connections that
have server-assigned (non-fixed) IP addresses. So, I have a ip-up.local
script that e-mails a special account on my server the ifconfig results.
(So that I always have the current IP address for maintenance purposes.) I
check the mail with pine. However, I have to routinely flush out dozens of
mails, because the only relevant one is the most recent. The mails all
have the same subject line and the same sender. I'm sure that procmail can
help me here...
I'd like a recipe that overwrites the old mail with the new for each mail
that has the same subject line (different clients' subjects differ
slightly).
Hmm, I'd suggest you save each client mail in a separate file
differentiating on the Subject:, of course. You can then just overwrite
each file as you go using an action (you need to supply the recipe and
conditions!) that looks something like:
| cat >$filename
You would set the filename variable based on the Subject: header field,
probably by using the procmail's regexp extraction operator, \/ and the
MATCH variable to build the filename. The exact regexp depends on what
Subject: header field of these message exactly look like.
Philip Guenther
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail