procmail
[Top] [All Lists]

procmail problem :-(

1999-02-18 23:27:11
I'm trying to set up an autoreply system using procmail.

Here is my recipe:

$ cat .procmailrc
SHELL=/bin/sh    # for other shells, this might need adjustment
SENDMAIL=/usr/sbin/sendmail
LOGFILE=/home/abuse/procmaillog
VERBOSE=on

:0 Whc: /home/abuse/submitter.lock
* !^FROM_DAEMON
* !^X-Loop: abuse(_at_)singnet(_dot_)com(_dot_)sg
* !^X-AUTOREPLY: no.*
* !^Subject:\ \[noautoreply\].*
| ( formail \
        -I "Return-Path:" \
        -I "Resent-From:" \
        -I "Resent-To:" \
        -I "Resent-Date:" \
        -I "Resent-Subject:" \
        -I "Resent-Message-ID:" \
        -rD 65536 /home/abuse/submitter.cache )

:0 ehc: /home/abuse/autoreply.lock         # if the name was not in the cache
| ( formail \
        -I "Return-Path:" \
        -I "Resent-From:" \
        -I "Resent-To:" \
        -I "Resent-Date:" \
        -I "Resent-Subject:" \
        -I "Resent-Message-ID:" \
        -r \
        -A "Precedence: junk" \
        -A "X-Loop: abuse(_at_)singnet(_dot_)com(_dot_)sg" \
        -i "Subject: Your submission to SingNet NetAbuse Team" ; \
   /bin/cat /home/abuse/autoreply \
  ) | $SENDMAIL -oi -t


The intention is that each submitter only gets one reply per month
(cron will be removing /home/abuse/submitter.cache each first of the month).

I found that the -I "Resent*" lines are necessary, so that a reply goes
to the original sender, if I b)ounce a message to this account in pine.
If I leave them, I get the autoreply :-(
I would have liked to use -i though, to prefix these headers with Old-,
but pine seems to be generating "ReSent-*", which -i doesn't seem to
recognize :-(

However, I have a much more serious problem:

From my (verbose) procmaillog, using the above recipe:

        Q: Why are the two formail invocations handled so much differently?
           In the first, it truies to execute "(", the second is OK though...


procmail: [19844] Fri Feb 19 13:49:49 1999
procmail: Match on ! 
"(^(Precedence:.*(junk|bulk|list)|(((Resent-)?(From|Sender)|X-Envelope-From):|>?From
 )(.*[^((_dot_)%(_at_)a-z0-9])?(Post(ma?(st(e?r)
?|n)|office)|(send)?Mail(er)?|daemon|mmdf|root|n?uucp|smtp|response|LISTSERV|owner|request|bounce|serv(ices?|er)|Admin(istrator)?)([^).!:a-z0-
9].*)?$[^>]))"
procmail: Match on ! "^X-Loop: abuse(_at_)singnet(_dot_)com(_dot_)sg"
procmail: Match on ! "^X-AUTOREPLY: no.*"
procmail: Match on ! "^Subject:\ \[noautoreply\].*"
procmail: Locking "/home/abuse/submitter.lock"
procmail: Executing 
"(,formail,-I,Return-Path:,-I,Resent-From:,-I,Resent-To:,-I,Resent-Date:,-I,Resent-Subject:,-I,Resent-Message-ID:,-rD,6553
6,/home/abuse/submitter.cache,)"
(: (: No such file or directory
procmail: Program failure (1) of "("
procmail: Assigning "LASTFOLDER=( formail -I Return-Path: -I Resent-From: -I 
Resent-To: -I Resent-Date: -I Resent-Subject: -I Resent-Message-I
D: -rD 65536 /home/abuse/submitter.cache )"
procmail: Unlocking "/home/abuse/submitter.lock"
procmail: Locking "/home/abuse/autoreply.lock"
procmail: Executing " ( formail \
        -I "Return-Path:" \
        -I "Resent-From:" \
        -I "Resent-To:" \
        -I "Resent-Date:" \
        -I "Resent-Subject:" \
        -I "Resent-Message-ID:" \
        -r \
        -A "Precedence: junk" \
        -A "X-Loop: abuse(_at_)singnet(_dot_)com(_dot_)sg" \
        -i "Subject: Your submission to SingNet NetAbuse Team" ; \
   /bin/cat /home/abuse/autoreply \
  ) | $SENDMAIL -oi -t"
procmail: [19844] Fri Feb 19 13:49:51 1999
procmail: Assigning "LASTFOLDER= ( formail \
        -I "Return-Path:" \
        -I "Resent-From:" \
        -I "Resent-To:" \
        -I "Resent-Date:" \
        -I "Resent-Subject:" \
        -I "Resent-Message-ID:" \
        -r \
        -A "Precedence: junk" \
        -A "X-Loop: abuse(_at_)singnet(_dot_)com(_dot_)sg" \
        -i "Subject: Your submission to SingNet NetAbuse Team" ; \
   /bin/cat /home/abuse/autoreply \
  ) | $SENDMAIL -oi -t"
procmail: Unlocking "/home/abuse/autoreply.lock"
procmail: Locking "/var/spool/mail/abuse.lock"
procmail: Assigning "LASTFOLDER=/var/spool/mail/abuse"
procmail: Opening "/var/spool/mail/abuse"
procmail: Acquiring kernel-lock
procmail: [19844] Fri Feb 19 13:49:52 1999
procmail: Unlocking "/var/spool/mail/abuse.lock"
From mathias(_at_)staff(_dot_)singnet(_dot_)com(_dot_)sg  Fri Feb 19 13:49:49 
1999
  Folder: /var/spool/mail/abuse                                            2204
procmail: Notified comsat: "abuse(_at_)35284:/var/spool/mail/abuse"

Any help is appreciated,

TIA
Mathias

Mathias Koerber   | Tel: +65 / 471 9820    |   
mathias(_at_)staff(_dot_)singnet(_dot_)com(_dot_)sg
SingNet NOC       | Fax: +65 / 475 3273    |            
mathias(_at_)koerber(_dot_)org
Q'town Tel. Exch. | PGP: Keyid: 768/25E082BD, finger 
mathias(_at_)singnet(_dot_)com(_dot_)sg
2 Stirling Rd     |      1A 8B FC D4 93 F1 9A FC BD 98 A3 1A 0E 73 01 65
S'pore 148943     | Disclaimer: I speak only for myself
* Eifersucht ist eine Leidenschaft, die mit Eifer sucht, was Leiden schafft *

<Prev in Thread] Current Thread [Next in Thread>