procmail
[Top] [All Lists]

Re: autoresponder trouble

1998-09-16 00:30:31
On Tue, 15 Sep 1998 18:45:54 -0700, bert(_at_)tempered(_dot_)com (Roberto 
Sierra)
wrote:
At 2:00 PM 9/15/98, Didier Godefroy <dg(_at_)ulysium(_dot_)net> wrote:
I have a slight problem with an autoresponder, here's what it looks
like:
Roberto Sierra <bert(_at_)tempered(_dot_)com> responded with:
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
Yes, Roberto, I think that will work.  I'd think you'd want the h flag
on the first recipe inside the brackets, too, but my procmailese is
rusty.
:0
* !^FROM_DAEMON
* !^X-Loop: dg(_at_)ulysium(_dot_)net
* ^To(_dot_)*sales(_at_)ulysium(_dot_)net
{
    :0 ch
    | (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
}

There are a number of lesser problems here.

 1. The X-Loop checking is incorrect (i.e. it doesn't prevent loops
    unless you use the same address in both places)
 2. Standard gripe about unnecessarily lax regular expressions
 3. Standard gripe about formail -r -- use -rt on replies
 4. Remember $SENDMAILFLAGS, just for robustness

Try this:

    :0
    * ! ^FROM_DAEMON
    * ! ^X-Loop: sales(_at_)ulysium\(_dot_)net
    * ^To:(.*\<)?sales(_at_)ulysium\(_dot_)net\>
    {
        :0ch
        | ( formail -rt -A "Precedence: junk" \
                -A "X-Loop: sales(_at_)ulysium(_dot_)net" \
                -I "From: sales(_at_)ulysium(_dot_)net" ; \
            cat $FILEDIR/msg.txt ) | $SENDMAIL $SENDMAILFLAGS -t

        :0:
        $HOME/mbox
    }

I've probably overlooked something still as usual -- comments welcome :-)

And as usual, find out if you really mean ^TO_sales(_at_)ulysium(_dot_)net (see
the documentation for the ^TO_ macro), or even if sales should be a
sendmail alias rather than something in your personal .procmailrc.
(See the "virtual domain" gripes in the FAQ for some hints. The FAQ is
at <http://www.iki.fi/~era/procmail/mini-faq.html>.)

Hope this helps,

/* era */

-- 
Bot Bait: It shouldn't even matter whether  (`')  Just  (`')  http://www.iki
I am a resident of the State of Washington   \/ Married! \/   .fi/~era/

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