[wplug] procmail help

Gentgeen gentgeen at linuxmail.org
Fri May 19 14:44:20 EDT 2006


On Fri, 19 May 2006 11:00:31 -0400
"Chester R. Hosey" <chosey at nauticom.net> wrote:

> Gentgeen wrote:
> > 1st - I am sure there is probably a "prettier way" to do that, but
> > it is working right now (at least the To and Cc).  If anyone wants
> > to help me make it prettier, great. :-)  
> 
> You can use the pipe character to specify either-or matches.
> 
> > :0:
> > * ^(To).*kvsquire at comcast.net
> > $MAILDIR/Other_Acct/kvsquire/.
> >
> > :0:
> > * ^(Cc).*kvsquire at comcast.net
> > $MAILDIR/Other_Acct/kvsquire/.
> 
> This could be consolidated as follows:
> 
> :0:
> * ^(To|Cc).*kvsquire at comcast.net
> $MAILDIR/Other_Acct/kvsquire/.
> 
> Also, it's probably not a bad idea to specify the header-tag delimiter
> specifically -- all header tags should end in a colon, so it doesn't
> hurt to make it explicit:
> 
> :0:
> * ^(To|Cc):.*kvsquire at comcast.net
> $MAILDIR/Other_Acct/kvsquire/.
> 
> Note that procmail is not case sensitive by default, which is entirely
> reasonable in this case. You can write "TO|CC", "to|cc", or any
> variation you desire.
> 
> 
> > 2nd - My question really is how can I grap BCC mail?  Looking at the
> > header of a test send did not show anything that I found helpful,
> > and the test sends all went to the default folder.
> 
> BCC is stripped in transit, so procmail won't see it. There's probably
> nothing reasonable that you can do about this, unless someone knows of
> a clever way to get the local MTA to save the envelope information as
> another header.
> 
> There's another possibility that _might_ be good enough for your
> purposes, although there's a good chance of misidentifying mail
> depending on your circumstances. You could check the "Received"
> headers for anything that's gone through comcast.net, and this would
> catch mail which ended up at your Comcast address.
> 
> This would _also_ catch mail sent by Comcast customers to any of your
> email addresses, since that mail would also have gone through a
> Comcast address. Finally, if the machine on which you're running your
> mail server is on a Comcast address (such as a cable modem), it'll
> pretty much catch everything that ends up there, since everything will
> have gone through the local address.
> 
> If you're not sure, or if any of this is unclear, then feel free to
> describe your setup in a little bit more detail (off-list is fine, if
> you'd rather not make details public) and I'd be glad to help you sort
> this all out.
> 
> 
> Chet

Thanks for the help.  Have cleaned up my procmail file some now :-)

After reading this I got another thought, Can Fetchmail add a
user-defined header for me?  Something like "This mail retrieved from
account XYZ"

Again, my fetchmail config file is not very pretty, but it works for me.
Maybe a little clean up and insight from everyone might help me out
some.

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.

 Here is what I currently have for my fetchmailconf:


# Configuration created Wed Jan 12 12:42:41 2005
set postmaster "kevin"
set syslog
set invisible
set daemon 600
########################################
# This is Kevin's Linuxmail account
######################################## 
poll imap.linuxmail.org with proto POP3
       user 'gentgeen:linuxmail.org#linuxmail.org' there 
       with password 'XXXXXX'  
       is 'kevin' here 
       options fetchall
       mda '/usr/bin/procmail -d kevin'

########################################
# This is the Comcast main account
########################################
poll mail.comcast.net with proto POP3
        # Drops Comcast mail into Kevin's account
        user 'kvsquire at comcast.net' there 
        with password 'YYYYYY'
        is 'kevin' here keep
        mda '/usr/bin/procmail -d kevin'       

        # Drops Comcast mail into Val's account
        user 'kvsquire at comcast.net' there 
        with password 'YYYYYY'
        is 'val' here fetchall
        mda '/usr/bin/procmail -d val'

########################################
# This is Ariel's Comcast account
########################################
#poll mail.comcast.net with proto POP3
        # Drops a copy of Ariel's mail into Kevin's account
        user 'bratzfan7 at comcast.net' there 
        with password 'ZZZZZZ'
        is 'kevin' here keep
        mda '/usr/bin/procmail -d kevin'       

        # Drops Ariel's mail into Ariel's account
        user 'bratzfan7 at comcast.net' there 
        with password 'ZZZZZZ'
        is 'ariel' here fetchall
        mda '/usr/bin/procmail -d ariel'  


I know each mail from comcast gets processed twice in this set-up, and
the comcast server gets hit twice for each account.  I just did not know
any other way to do it.




-- 
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