Discussion Locked

Howto change "From" in procmail respondr

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hello, I'm running sendmail with the following procmail recipe. It works fine, but it addresses itself from 'root@mypc.mydomain'. I'd rather have it address itself from something like autoresponder@mypc.mydomain, because some folks don't get the root thing...

:0 Whc: me.lock
* $^To:.*me
* !^FROM_DAEMON
* !^X-Loop: me@myisp.provider
| formail -rD 8192 me.cache
:0 ehc
| (formail -rI"Precedence: junk" \
-A"X-Loop: me@myisp.provider " ; \
echo "I received your mail,"; \
echo "Thanks very much."; \
echo "-- "; cat $HOME/.signature \
) | $SENDMAIL -oi -t

This a basic auto-responder recipe. But I can't decipher the man pages to figure out how to overide the "from". Thanks in advance.
Keith Stewart

4 replies

by qnex

Use formail option "-I", i.e. in your example, use something like this:

formail -r -I"Precedence: junk" \
-I"From: foo@bar.org" \
(and so on as in your example.

-I will remove original "From:" header and substitue it with provided by you.HTH, HAND

by rouse

In case anyone is interested, the order of the parameters seems to be important. In the following, if I put the -I line after the -A line, then it would blow with the 'from: root...', but as it stands now - works fine!

| (formail -rI"Precedence: junk" \
-I"From: AutoResponder " ; \
-A"X-Loop: me@myisp.provider " ; \

This discussion is closed to new replies.