.promailrc help

Paul Howarth paul at city-fan.org
Fri Jul 7 15:11:48 UTC 2006


Phil wrote:
> I have procmail installed and working with fetchmail.
> There is only one problem...
> 
> If I have more than one email in the To: or CC: fileds and both these email
> addrresses are supposed to go to two different folders... they do not...
> both email go to the same folder...
> 
> How do I setup .procmailrc so that it parses the entire To: or CC: fileds
> first before moving them to a directory?
> 
> In the example below if an email has both support and user1 in CC: or To:
> fileds I will get two emails in the support directory....however if 
> there is
> only one email address in the To: or CC: fileds the emails will go to the
> appropriate directory... any help would be great.
> 
> Here is my .procmailrc file
> 
> MAILDIR=$HOME/mail
> 
> LOGFILE=/var/log/procmail.log
> #VERBOSE=yes
> 
> :0
> * ^From:.*postmaster at fakeemail.com*
> /dev/null
> 
> :0
> * ^TOsupport@
> $MAILDIR/support
> 
> :0
> * ^TOuser1@
> $MAILDIR/friends

Both of these last two recipes are "delivering" recipes, which means 
that procmail stops processing the mail when it matches one of them.

What you could do would be to add the "c" flag to each recipe (":0 c"), 
which would mean that the mail was copied for the purposes of those 
recipes and processing would continue even if either or both of those 
were matched.

Of course, you would then find that mail for either or both of these 
addresses went on to be processed by any further recipes in your 
procmailrc (so it would get delivered to the default mailbox as well by 
default). You'd need to add another recipe to prevent that if that's not 
what you wanted.

Paul.




More information about the fedora-list mailing list