procmail
[Top] [All Lists]

Re: Comparing with a file contents to forward mail

2003-01-23 15:49:27
Hi,
I'm trying to implement a procmail recipe to do the following:

a) extract the field To: from the mail header
b) find the right entry into a file that maps user mailboxes to the To:
field contents
c) deliver the mail into the corresponding user mailbox


OK.. I'm not sure its exactly what you need.. but here it goes..
suppose you have a file list with valid users name "validusr" 
so...

##############################
MAILDIR=$HOME/Mail
VALIDUSR=$MAILDIR/validusr
NL="
"

:0
* ? (formail -zx To: | fgrep -iqf $VALIDUSR)
{
 TO=`formail -zxTo:`
 LOG="DELIVERED TO $TO ${NL}"

 :0:
 $MAILDIR/$TO 
}
##############################

hope I didn't say anything reaaaally stupid.. :/

___________________________
signature text:
  Nikos K. Kantarakias
  URLs:  http://www.nikant.tk/
         http://www.skiathos.tk/
         http://agriroot.aua.gr/



_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>
  • Re: Comparing with a file contents to forward mail, Nikos K. Kantarakias <=