Hi there,
I have two questions.
1. We are running sendmail V 8.8.2 and I have configured the sendmail.cf to
bring up procmail as a mailer with sendmail. Following is how the mailer in
sendmail.cf file looks like:
Mprocmail, P=/usr/local/bin/procmail, F=mSDFMhun, S=11, R=21,
A=procmail -m $h $g $u
The Rulesets 0 for procmail looks like the following:
R$*<@ $*>$* $#procmail $@/etc/procmailrcs/config.proc $:
$1(_at_)$2(_dot_)procmail$2
R$*<@ $*.procmail>$* $1<@$2>$3 Already filtered, map back
The config.proc looks like the following:
PATH=/bin:/usr/bin:/usr/local/bin
DIR=/usr/local/config
:0 ic
* ^Subject:.*configuration
* ^Message-Id:(_dot_)*(_at_)\/[^.>]+
* ? test ! -d $DIR/$MATCH
|mkdir $DIR/$MATCH
:0 Ab
|cat > $DIR/$MATCH/$MATCH.config
The essence of this filter is that if the mail comes in with the subject
"configuration" store it in a folder with the name of the server.
The problem by bringing the procmail mailer with sendmail is that whatever mail
the server receives for any user, its sendmail daemon tries to process it using
the procmail filter. Since the subject field of the other mails does not match,
procmail sends a panic message to root claiming about the filter. Is there a
way to restrict procmail to process the mail only if the Subject field matches
and only if the mail is sent to root only, while at the same time the other
users of the server can use their individual procmailrc filters?
2. I have a user who will receive just two types of mails, one is with
subject "tracefile for <date>" and the other with subject "configuration". I
would like to have two recipes for each subject which would perform different
tasks. Is it possible to have multiple recipes in a procmailrc filter?
Any help would be really appreciated.
Naveed.