[wplug] procmail help

Gentgeen gentgeen at linuxmail.org
Sun May 21 15:36:53 EDT 2006


On Sun, 21 May 2006 12:45:31 -0400
"Chester R. Hosey" <chosey at nauticom.net> wrote:

> Gentgeen wrote:
> > On Fri, 19 May 2006 11:00:31 -0400
> >
> > Right now, I use fetchmail to grab mail from 3 different accounts,
> > My main account (This one), the family account (the
> > kvsquire at comcast.net) and my 7 year old daughters account
> > (bratzfan7 at comcast.net).  Mail from all three accounts have to come
> > to my account (I want to see my mail, the family mail, and my
> > daughters mail).  The family account also has to go to my wife's
> > account, and of course me daughters account has to go to her. 
> > 
> > Fetchmail sends it along to procmail who passes the mail through
> > ClamAssassin and SpamAssassin before senting it along to the
> > personal accounts.
> 
> Gotcha. What you want to do is grab the mail, add a header, and
> deliver it to yourself and an appropriate second mailbox.
> 
> Presently you're fetching from an account twice, delivering it once to
> yourself and once to a second mailbox. This is because it's not clear
> how to grab it once, and sort it out later.
> 
> Procmail can forward mail to another mail address; if you use a
> "non-delivering" recipe for this you can have the mail also sent to
> your own account. The only problem remaining is to identify the
> original mail itself; adding a header is actually pretty easy using
> the 'formail' utility. You can have fetchmail pipe the message through
> formail to add an account-specific header before passing it on to
> procmail.

[SNIPED CONFIG for space.]
> 
> Of course, if any of this is unclear or I'm misinterpreted something,
> please let me know and I'd be glad to try to help clarify. If you do
> get it working, please let me know also!
> 
> Chet


MAN -- I owe you a beer (add "root" if under 21). Great job. I want to
make sure I understand this first though :-)

Fetchmail grabs all the mail from all the accounts, and passes them
along as if $USER=kevin (me).  Formail adds headers where necessary, and
continues to pass them along as if $USER=kevin.  Then procmail takes
over, and since $USER=kevin, it is going to use /home/kevin/.procmailrc
to do the sorting.  Using the procmail config file you posted earlier -
a copy of the email will be sent to either "val at localhost.localdomain"
or "ariel at locahost.localdomain" for those with the header changes and a
copy will also be placed in my $MAILDIR folders.  

I used the quotes around the local email addresses cause I imagine that
it is not exactly the same thing as mailing directly to them (i.e. your
method will not change the TO or the REPLY-TO fields for example).

I could then add all my other sorting stuff below that right?  After the
Ariel sort, but before the Unsorted gets dropped into $DEFAULT.

-- 
http://gentgeen.homelinux.org

#############################################################
 Associate yourself with men of good quality if you esteem    
 your own reputation; for 'tis better to be alone then in bad 
 company.        - George Washington, Rules of Civility


More information about the wplug mailing list