procmail
[Top] [All Lists]

Re: Duplicate mail using aliases

2004-10-12 00:59:48
On Sat, Oct 09, 2004 at 04:42:32PM -0400, Don Woodward wrote:

"Dallman Ross" wrote ...


Don, if that doesn't work, turn on your verbose logging and
send the log output, please.



Don replies ...

SOLARIS works and has worked but LINUX still produces duplicates when
using an alias from /etc/aliases for the list of recipients.

In both cases, the alias entry forwards to one local address and one
external address - on LINUX only both get duplicates.

Same recipe on both except for domain names...

# forward test_letter subjects
:0
* ^Subject:.*VAND test_letter
* ^To:(_dot_)*sadmin(_at_)soldom(_dot_)com
* !^X-Loop: xloop(_at_)soldom(_dot_)com
| formail -k -X "From:" -X "Subject:" \
        -I "To: testletter" -X "To:" \
        -A "X-Loop: xloop(_at_)soldom(_dot_)com" -X "X-Loop:" \
        | $SENDMAIL -t

Something is creating the duplicates.  It's not this recipe.  It
must be an extraneous c-flag somewhere earlier up in your rc-file
on the linux machine.


Here's a sample session log from SOLARIS...

procmail: [17065] Sat Oct  9 16:32:23 2004
procmail: Assigning "COMSAT=no"
procmail: Assigning "COMSAT=no"

Why the double entry for this assignment?


procmail: Executing "/usr/local/bin/spamc"
procmail: [17065] Sat Oct  9 16:32:31 2004
procmail: Match on "^Subject:.*VAND test_letter"
procmail: Match on "^To:(_dot_)*sadmin(_at_)soldom"
procmail: Match on ! "^X-Loop: xloop(_at_)soldom"
procmail: Executing " formail -k -X "From:" -X "Subject:" \
        -I "To: testletter" -X "To:" \
        -A "X-Loop: xloop(_at_)soldom" -X "X-Loop:" \
        | $SENDMAIL -t"
procmail: Assigning "LASTFOLDER= formail -k -X "From:" -X "Subject:" \
        -I "To: testletter" -X "To:" \
        -A "X-Loop: xloop(_at_)soldom" -X "X-Loop:" \
        | $SENDMAIL -t"
From dbwoodw(_at_)earthlink(_dot_)net  Sat Oct  9 16:32:23 2004
 Subject: VAND test_letter
  Folder:  formail -k -X "From:" -X "Subject:" \         -I "To: deadl
1194

There we had successful delivery to the formail/sendmail action.

procmail: [17074] Sat Oct  9 16:32:34 2004
procmail: Assigning "COMSAT=no"
procmail: Assigning "COMSAT=no"
procmail: Executing "/usr/local/bin/spamc"
procmail: [17074] Sat Oct  9 16:32:39 2004
procmail: Match on "^Subject:.*VAND test_letter"
procmail: No match on "^To:(_dot_)*sadmin(_at_)soldom"

This is the message having re-entered your system via procmail.
More about this later.  Since the To: line was changed, the
second condition of the recipe in question fails to match and
we fall through to deliver to Don's mailbox (below).

procmail: Assigning
"PATH=/export/home/don/bin:/bin:/usr/ucb:/usr/local/bin:/usr/X/bin"
procmail: Locking "/var/mail/don.lock"
procmail: Assigning "LASTFOLDER=/var/mail/don"
procmail: Opening "/var/mail/don"
procmail: Acquiring kernel-lock
procmail: Unlocking "/var/mail/don.lock"
From root(_at_)ws5(_dot_)soldom  Sat Oct  9 16:32:34 2004
 Subject: VAND test_letter
  Folder: /var/mail/don
811



================================================

Here's a sample log from LINUX that didn't work ...

procmail: [19217] Sat Oct  9 16:24:44 2004
procmail: Assigning "COMSAT=no"
procmail: Assigning "COMSAT=no"

Again, why the double entry?


procmail: Executing "/usr/bin/spamc"
procmail: [19217] Sat Oct  9 16:24:45 2004
procmail: No match on "^Subject:.*VAND dead_letter"
procmail: Match on "^Subject:.*VAND test_letter"
procmail: Match on "^To:(_dot_)*admin(_at_)linuxdom(_dot_)com"
procmail: Match on ! "^X-Loop: xloop(_at_)linuxdom(_dot_)com"
procmail: Executing " formail -k -X "From:" -X "Subject:" \
        -I "To: testletter" -X "To:" \
        -A "X-Loop: xloop(_at_)linuxdom(_dot_)com" -X "X-Loop:" \
        | $SENDMAIL -t"
procmail: Assigning "LASTFOLDER= formail -k -X "From:" -X "Subject:" \
        -I "To: testletter" -X "To:" \
        -A "X-Loop: xloop(_at_)linuxdom(_dot_)com" -X "X-Loop:" \
        | $SENDMAIL -t"

