星期三, 五月 07, 2003

Comments, Links

Is this what I stay up all night for? It turns out that if I try to pipe my mail through a string of pipes in the .forward file, it will only pipe mail through the last program in the string (this is running sendmail with smrsh on RedHat 9). For example, my .forward file was:

"|/etc/smrsh/nyt|/etc/smrsh/filtermail"

And the mail was only being run through the filtermail program. So I ended up just sending the mail to procmail, then piping it from there. Now my .forward file looks like this:

"|IFS=' ' && exec /usr/bin/procmail || exit 75 #msittig"

And .procmailrc looks like this:

VERBOSE=off
MAILDIR=$HOME/mail
PMDIR=$HOME/.procmail
DEFAULT=/var/spool/mail/msittig
LOGFILE=$PMDIR/log
INCLUDERC=$PMDIR/general.rc
# INCLUDERC=$PMDIR/other.rc
# add as many INCLUDERC's as you like
# end of .procmailrc

And ~/.procmail/general.rc looks like this:

:0
* To.
| /home/msittig/bin/nyt | /home/msittig/bin/filtermail

Ta-dah! I love frickin Linux. It's a tinker's paradise. These links came in handy while figuring this out: O'Reilly Sendmail, Procmail Tutorial.