procmail
[Top] [All Lists]

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

2003-02-12 01:52:45
dman(_at_)nomotek(_dot_)com wrote:
I don't know whether you saw my personal note to you the other day in
which I voiced irritation over having received an acknowledgment to
a message I cc'd to you and posted to this list in reply to your
initial query.  If you are going to mail questions to mailing lists,
you should think seriously about turning off or blocking replies to
people who might answer from the list.

I looked through my logs, and the only thing I saw from you was the cc of
your response to me on the 7th.  I am sorry you are irritated by not being
included in my whitelist a priori.  I have only recently begun developing
my .procmailrc, and when I have successfully debugged my autoresponder, I
would be happy to consider adding the functionality you describe.  I have
just added you to my whitelist, so you may mail me with impunity.

I am running under Linux 2.4.18-18.7.x, procmail v3.22, qmail v1.03 (so says 
the qmail man page).

My problem is 12 times out of the last 82 firings of my autoresponder recipe, 
I got an 'Error while writing to "x"' message.  I am assuming the worst, that
the recipe failed utterly, so the sender will not have been notified that they
are not on my whitelist, and thus I must review their message myself instead of
waiting for them to redeem it.

I have made a few tweaks to my recipes since I posted them, so here they are 
again, followed by a typical fragment from the log file.  LOGABSTRACT=on and 
VERBOSE=on


:0
* ^Delivered-To: alias-\/.*
{
  SENTTO="$MATCH"
}
:0E
* ^Delivered-To: \/.*
{
  SENTTO="$MATCH"
}

:0
* ! ? formail -rzxTo: | fgrep -iwqsf $HOME/whitelist
* ! ? formail -rtzxTo: | fgrep -iwqsf $HOME/whitelist
{
  :0c:
  nonwhitelist
  # cron will delete nonwhitelist messages after they are one week old

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

  :0W
  * !^FROM_DAEMON
  * !^X-Loop: procmail(_at_)orrok(_dot_)com
  | (formail -q- -r \
      -XSubject: \
      -XTo: ; \
     echo "From: \"Jeff Orrok\" <REDEEM${LASTMSG}.$SENTTO" ; \
     echo "Reply-To: \"Jeff Orrok\" <REDEEM${LASTMSG}.$SENTTO" ; \
     echo "X-Loop: procmail(_at_)orrok(_dot_)com" ; \
     echo ; echo "Hello, you sent a message with the above subject to $SENTTO" 
; \
     cat $HOME/autoreply.text ; \
    ) 2>>ERROR${LASTMSG} | $SENDMAIL $SENDMAILFLAGS -t 2>>ERROR${LASTMSG}
  
  :0ew
  {
    LOG="$NL### Autoresponder failed.  more $HOME/Mail/nonwhitelist/$LASTMSG 
$NL"
    LOG="###  $LASTMSG $FROM_ $FROM $SUBJECT $NL"
    :0fhw
    | formail -A "X-procmail: Autoresponder failed!"
    :0:
    | cat >> review
  }
}


***  lanceric(_at_)jump(_dot_)net  bwomach(_at_)ornews(_dot_)intel(_dot_)com  
The Cancer fighter is here - try calcium 
procmail: [4332] Tue Feb 11 23:46:24 2003
procmail: No match on "^To: .*REDEEM\/msg\(_dot_)[^(_at_)(_dot_)/]+"
procmail: No match on "^X-Loop: procmail(_at_)orrok(_dot_)com"
procmail: Assigning "MATCH="
procmail: Matched "jeff(_at_)orrok(_dot_)com"
procmail: Match on "^Delivered-To: alias-\/.*"
procmail: Assigning "SENTTO=jeff(_at_)orrok(_dot_)com"
procmail: Executing " formail -rzxTo: | fgrep -iwqsf $HOME/whitelist"
procmail: Non-zero exitcode (1) from " formail -rzxTo: | fgrep -iwqsf 
$HOME/whitelist"
procmail: Match on ! " formail -rzxTo: | fgrep -iwqsf $HOME/whitelist"
procmail: Executing " formail -rtzxTo: | fgrep -iwqsf $HOME/whitelist"
procmail: Non-zero exitcode (1) from " formail -rtzxTo: | fgrep -iwqsf 
$HOME/whitelist"
procmail: Match on ! " formail -rtzxTo: | fgrep -iwqsf $HOME/whitelist"
procmail: Locking "nonwhitelist.lock"
procmail: Assigning "LASTFOLDER=nonwhitelist/msg.Ad0L"
procmail: Opening "nonwhitelist/msg.Ad0L"
procmail: Acquiring kernel-lock
From lanceric(_at_)jump(_dot_)net Wed Feb 12 07:46:24 2003
 Subject: The Cancer fighter is here - try calcium
  Folder: nonwhitelist/msg.Ad0L                                            9774
