Setting proper From host in Sendmail

2003-02-16 Thread Jack L. Stone
Pardon me if this is OT, but it is probably an easy question for many on
this list.

The problem:
Host on my Internal network sends out formmail replies as FROM
www.thehost.com

QUESTION:
How can I make it show the replies as being from the sender -- my web forms
provide for picking up the From field.

If I test this on my gateway/router machine, it inserts the right FROM info
as [EMAIL PROTECTED] instead of the www.

Is there some setting in Sendmail that will make that machine (aliased on
the LAN) over-ride the www and use the proper From field of the
sender...???

Appreiate any help on this as I need the proper From so that the
auto-responder can send out automatic replies to the customer.

Best regards,
Jack L. Stone,
Administrator

SageOne Net
http://www.sage-one.net
[EMAIL PROTECTED]

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



Re: Setting proper From host in Sendmail

2003-02-16 Thread Chuck Swiger
Jack L. Stone wrote:

Pardon me if this is OT, but it is probably an easy question for many on
this list.

The problem:
Host on my Internal network sends out formmail replies as FROM
www.thehost.com

QUESTION:
How can I make it show the replies as being from the sender -- my web forms
provide for picking up the From field.

If I test this on my gateway/router machine, it inserts the right FROM info
as [EMAIL PROTECTED] instead of the www.


You want formmail-generated mail to go out as [EMAIL PROTECTED]?
Add:

MASQUERADE_AS(`somewhere.net')dnl

...to your sendmail.mc (perhaps /etc/mail/freebsd.mc).  Other options, 
like masquerade_envelope, might also be required, but that's the place 
to start

-Chuck


-Chuck


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


Re: Setting proper From host in Sendmail

2003-02-16 Thread Jack L. Stone
At 10:14 AM 2.16.2003 -0500, Chuck Swiger wrote:
Jack L. Stone wrote:
 Pardon me if this is OT, but it is probably an easy question for many on
 this list.
 
 The problem:
 Host on my Internal network sends out formmail replies as FROM
 www.thehost.com
 
 QUESTION:
 How can I make it show the replies as being from the sender -- my web forms
 provide for picking up the From field.
 
 If I test this on my gateway/router machine, it inserts the right FROM info
 as [EMAIL PROTECTED] instead of the www.

You want formmail-generated mail to go out as [EMAIL PROTECTED]?
Add:

MASQUERADE_AS(`somewhere.net')dnl

...to your sendmail.mc (perhaps /etc/mail/freebsd.mc).  Other options, 
like masquerade_envelope, might also be required, but that's the place 
to start

-Chuck


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.

Any other thoughts...?? Sorry if this is not clear.

Best regards,
Jack L. Stone,
Administrator

SageOne Net
http://www.sage-one.net
[EMAIL PROTECTED]

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



Re: Setting proper From host in Sendmail

2003-02-16 Thread Chuck Swiger
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