procmail
[Top] [All Lists]

Re: Duplicate mail using aliases - (Resolved)

2004-10-09 06:41:11
Dallman:

Thanks for all your help.  You were right on the money with removing the "c"
flag and the "X-loop" statements.  Below is the working recipe using an
alias with no duplicates.

#
# forward dead_letter subjects
:0 w:
* ^Subject:.*ABCD dead_letter
* ^To:(_dot_)*admin(_at_)mydom(_dot_)com
| formail -k -X "From:" -X "Subject:" \
        -I "To: deadletter" -X "To:" \
        | $SENDMAIL -t
#
#

Best regards,

Don Woodward


----- Original Message ----- 
From: "Dallman Ross" <dman(_at_)nomotek(_dot_)com>
To: <procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE>
Sent: Saturday, October 09, 2004 06:23
Subject: Re: Duplicate mail using aliases


On Fri, Oct 08, 2004 at 01:16:25PM -0400, Don Woodward wrote:

Dallman Ross  wrote ...

I don't think you wanted that "c" flag.  That is probably why you
are "seeing double."

Perhaps you only notice it with the alias because your MTA normally
won't deliver two of the identical message?  Not sure.  Anyway, take
the "c" out and I'll bet your problem will vanish.

Don Woodward replies ...

Taking the "c" out sends it off to nowhere - the emails are lost.

As I said - it works fine as copied in my email - the duplicate issue
only shows up using an alias from /etc/aliases.


Well, let's look at your recipe again:

:0cw:
* !^X-Loop: xloop(_at_)mydom(_dot_)com
* ^Subject:.*ABCD dead_letter
* ^To:(_dot_)*admin(_at_)mydom(_dot_)com
| formail -k -X "From:" -X "Subject:" \
    -I "To: bhopkins, sharon, alan, mark, veronica,
ctaylor(_at_)anotherdom(_dot_)net" \
    -X "To:" \
    -I "X-Loop: xloop(_at_)mydom(_dot_)com" -X "X-Loop:" \
    | $SENDMAIL -oi -t

The recipe is delivering the message to ( formail | sendmail ).
The original message vanishes, yes, and that is by design; this
is a delivering recipe.  (Once delivering messages are done,
procmail is finished.  The delivery can be, e.g., to a mail folder or
to an external program or process, and this is the latter case.)

So why are the messages sent through the formail/sendmail pipe
not arriving at the addresses of these six people?  It doesn't
make sense for the emails to be lost.  You should turn on verbose
logging and see what is happening at this stage.

I don't have a lot of time right this second, but I'd want to test
whether your delivery to sendmail is actually occurring.
between the end of the formail statements and sendmail.  Wait a
minute!  What is the

     -I "X-Loop" xloop.mydom.com" -X "X-Loop:"

thing all about?  I hadn't looked specifically at that before.  What
are you after with that?  It may be that you are -- yes, look (5-second
experiment):

  % formail -I "X-Loop: xloop(_at_)mydom(_dot_)com" -X "X-Loop:" < SPAMPLE
   X-Loop: xloop(_at_)mydom(_dot_)com

So of course the message disappears -- all you're piping to sendmail is
the one X-Loop: header-line!  The delivery the group is  getting is through
the fall-through from your (normally extraneous) c-flag!  That's why
your alias doesn't work; there is no longer a fall-through to the local
mailboxes of the cloned message after the piped message disappears
from the botched formail syntax.

Get rid of the

   -X "X-Loop:"

and get rid of the c-flag.

-- 
Dallman

____________________________________________________________
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



____________________________________________________________
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