procmail
[Top] [All Lists]

Re: How to change the "From:" for Autoresponder

2000-09-21 04:27:44
At 12:25 2000-09-21 +0200, =?UNKNOWN?Q?J=F3zsef?= Juni wrote:

How can I tell procmail to add the recipient-adress into then
"From" line of the outgoing message?

One must ask why you need to do this - having a generic "autoreply" from address might be better - certainly easier for you to implement.

MATCH assignments work sloppily at best with the TO macro with a wildcard (TO is matching against multiple headers). Chances are, the match will be goofy, and will necessitate pumping it through sed or a short perl fixer-upper. Your best bet, if you MUST have the From rewritten, is to can't get your sysadm (or yourself, if it is your box, which it looks like), to configure your MTA to add an Envelope header (commonly X-Envelope-To:), which you could use directly.

Anyway, if MATCH works with TO sufficiently well for you:

:0hc
* ^TO(_at_)juni\(_dot_)de
* !^FROM_DAEMON
* !^X-Loop: @juni\.de
{
        # note the closing bracket matched 0 or 1 times.  This helps ensure
        # that if this instance of the address was bracketed, that it will
        # close the bracket in the match.
        :0
        * ^TO\/(_dot_)*(_at_)juni\(_dot_)de\>?
        {
                # There WILL be occasional formatting issues with
                # this - plan accordingly.
                FROMADDR=$MATCH
        }

        :0
        | (formail -xrzTo: -I"Precedence: junk" \
        -I"From: $FROMADDR"; \
        -A"X-Loop: @juni.de"; \
        cat $HOME/response.txt ) | $SENDMAIL -oi -t
}

:0 A:
$DEFAULT


---
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

 Sean B. Straw / Professional Software Engineering
 Post Box 2395 / San Rafael, CA  94912-2395


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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