At 13:50 2005-01-31 +1100, Peter Chun wrote:
The recipe looks like this
------------ cut here --------------------
LOGFILE=/var/log/procmail.log
VERBOSE=yes
# mail from outside the company
:0 h c
given the logic you have in the recipe which follows, the 'c' flag is
bogus. Also, the h has no meaning at this level since the outer recipe (to
which these flags apply) is doing no delivery or manipulation of the
message, but is rather opening up a braced processing level. If you bother
to examine that VERBOSE log you're producing (which IS what you should do
when testing), you should see something like "extranious deliver-head flag
ignored" in there, which means it's a meaningless flag in this context. So
remove it.
* !^FROM_DAEMON
* !^X-Loop: hr(_at_)ticketek(_dot_)com(_dot_)au
Should more properly be:
* !^X-Loop: hr(_at_)ticketek\(_dot_)com\(_dot_)au
dots are a regexp wildcard token - if you want a real dot, you need to
escape it.
{
# send a copy to recepient also
:0 c
! hr(_at_)mimesweeper(_dot_)EXCHANGE
I'll presume this is a valid internal address. Please note that in
forwarding it, you've not yet added any loop header, so if THAT account
sends a copy back to you, you'll have a loop condition.
:0 A
The use of the 'A' flag here is somewhat curious - the prior recipe at this
nesting level doesn't actually have any conditions. The formail operation
you're using will dispose of the message body - that is, it'll cease
reading the message piped to it once it reaches a blank line, signifying
the end of the headers. Add an 'i' flag to ignore this _WRITE_ERROR_
(procmail fails to "write" everything to formail, or that's how it looks
because formail quits READING after it's read the headers). THAT will fix
the error, but the other suggestions I'm making here should also be considered.
| (formail -r \
-I"From: Ticketek Human Resources <hr(_at_)ticketek(_dot_)com(_dot_)au>"
\
-I"Precedence: junk" \
-A"X-Loop: hr(_at_)ticketek(_dot_)com(_dot_)au"; \
echo Dear Applicant, ; \
echo etc etc etc; \
echo ; \
A 'cat' operation to pull the reply body from a file may be easier to
maintain. FTR, in your list post, each of those line continuations has a
SPACE following it - you DO NOT want that in the real file, since they
won't be a line continuation, but rather an escaped space.
# Catch-all case; send this to postmaster
:0 E
The 'E' here is unnecessary if you toss the superfluous 'c' flag on the
primary recipe as advised above - if the prior message delivered the
autoreply, then execution will never reach this point.
----- The following addresses had permanent fatal errors -----
"|/usr/local/bin/procmail -m /etc/procmailrcs/hr"
(reason: can't create (user) output file)
(expanded from: <hr(_at_)inside(_dot_)ticketek(_dot_)com(_dot_)au>)
Bit of advice: follow the link in my .sigline and retrieve the files for my
"sandbox", which provide a safe(r) procmail script testing environment - it
even redefines $SENDMAIL to a script so that autoreply recipes such as
yours can be tested as-is without actually spewing forth mail.
Procmail log shows:
procmail: Error while writing to " (formail -r \
---
Sean B. Straw / Professional Software Engineering
Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
Please DO NOT carbon me on list replies. I'll get my copy from the list.
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail