procmail
[Top] [All Lists]

Re: Duplicate mail using aliases

2004-10-12 05:32:30
On Tue, Oct 12, 2004 at 04:51:58AM -0400, Don Woodward wrote:


Don replies - see text starting with "*** DBW ***"


----- Original Message ----- 
"Dallman Ross" wrote ...

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.

*** DBW **** Tested with no other recipes on LINUX with same results -
Duplicates


There has to be some information missing from the description here.  I
have a few questions.  The first one is, where are you testing this
recipe from? /etc/procmailrc?  Root's private .procmailrc?  Somewhere
else?  I'm now starting to suspect you have "duelling rc-files."


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?

*** DBW *** I have "COMSAT=NO" in my procmailrc file on both systems
(SOLARIS/LINUX) otherwise I get "procmail: Notified comsat:
user(_at_)22879:/var/mail/user " - I commented this out on LINUX - no
difference - still duplicates.

Yes, the log output would be a symptom of doubled-up commands somewhere;
but the COMSAT assignment statement wouldn't itself control whether
there are dupes.


My other questions are, just what rc-files are being invoked as this
mesasge traverses your system?  1) /etc/procmailrc ? 2) root's .procmailrc ?
3) postmaster's .procmailrc?  user X's .procmailrc?

I still think somewhere in there this message is being cloned.

Here is something to try.

 1) Create a file called "myrcfile.rc" in which you put this (between
    horizontal lines):

  ----------------------- cut here -----------------------
  LOGFILE = /dev/stderr
  VERBOSE = on
  SHELL = /bin/sh
  DEFAULT = /dev/null
  LOGABSTRACT = all
  
  :0: mydelivery$LOCKEXT
  * !^X-Loop: xloop(_at_)mydom(_dot_)com
  | formail -k -X "From" -X "Subject:" \
     -I "To: whomever"                 \
     -X "To:"                          \
     -A "X-Loop: xloop(_at_)mydom(_dot_)com"      \
     -X "X-Loop:"                      \
     | cat > mydelivery
  ----------------------- cut here -----------------------


  On the command-line, type this:

  % sh -c "procmail -m myrcfile.rc 2>&1" < /dev/null | tee mytestlog


You will have some output (the log) to your screen; and you will
have a copy of the log in "mytestlog"; and you will have the delivered
message in "mydelivery", which you can cat.

I'll bet you a dollar you will have one message only (with no body)
in "mydelivery".  Your log will look a lot like this:


  procmail: [2178] Tue Oct 12 13:58:06 2004
  procmail: Assigning "SHELL=/bin/sh"
  procmail: Assigning "DEFAULT=/dev/null"
  procmail: Assigning "LOGABSTRACT=all"
  procmail: Match on ! "^X-Loop: xloop(_at_)mydom(_dot_)com"
  procmail: Locking "mydelivery.lock"
  procmail: Executing " formail -k -X "From" -X "Subject:" \
     -I "To: whomever"                 \
     -X "To:"                          \
     -A "X-Loop: xloop(_at_)mydom(_dot_)com"      \
     -X "X-Loop:"                      \
     | cat > mydelivery"
  procmail: Assigning "LASTFOLDER= formail -k -X "From" -X "Subject:" \
     -I "To: whomever"                 \
     -X "To:"                          \
     -A "X-Loop: xloop(_at_)mydom(_dot_)com"      \
     -X "X-Loop:"                      \
     | cat > mydelivery"
  procmail: Unlocking "mydelivery.lock"
    Folder:  formail -k -X "From" -X "Subject:" \    -I "To: whomever"          
1


(The LASTFOLDER line reflects the formail stuff; the bottom line is
what procmail reports on account of the pipe to "cat > mydelivery".)


By the way, notice that in the formail statement above I took the colon off the
end of the From extraction.  I think we don't want to discard the From_ (top)
line.

Also, I notice you are not saving the Date: header.  Don't you want to keep
the Date:?  (And what about Messaage-ID:?)


Another thing to try is: grab my file called "vsnag.self-test.rc" from
http://vsnag.spamless.us/src/tools and run it as an INCLUDERC just above your
relevant recipe block, per the instructions within the file in the commented
area near the top.  Look over the output in your log.

You can also run it inside the above rc-file, but it would be most useful
in the production environment (real rc with the probs).  Nevertheless, here
is my output from running that file as an INCLUDERC in "myrcfile.rc" above
the (only) recipe:

 ==================================================================
 Environment Self-Test for Procmail, Courtesy of Virus Snaggers(tm)
 ==================================================================
 * uname -a:
                 NetBSD panix5.panix.com 1.6.2 NetBSD 1.6.2
                 (PANIX-USER) #0: Tue Mar 16 21:50:26 EST 2004
                 
root(_at_)trinity(_dot_)nyc(_dot_)access(_dot_)net:/devel/netbsd/1.6.2/src/sys/arch/i386/compile/PANIX-USER
                 i386
 ------------------------------------------------------------------
    Procmail settings and states:
 ------------------------------------------------------------------
 * procmail:     /net/u/1/d/dman/bin/procmail
 * $$:           3393
 * $=:           0
 * $?:           0
 * $_:           
/htdocs/userdirs/dman/vdoms/parve/vsnag/src/tools/vsnag.self-test.rc
 * COMSAT:       no
 * DEFAULT:      /dev/null
 * DELIVERED:    -
 * DROPPRIVS:    -
 * EXITCODE:     -
 * HOME:         /net/u/1/d/dman
 * HOST:         panix5.panix.com
 * INCLUDERC:    
/htdocs/userdirs/dman/vdoms/parve/vsnag/src/tools/vsnag.self-test.rc
 * LASTFOLDER:   -
 * LINEBUF:      2048
 * LOCKEXT:      .lock
 * LOCKFILE:     -
 * LOCKSLEEP:    -
 * LOCKTIMEOUT:  -
 * LOGABSTRACT:  all
 * LOGFILE:      /dev/stderr
 * LOGNAME:      dman
 * MATCH:        -
 * MAILDIR:      .
 * MSGPREFIX:    msg.
 * NORESRETRY:   -
 * ORGMAIL:      -
 * PATH:         /net/u/1/d/dman/bin:/bin:/usr/local/bin:/usr/bin
 * PROCMAIL_OVERFLOW: -
 * PROCMAIL_VERSION: 3.23pre+
 * SENDMAIL:     /usr/sbin/sendmail
 * SENDMAILFLAGS: -oi
 * SHELL:        /bin/sh
 * SHELLFLAGS:   -c
 * SHELLMETAS:   &|<>~;?*[
 * SHIFT:        -
 * SUSPEND:      -
 * SWITCHRC:     -
 * TIMEOUT:      -
 * TRAP:         -
 * TZ:           Europe/Berlin
 * UMASK:        -
 * VERBOSE:      -
 ==================================================================
 vsnag.self-test.rc ver. 1.26B (5-Sep-04); Oct 12 14:19:40 CEST 2004
 ==================================================================

-- 
dman

____________________________________________________________
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