procmail
[Top] [All Lists]

Re: autoresponder trouble

1998-09-15 12:58:46
At 2:00 PM 9/15/98, Didier Godefroy wrote:
I have a slight problem with an autoresponder, here's what it looks like:

:0 h
* !^FROM_DAEMON
* !^X-Loop: dg(_at_)ulysium(_dot_)net
* ^To(_dot_)*sales(_at_)ulysium(_dot_)net
| (formail -r -A"Precedence: junk" \
-A "X-Loop: sales(_at_)ulysium(_dot_)net" \
-I "From: Sales(_at_)ulysium(_dot_)net" ; \
cat $FILEDIR/msg.txt) | $SENDMAIL -t

and it is followed by a simple forward to my pop mailbox.
But it doesn't send me the incoming message in my pop mailbox, it only
autoreplies and the incoming message is lost somewhere (not good).
What Am I missing to get that mail in my mailbox?

By changing the ':0 h' to ':0 hc' you'll cause a carbon copy of the
original to fall through to your mailbox.  Alternatively, if there are
additional matching tests made which might cause conflicts, then a more
correct solution would be:

:0 h
* !^FROM_DAEMON
* !^X-Loop: dg(_at_)ulysium(_dot_)net
* ^To(_dot_)*sales(_at_)ulysium(_dot_)net
{
    :0 c
    | (formail -r -A"Precedence: junk" \
        -A "X-Loop: sales(_at_)ulysium(_dot_)net" \
        -I "From: Sales(_at_)ulysium(_dot_)net" ; \
        cat $FILEDIR/msg.txt) | $SENDMAIL -t

    :0:
    $HOME/mbox      # Or wherever you keep your mail
}

Note that the second colon in ':0:' is critical, as it will cause a
lockfile to be used when writing to the mailbox.  Otherwise messages
received concurrently might become intermixed.


[take this advice with a grain of salt, as I am a procmail novice myself]



 \\|//                  "Sometimes the best move...
  - -                    is the right move."
  o o                           -- UltraMan on FIBS
   J   roberto sierra
   O   tempered microdesigns
  \_/  san francisco, ca
       bert(_at_)tempered(_dot_)com


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