procmail
[Top] [All Lists]

Re: flaky recipe -- too bad it's not for pastries

2003-02-07 04:14:04
Jeff Orrok <jeff(_at_)rt(_dot_)com> wrote:

Hello, I am having a few problems with the "centerpiece" of my .procmailrc

1) Usually it works, but approx 5% of the time, it will let addresses
not on my whitelist slip through.

2) When it works, the autoresponder usually gets the message off, but
once in a while, I get the Error while writing to "x" message listed
in the procmail man page.  My interpretation of the man page leaves me
with "pipe died" as the only possible cause.  Why would the pipe die?

I haven't studied the rc snippet you supplied.  But from your description,
the first thing I'd suspect is that you've run out of memory.  Increase
the value of LINEBUF near the top of your rc.

Next, turn on verbose logging and look at the errors, if any remain after the
above.

4) When the autoresponder succeeds, I would expect processing to be
complete, but there is always another copy left over, which is why I
have the blacklist recipe at the end.

I wonder if this is a separate issue, masked by the first.


5) In case you're wondering, the echo's are there because formail
refuses to add those fields no matter which flag [AaIi] I use :-(

You've certainly got some syntax issues going on.  I won't study
the below intently (no time), but will give a couple of quick ideas.


:0D
* ^To: .*REDEEM\/msg\(_dot_)[^(_at_)(_dot_)/]+
| cat $MAILDIR/nonwhitelist/$MATCH >> $MAILDIR/review

The action seems to have nothing to do with the contents
of the message.  So use the `i' and the `h' flags to help
procmail out.

:0B:
* ^X-Loop: procmail(_at_)lastname(_dot_)com
blacklist

What does the X-Loop have to do with the body of the mail?
It seems as if this recipe will never trigger.



:0
* ^To: \/.*
* ! ? formail -rzxTo: | fgrep -iwqsf $HOME/whitelist
* ! ? formail -rtzxTo: | fgrep -iwqsf $HOME/whitelist

This seems horribly inefficient; but I don't have time to
think up a better way.

{
  SENTTO="$MATCH"

  :0c:
  nonwhitelist
  # cron will delete nonwhitelist messages after they are one week old

  LASTMSG=`echo $LASTFOLDER | sed -e "s#.*/##"`

Lots of these pipes could easily be done inside procmail.  You'd be
less likely to suck up your buffer space that way, too.

        :0 hi
        * LASTFOLDER ?? ^^\/.*#
        { LASTMESSAGE = $MATCH# }



  :0W
  * !^FROM_DAEMON
  * !^X-Loop: procmail(_at_)lastname(_dot_)com
  REPORT=| (formail -q- -r \
      -XSubject: \
      -XTo: ; \
[deleteded rest]

I'd think hyou could algorithmically combine this formail -r with one
or both of the others up-top.

-- 
dman


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