Jack L. Stone wrote:
[ ... ]
Thanks for the reply, but that is not what I meant. I don't want the FROM
to be replaced with the machine's host name, but the FROM field of the
customer who fills in his email address in the web form. In other words,
the system isn't seeing that field and is replacing with the
"[EMAIL PROTECTED]".  That's the only way my "vacation" program can send an
> autoreply to the customer. What you suggest will just send the autoreply
> back to the machine it came from.

"perldoc -q Mail" returns some useful suggestions. I'd recommend using Mail::Mailer instead of formmail.pl, because the latter has had a iffy security record. If you feed the message into sendmail directly (as the example shows, or via vacation, for that matter), you can use the -f option to sendmail:

-fname Sets the name of the ``from'' person (i.e., the
envelope sender of the mail). This address may
also be used in the From: header if that header is
missing during initial submission. The envelope
sender address is used as the recipient for deliv-
ery status notifications and may also appear in a
Return-Path: header. -f should only be used by
``trusted'' users (normally root, daemon, and net-
work) or if the person you are trying to become is
the same as the person you are. Otherwise, an X-
Authentication-Warning header will be added to the
message.

Of course, add the userid that formmail is running as to sendmail's list of trusted users, if you wish to suppress the warning header mentioned.

10-sec# cd /tmp
11-sec# cat > test_message
Subject: a test message
From: root@localhost
To: Charlie Root
Date: about now

test 1 2 3

12-sec# sendmail -f'toor@sec' root@localhost < test_message

14-sec# tail -25 /var/mail/root
Rebuilding whatis database:

-- End of weekly output --

From [EMAIL PROTECTED] Sat Feb 15 22:33:30 2003
Return-Path: <[EMAIL PROTECTED]>
Received: from sec.codefab.com (smmsp@localhost [127.0.0.1])
by sec.codefab.com (8.12.6/8.12.6) with ESMTP id h1G3XSwb028437
for <[EMAIL PROTECTED]>; Sat, 15 Feb 2003 22:33:28 -0500(EST)
(envelope-from [EMAIL PROTECTED])
Received: (from root@localhost)
by sec.codefab.com (8.12.6/8.12.6/Submit) id h1G3XSJd028436
for root@localhost; Sat, 15 Feb 2003 22:33:28 -0500 (EST)
Message-Id: <[EMAIL PROTECTED]>
Subject: a test message
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Date: about now
X-Spam-Status: No, hits=3.6 required=8.0
tests=INVALID_DATE,NO_REAL_NAME,SPAM_PHRASE_00_01
version=2.43
X-Spam-Level: ***

test 1 2 3

-Chuck


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message


Reply via email to