procmail
[Top] [All Lists]

Re: autoresponder trouble

1998-09-15 18:47:39
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:
[snip]

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
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
}

To which Dallman Ross <dman(_at_)netcom(_dot_)com> responded with:

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.

[snip]

You're right, Dallman, I didn't catch that in my solution.  It's true that
the 'h' should be removed from the outer recipe, since there's no pipe on
that rule anymore ('h' means feed only the header through any pipe -- the
default feeds header and body).  Since the pipe only needs the header in
this case, it should be moved to the inner rule, as shown below.

: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
}




 \\|//                  "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>