From owner-freebsd-questions Sun Feb 16 10:38:33 2003 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 86BD837B405 for ; Sun, 16 Feb 2003 10:38:30 -0800 (PST) Received: from out002.verizon.net (out002pub.verizon.net [206.46.170.141]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3466443FA3 for ; Sun, 16 Feb 2003 10:38:29 -0800 (PST) (envelope-from cswiger@mac.com) Received: from mac.com ([129.44.41.173]) by out002.verizon.net (InterMail vM.5.01.05.20 201-253-122-126-120-20021101) with ESMTP id <20030216183828.NSSC7656.out002.verizon.net@mac.com> for ; Sun, 16 Feb 2003 12:38:28 -0600 Message-ID: <3E4FDA9F.6080508@mac.com> Date: Sun, 16 Feb 2003 13:38:23 -0500 From: Chuck Swiger Organization: The Courts of Chaos User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3b) Gecko/20030210 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd Questions Subject: Re: Setting proper From host in Sendmail References: <3.0.5.32.20030216090543.02216038@sage-one.net> <3.0.5.32.20030216090543.02216038@sage-one.net> <3.0.5.32.20030216104416.012b5258@sage-one.net> In-Reply-To: <3.0.5.32.20030216104416.012b5258@sage-one.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH at out002.verizon.net from [129.44.41.173] at Sun, 16 Feb 2003 12:38:28 -0600 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 > "www@myhost.com". 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 toor@cswiger-sec.homeip.net Sat Feb 15 22:33:30 2003 Return-Path: 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 ; Sat, 15 Feb 2003 22:33:28 -0500(EST) (envelope-from toor@cswiger-sec.homeip.net) 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: <200302160333.h1G3XSJd028436@sec.codefab.com> Subject: a test message From: root@cswiger-sec.homeip.net To: Charlie@cswiger-sec.homeip.net, Root@cswiger-sec.homeip.net 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 majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message