procmail
[Top] [All Lists]

Re: Can't create output

1999-10-07 10:58:47
Martin Mokrejs <mmokrejs(_at_)natur(_dot_)cuni(_dot_)cz> writes:
 I'm having some mistake in this rcfile. I'm get from sendmail:

  ----- The following addresses had permanent fatal errors -----
"|/usr/local/bin/procmail -m LIST='montana' EXTRA='' /etc/mail/procmailrc.list
s"
   (expanded from: montana(_at_)natur(_dot_)cuni(_dot_)cz)

  ----- Transcript of session follows -----
procmail: [14160] Thu Oct  7 13:08:38 1999
procmail: Assigning "PMSRC=/etc/procmail"
procmail: Assigning "PATH=/etc/procmail:/usr/bin:/usr/local/bin:/bin:/usr/sbin
:/usr/local/sbin:"
procmail: Assigning "SHELL=/bin/sh"
procmail: Assigning "LOGFILE=/usr/majordomo/majordomo-procmail.log"
procmail: Opening "/usr/majordomo/majordomo-procmail.log"
550 "|/usr/local/bin/procmail -m LIST='montana' EXTRA='' /etc/mail/procmailrc.
lists"... Can't create output
...
Here's the recipe. Originally I thought it will work with the part
which is now commented out, but it didn't. In log I've ead, that Folder
was" *Bounced*.  Unfortunately even those two last :0 recipes don't
work.
What's wrong?

LOGABSTRACT=all
VERBOSE=yes
PMSRC=/etc/procmail
PATH=/etc/procmail:/usr/bin:/usr/local/bin:/bin:/usr/sbin:/usr/local/sbin:
SHELL=/bin/sh
LOGFILE=/usr/majordomo/majordomo-procmail.log

INCLUDERC=/etc/procmail/pm-jamime-kill.rc

:0c:
* ^X-Loop*
/usr/majordomo/rejected-mails.txt

Well, that condition doesn't do what you think.  In particular, it
matches any message which has a header field that start with "X-Loo".
In regular expressions, '*' means "zero or more of the previous regexp
term".  In this case that means the 'p', so it matches whenever there
are zero or more of them.

Beyond that, you seem to have some confusion around the normal usage of
the X-Loop:  header field.  Normally, automated mail processor add an
X-Loop: header containing their own e-mail address to any message they
send out, and they disregard any message coming in that has their
address in an X-Loop:  header.  It isn't, in general, a problem for an
incoming message to have some other address in an X-Loop: header.  So,
you should pick an address and match against it.  I would suggest using
a value of "$LIST(_at_)natur(_dot_)cuni(_dot_)cz".

The above recipe also has the 'c' flag on it, so that procmail saves a
copy of the message but then continues on with the processing.  I don't
think you really want to do that.

So, I would suggest changing that recipe to the following:

        :0:
        * $ ^X-Loop: $\LIST(_at_)natur(_dot_)cuni(_dot_)cz
        /usr/majordomo/rejected-mails.txt

The backslash in "$\LIST" tells procmail to escape regexp special
characters that happen to appear in the value.  The result is that
procmail will match the literal value of the LIST variable.  Without it
a list name that contained a '+', for instance, would never match.  The
leading dollarsign on the condition tells procmail to do variable
expansion on the rest of the condition.  Without it, $\LIST not be
expanded.


...
:0 fhiw
| $FORMAIL -b -r -t -Y -A "X-Loop: This message was already sent to list"

Since you're until feeding the header through formail, the -b and -Y
flags to formail do nothing.  The 'i' flag on the recipe should be
removed, as formail should be reading the entire header.  If it doesn't
then an error has occured.

More importantly, I don't think you want to have formail generate an
autoreply on this, as the 'resend' program from Majordomo does this
itself and will get completely confused if you do it before handing the
message to resend.  Also, doesn't Majordomo have its own methods of
catching loops?  Since I don't think it passes incoming X-Loop: header
fields through to the outgoing message, I don't even think adding one
here will help any.

<pause>

To tell the truth, I would suggest removing *all* the recipes after the
"INCLUDERC=/etc/procmail/pm-jamime-kill.rc" line and replacing them with
a simple:

        :0 w
        | /usr/majordomo/wrapper resend -l $LIST $LIST-outgoing-*-*-*,$EXTRA

and then let Majordomo do its job.


Philip Guenther

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