Need to change the source address in sendmail

Stuart Sears stuart at sjsears.com
Wed Aug 4 20:10:59 UTC 2004


On Wednesday 04 August 2004 19:18, jim martin wrote:
> sorry me again.  I just found that david at abc.com source address that I had
> successfully used was not taken from my postfix conf  as it was defined as
> cba.com in /etc/postfix/main.cf  but my sendmail.mf file is defined as
> MASQUERADE_AS(`abc.com').  I am getting confused again.  What is command to
> use sendmail to send mail and what is that for postfix?  When I type mail
> -s "subject" david at yahoo.com < /file , I am using postfix or sendmail??  I
> thought the sendmail command is sendmail instead of mail  ??
no, they both use the mail command. Ideally you only run one MTA at a time as 
they both provide exactly the same functionality.
Sendmail provides the /usr/sbin/sendmail.sendmail and related binaries
postfix provides /usr/sbin/sendmail.postfix and others.

to switch between the two you need to either
do so using the 'alternatives' command (messy), or
use  redhat-switch-mail (system-switch-mail if you're using FC2).

THE FOLLOWING ASSUMES YOU HAVE DECIDED TO USE POSTFIX:
when you have done this you need to configure some basic settings.
If you are using postfix, edit /etc/postfix/main.cf as follows:

myorigin=domain.com

make sure the 'mydestination' parameter contains your 'myorigin' setting
(you _do_ have an MX record in DNS for your domain pointing to your 
hostname/ip, don't you?)

inet_interfaces = all

 - unless you wish to restrict postfix to listen on only one interface (if you 
have multiple cards). Out of the box both sendmail and postfix will only 
accept mail from localhost.
...and restart postfix (you must restart if you change the inet_interfaces 
settting)
service postfix restart

then try sending yourself some email, preferably at an external address of 
some kind, and check the 'from' address.

Steve's post below this in the thread about 'exposed users' raises valid 
points as well. Do you really want to send mail externally as 
'root at domain.com' ?
Surely you should use a non-privileged account for this?

-- 
Stuart Sears RHCE, RHCX





More information about the redhat-list mailing list