sendmail smarthost

EQ Admin

EQ Forum Admin
Staff member
I often prefer to configure sendmail on my servers to smarthost to some other dedicated smtp relay.

On older sendmail systems I would edit /etc/mail/sendmail.cf and configure the line that starts with DS.

On newer sendmail systems the following directions can be used to configure sendmail to relay email to another server such as your company or your ISP's smtp relay servers.

Open the configuration file:

# vi /etc/mail/sendmail.mc
Modify the SMART_HOST line:

define(`SMART_HOST',`smtp.your-ISP.com')
Update the configuration on the workstation / server:

# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
And then restart sendmail:
# /etc/init.d/sendmail restart
On Solaris servers the paths to the files and commands are a little different.

Here are the directions that work for me on Solaris 10:

Backup your existing configuration file:

# /bin/cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.old
Edit the template file:

# vi /usr/lib/mail/cf/sendmail.mc
Add the following lines after the DOMAIN line:
define(`SMART_HOST', `smtp.your-ISP.com')
MASQUERADE_AS(`your-domain.com')
FEATURE(`masquerade_envelope')
Remove this line if it exists:
define(`confFALLBACK_SMARTHOST', `mailhost$?m.$m$.')dnl
Create the new sendmail.cf with this command:

/usr/ccs/bin/m4 /usr/ccs/m4/cf.m4 /usr/lib/mail/cf/sendmail.mc > /etc/mail/sendmail.cf
Restart the sendmail service:
/etc/init.d/sendmail stop
/etc/init.d/sendmail start
If you have any problems you can rollback to the original copy of your sendmail.cf file.

-Raymond
 
Top