procmail
[Top] [All Lists]

Re: Procmail looping problem

2003-12-08 18:35:59
Thank you for your reply.  Comments inline.


At 15:07 2003-12-08 -0800, Mike Richards wrote:
:0
* ^X-Loop: copy
/dev/null
:0fwh
| formail -A"X-Loop: copy"
:0c:
!copy(_at_)domain(_dot_)com

All you're going to achieve is setting an X-Loop header and forwarding it
reguardless of whether the header was there already.  Also, the lock is
inappropriate on the forwarding recipe - YOU aren't writing to a file.

Have you checked the message to see whether X-Loop is indeed set on the
received copy?

The received copy does indeed have the X-Loop header in it.

:0
* ! ^X-Loop:[   ]*something_a_bit_more_unique_to_you
{
         :0fwh
         | formail -A"X-Loop: something_a_bit_more_unique_to_you"

         :0c
         ! copy(_at_)domain(_dot_)com
}

:0E
/dev/null

I will certainly make it more unique however "copy" was simply for testing.
I used this recipe with the modifications and it failed to match still.  The
oddest part of this whole problem is that these exact recipes succeeded in
matching the header info on a Sendmail system I also have.  But when
migrated over to Qmail they did not.  The only true difference is how they
are invoked (my apologies for not mentioning this before).  I invoke them
from the .qmail-log file which is sent a copy of every message in the system
using Qmail's extra.h "archiving" feature.  Where as in sendmail all e-mail
was passed through the procmail system using the sendmail.cf file.

.qmail-log:
|preline /usr/local/bin/procmail /var/qmail/alias/procmailrc.alias


The tweak-and-forward operation can be rolled into one:

:0c
| formail -A"X-Loop: something_a_bit_more_unique_to_you" \
         | $SENDMAIL copy(_at_)domain(_dot_)com

I've tried this exactly to no avail.  The error message I get from procmail
is as below:

procmail: Executing "formail -A"X-Loop: copy"\
 |$SENDMAIL copy(_at_)domain(_dot_)com "
procmail: Unlocking "/var/mail/alias.lock"
/nonexistent: Can't open /nonexistent: No such file or directory

# Avoid email loops
* !^X-Header-Added: copy

"X-Header-Added:" isn't "X-Loop:"  Stick with X-Loop, it has an
established
use.

Yes it appears I copied and pasted, oops, I was using X-Header-Added before
I realized X-Loop makes more sense.

  :0fwh  #Adjust some headers before forwarding
  | formail -A"X-Header-Added: copy" \

line continuation is not appropriate here.

Again, my bad.  Thanks.

---
  Sean B. Straw / Professional Software Engineering

Thanks for the help!

Mike Richards


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

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