[wplug] procmail help

Gentgeen gentgeen at linuxmail.org
Fri May 26 11:41:28 EDT 2006


On Thu, 25 May 2006 19:11:49 -0400
"Chester R. Hosey" <chosey at nauticom.net> wrote:

No problem.  I started messing with it some.  You gave me a great
starting point with formail and some procmail recipes.  Then with some
"man" (now that I knew what to "man") I was figureing out some things
too.  I figured I would post back once I had things working.

For the "-f" option, that was exactly the problem.  I found that option
the day after my reply.  

I found that no matter where I did the filtering and how I aranged the
fowarding, I kept getting an evil email cycle.  When I set it up like
you mentioned, it would cycle an email OVER AND OVER again (to the point
where I had over 300 copies of the same 3 emails).  Either it would
cycle over and over where I got the 300 emails, or over and over where
val would get the 300 emails.  The logic was there, but for some reason
it was cycling... never figured it out.

Eventually I went back to my orignial fetchmail file, but added the
'formail' portion to the MDA.  This solves my original problem
(trying to get BCC emails into the right folder).  Of course I am still
hitting Comcast twice for the same account, but I can live with that for
now :-)



a protion of my /etc/fetchmailrc file for "the record":
------------------------------------------------------------------
########################################
# 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
        # Get comcast email, but leave it on server
	# so I can drop Comcast mail into Kevin's account
        user 'kvsquire at comcast.net' 
        there with password 'YYYYYY'
        is 'kevin' here keep
        mda '/usr/bin/formail -f -A "X-Original-Account: 
            kvsquire at comcast.net" | /usr/bin/procmail -d kevin'

	# get comcast email, this time delete on server
        # this will go into Val's account
        user 'kvsquire at comcast.net' 
        there with password 'YYYYYY'
        is 'val' here fetchall
        mda '/usr/bin/procmail -d val'
------------------------------------------------------------------

And now I have in $HOME/.procmailrc:


SHELL=/bin/bash
MAILDIR=$HOME/Mail
DEFAULT=$MAILDIR/inbox
LOGFILE=$HOME/Mail/procmail.log
VERBOSE=no
#-------------------------------------------
# Get Spam out of the way
:0:
* ^X-Spam-Status: Yes
$MAILDIR/SPAM/.
#-------------------------------------------
# Family Email account
:0:
* ^X-Original-Account:.*kvsquire at comcast.net
$MAILDIR/Other_Acct/kvsquire/.

#--------------------------------------------
# All other sorting below
--------------------------------------------------------------------


> I'm sorry for the delayed reply... It's been a busy week!
> 
> Gentgeen wrote:
> > Seems to be working good, except for 1 tiny thing with the
> > @comcast.net accounts. When a mail comes in from the @comcast.net
> > accounts, I get a "greater than" sign that is added to the beginning
> > of the "From fetchmail $DATE" line.  This basically messes up the
> > header, and produces a really messed up email.  It is not happening
> > with the @linuxmail accounts, so I assume it is coming from the fact
> > that we are using formail now in there, but not sure what exactly is
> > doing it.
> > 
> > 	(2) /etc/fetchmailrc:
> >
> >         mda '/usr/bin/formail -A "X-Original-Account: 
> >         bratzfan7 at comcast.net" | /usr/bin/procmail -d kevin'
> 
> Grrr... this is probably the source of the problem. Try making that
> "formail -f -A ..." -- I think that formail is adding a "From" header
> to satisfy itself. You'll want to do the same on the other Comcast
> account listed in /etc/fetchmailrc as well.
> 
> All on one line, of course:
> 
> mda '/usr/bin/formail -f -A "X-Original-Account:
> 	bratzfan7 at comcast.net" | /usr/bin/procmail -d kevin'
> 
> Then do the same for the other account.
> 
> I'd probably trust the formail invocation from .procmailrc, since
> _all_ mail passes through it, but not all mail is being munged.
> 
> > As a side thought... Should/could I put the /home/kevin/.procmailrc
> > stuff that forwards mail to val and ariel into the /etc/procmailrc
> > file?
> 
> I'm not sure about this -- it could go either way, although I
> generally tend to put things in the least far-reaching place possible.
> If you prefer to keep the configuration together in /etc, it might be
> worth a shot (after fixing the "^From " issue and making backup copies
> of the working configuration).
> 
> I'm sorry again for taking so long to respond to your post, since I'm
> sure you'd rather get this working as soon as possible! I'll do my
> best to respond more quickly if more issues arise.
> 
> Chet
> _______________________________________________
> wplug mailing list
> wplug at wplug.org
> http://www.wplug.org/mailman/listinfo/wplug
> 




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