procmail
[Top] [All Lists]

Re: procmail problem :-(

1999-02-19 05:27:22
On Fri, 19 Feb 1999 14:08:15 +0800 (SST),
Mathias Koerber <mathias(_at_)staff(_dot_)singnet(_dot_)com(_dot_)sg> wrote:
I'm trying to set up an autoreply system using procmail.

Short and sharp: Get rid of the parentheses on the first invocation of
formail.

Other than that, I have some other comments on your recipes:

SHELL=/bin/sh    # for other shells, this might need adjustment

Is this stolen from Spam Bouncer? You should probably simply always
use SHELL=/bin/sh (and make sure it's there, just in case).

SENDMAIL=/usr/sbin/sendmail

Unless you are confident that Procmail was compiled with the wrong
value for SENDMAIL, this is wrong (and otherwise you should probably
recompile Procmail).

* !^X-AUTOREPLY: no.*
* !^Subject:\ \[noautoreply\].*

The trailing .* expression is not required at all. The impact on
Procmail's efficiency is fairly minimal, but it looks inelegant.

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

You should be able to get rid of all Resent-* fields simply with 
-I "Resent-". 

You do not need to run this in a subshell, i.e. the parentheses are
unwarranted. As a matter of fact, since the command line doesn't
contain any SHELLMETAS, Procmail avoids running this in a shell, and
tries to exec() the command -- the first token on the command line --
directly. However, the first token is "(" which is not a valid command
on your system. (Hmm. Maybe () should be in SHELLMETAS.)

: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

You should probably use formail -rt rather than just formail.

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

So if they mail you on the 31st, and again on the 1st, they get two
copies after all? Hmm. You might want to look at hashd, a more general
solution than formail to this sort of problem. You'll find a link to
it at <http://www.iki.fi/~era/procmail/links.html> (look for "Eli the
Bearded" and "procutils" or something like that).

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

Huh?

 $ formail -i Resent- <<HERE
From: me
To: you
ReSent-From: here
RESENT-To: there
Resent-This: spam

(body)
HERE
 From me  Fri Feb 19 14:02:22 1999
 From: me
 To: you
 Old-ReSent-From: here
 Old-RESENT-To: there
 Old-Resent-This: spam

 (body)

Could you be running a very old version of formail or something?

/* era */

Good to see that Singnet actually +has+ an abuse staff. :^/

-- 
.obBotBait: It shouldn't even matter whether    <http://www.iki.fi/~era/>
I am a resident of the state of Washington. <http://members.xoom.com/procmail/>

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