Nothing in the log implies the formail|sendmail didn't work.
Yet the message coming through below does not have altered header
lines.

From dbwoodw(_at_)earthlink(_dot_)net  Sat Oct  9 16:24:44 2004
 Subject: VAND test_letter
  Folder:  formail -k -X "From:" -X "Subject:" \  -I "To: testletter"
1195
procmail: [19224] Sat Oct  9 16:24:45 2004
procmail: Assigning "COMSAT=no"
procmail: Assigning "COMSAT=no"
procmail: Executing "/usr/bin/spamc"
procmail: [19224] Sat Oct  9 16:24:46 2004
procmail: Match on "^Subject:.*VAND test_letter"
procmail: Match on "^To:(_dot_)*admin(_at_)linuxdom(_dot_)com"
procmail: Match on ! "^X-Loop: xloop(_at_)linuxdom(_dot_)com"

Notice that we still have the original To: line and we do
not have an X-Loop.  So either (a) this is a duplicate message cloned
by an earlier recipe you're not showing us, so it gets processed
by this recipe (as it should) causing your "duplicate delivery";
or (b) the formail command did not "take."

However, if (b), why would the message re-enter your mail system?  There
would have to be a subsequent recipe also sending things to sendmail
again, or a subsequent recipe failing to deliver and bouncing the
message back to the MTA for later attempt.  But that can't be right
either; otherwise you'd have a mail loop and your system would crash
within minutes.  You'd have hundreds of messages, not just one dupe.
So it has to be what I said above: an earlier recipe that is cloning
the message on your linux system.


procmail: Executing " formail -k -X "From:" -X "Subject:" \
        -I "To: testletter" -X "To:" \
        -A "X-Loop: xloop(_at_)linuxdom(_dot_)com" -X "X-Loop:" \
        | $SENDMAIL -t"
procmail: Assigning "LASTFOLDER= formail -k -X "From:" -X "Subject:" \
        -I "To: testletter" -X "To:" \
        -A "X-Loop: xloop(_at_)linuxdom(_dot_)com" -X "X-Loop:" \
        | $SENDMAIL -t"
From dbwoodw(_at_)earthlink(_dot_)net  Sat Oct  9 16:24:45 2004
 Subject: VAND test_letter
  Folder:  formail -k -X "From:" -X "Subject:" \  -I "To: testletter"
1195
procmail: [19233] Sat Oct  9 16:24:46 2004
procmail: Assigning "COMSAT=no"
procmail: Assigning "COMSAT=no"
procmail: Executing "/usr/bin/spamc"
procmail: [19239] Sat Oct  9 16:24:46 2004
procmail: Assigning "COMSAT=no"
procmail: Assigning "COMSAT=no"
procmail: Executing "/usr/bin/spamc"
procmail: Match on "^Subject:.*VAND test_letter"
procmail: No match on "^To:(_dot_)*admin(_at_)linuxdom(_dot_)com"
procmail: Assigning
"PATH=/home/donw1/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R
6/bin"
procmail: Locking "/var/mail/donw1.lock"
procmail: Assigning "LASTFOLDER=/var/mail/donw1"
procmail: Opening "/var/mail/donw1"
procmail: Acquiring kernel-lock
procmail: Unlocking "/var/mail/donw1.lock"
From root(_at_)webmail(_dot_)linuxdom(_dot_)com  Sat Oct  9 16:24:46 2004
 Subject: VAND test_letter
  Folder: /var/mail/donw1

The two deliveries shown here prove that (b) above is fallacious, since
there To: line *was* changed by formail in the recipe we're examining.
Once again, this points to the same theory: something has cloned this message
earlier up on your linux system.  The problem has nothing to do with the
recipe in question.

831
procmail: [19239] Sat Oct  9 16:24:47 2004
procmail: Match on "^Subject:.*VAND test_letter"
procmail: No match on "^To:(_dot_)*admin(_at_)linuxdom(_dot_)com"
procmail: Assigning
"PATH=/home/donw1/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R

Btw, why are you stating a path explicitly?  It is recommended that you not
do that unless you have an unusual reason for wanting to.  The compiled-in
path should suffice except in odd, limited situations.

6/bin"
procmail: Locking "/var/mail/donw1.lock"
procmail: Assigning "LASTFOLDER=/var/mail/donw1"
procmail: Opening "/var/mail/donw1"
procmail: Acquiring kernel-lock
procmail: Unlocking "/var/mail/donw1.lock"
From root(_at_)webmail(_dot_)linuxdom(_dot_)com  Sat Oct  9 16:24:46 2004
 Subject: VAND test_letter
  Folder: /var/mail/donw1
831

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