procmail: Unlocking "nonwhitelist.lock"
procmail: Executing "echo $LASTFOLDER | sed -e "s#.*/##""
procmail: Assigning "LASTMSG=msg.Ad0L"
procmail: Match on ! "(^(Mailing-List:|Precedence:.*(junk|bulk|list)|To: 
Multiple recipients of |(((Resent-)?(From|Sender)|X-Envelope-From):|>?From 
)([^>]*[^((_dot_)%(_at_)a-z0-9])?(Post(ma?(st(e?r)?|n)|office)|(send)?Mail(er)?|daemon|m(mdf|ajordomo)|n?uucp|LIST(SERV|proc)|NETSERV|o(wner|ps)|r(e(quest|sponse)|oot)|b(ounce|bs\.smtp)|echo|mirror|s(erv(ices?|er)|mtp(error)?|ystem)|A(dmin(istrator)?|MMGR|utoanswer))(([^).!:a-z0-9][-_a-z0-9]*)?[%@>
       ][^<)]*(\(.*\).*)?)?$([^>]|$)))"
procmail: Match on ! "^X-Loop: procmail(_at_)orrok(_dot_)com"
procmail: Executing " (formail -q- -r \
      -XSubject: \
      -XTo: ; \
     echo "From: \"Jeff Orrok\" <REDEEM${LASTMSG}.$SENTTO" ; \
     echo "Reply-To: \"Jeff Orrok\" <REDEEM${LASTMSG}.$SENTTO" ; \
     echo "X-Loop: procmail(_at_)orrok(_dot_)com" ; \
     echo ; echo "Hello, you sent a message with the above subject to $SENTTO" 
; \
     cat $HOME/autoreply.text ; \
    ) 2>>ERROR${LASTMSG} | $SENDMAIL $SENDMAILFLAGS -t 2>>ERROR${LASTMSG}"
procmail: Error while writing to " (formail -q- -r \
      -XSubject: \
      -XTo: ; \
     echo "From: \"Jeff Orrok\" <REDEEM${LASTMSG}.$SENTTO" ; \
     echo "Reply-To: \"Jeff Orrok\" <REDEEM${LASTMSG}.$SENTTO" ; \
     echo "X-Loop: procmail(_at_)orrok(_dot_)com" ; \
     echo ; echo "Hello, you sent a message with the above subject to $SENTTO" 
; \
     cat $HOME/autoreply.text ; \
    ) 2>>ERROR${LASTMSG} | $SENDMAIL $SENDMAILFLAGS -t 2>>ERROR${LASTMSG}"
procmail: Assigning "LASTFOLDER= (formail -q- -r \
      -XSubject: \
      -XTo: ; \
     echo "From: \"Jeff Orrok\" <REDEEM${LASTMSG}.$SENTTO" ; \
     echo "Reply-To: \"Jeff Orrok\" <REDEEM${LASTMSG}.$SENTTO" ; \
     echo "X-Loop: procmail(_at_)orrok(_dot_)com" ; \
     echo ; echo "Hello, you sent a message with the above subject to $SENTTO" 
; \
     cat $HOME/autoreply.text ; \
    ) 2>>ERROR${LASTMSG} | $SENDMAIL $SENDMAILFLAGS -t 2>>ERROR${LASTMSG}"
procmail: Assigning "LOG=
### Autoresponder failed.  more /home/jeff/Mail/nonwhitelist/msg.Ad0L 
"

### Autoresponder failed.  more /home/jeff/Mail/nonwhitelist/msg.Ad0L 
procmail: Assigning "LOG=###  msg.Ad0L  lanceric(_at_)jump(_dot_)net  
bwomach(_at_)ornews(_dot_)intel(_dot_)com  The Cancer fighter is here - try 
calcium 
"
###  msg.Ad0L  lanceric(_at_)jump(_dot_)net  
bwomach(_at_)ornews(_dot_)intel(_dot_)com  The Cancer fighter is here - try 
calcium 
procmail: Executing "formail,-A,X-procmail: Autoresponder failed!"
procmail: Locking "review.lock"
procmail: Executing " cat >> review"
procmail: Assigning "LASTFOLDER= cat >> review"
procmail: Unlocking "review.lock"
procmail: Notified comsat: "jeff@:/home/jeff/Mail/ cat >> review"


I just tried manually piping the above offending message through procmail three
times.  It generated the same error each time.
cat Mail/nonwhitelist/msg.Ad0L | procmail


Now that you clarified what you were doing with sed, I can still tell you how
to do it inside procmail, thus saving the pipe and the call to sed.

      :0
      * LASTFOLDER ?? /\/[^/]+
      { LASTMSG = $MATCH }

Thank you, I'll try that!

Regards,

Jeff

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