DevTech101

DevTech101
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 1.00 out of 5)
Loading...

How to build and configure sendmail with HA

Mail server list
Server Name Server IP
mail1
mail2
10.10.10.21 10.10.10.22
Note: The Mail server’s are two Solaris zones running on two servers.

How to build a sendmail MC config file

cd /usr/lib/mail/cf
m4 ../m4/cf.m4 domain_mail.mc > domain_mail.cf
cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.org
cp domain_mail.cf /etc/mail/sendmail.cf
A copy of the MC config file is available below.

Solaris sendmail SMF configuration and dependency on file system

In order for sendmail not to come online if /fs1 is not mounted, the below properties need to be added to SMF.
svccfg -s sendmail addpg filesystem-remote-fs1 dependency
svccfg -s sendmail setprop filesystem-remote-fs1/entities = fmri: 'file://localhost/fs1/mail/root'
svccfg -s sendmail setprop filesystem-remote-fs1/grouping = astring: 'require_all'
svccfg -s sendmail setprop filesystem-remote-fs1/restart_on = astring: 'refresh'
svccfg -s sendmail setprop filesystem-remote-fs1/type = astring: 'path'
svcadm refresh sendmail
svcadm clear sendmail

Sendmail HA configurations

In order to rote mail to any of the two mail servers available, we add new MX records to DNS
;
;;; mail
;
mail            IN      MX 10    mail1.domain.com.
;
mail            IN      MX 20    mail1.domain.com.
;
We then modified on extmail1 & extmail2 to send email based on the MX record of mail.domain.com.

Change clients to use the new mail servers

Change the DS record on the client to point to the new mail servers.
DSmail1.domain.com:mail2.domain.com
Disable FallbackSmartHost in sendmail.cf on the client to Queue mail.
# fallback smart host
#O FallbackSmartHost=

MC Config file

cat /usr/lib/mail/cf/domain_mail.mc
divert(0)dnl
VERSIONID(`@(#)main.mc  1.5 (Sun) 08/10/00')
OSTYPE(`solaris8')dnl
DOMAIN(`solaris-generic')dnl
define(`confMAX_HEADERS_LENGTH', `32768')dnl
define(`confPID_FILE', `/etc/mail/sendmail.pid')dnl
FEATURE(`masquerade_envelope')dnl
FEATURE(`masquerade_entire_domain')dnl
MASQUERADE_AS(`domain.com')dnl
MASQUERADE_DOMAIN(`domain.com')dnl
MASQUERADE_EXCEPTION(`domain.com')dnl
MASQUERADE_EXCEPTION(`sms.domain.com')dnl
define(`SMART_HOST', `extmail.domain.com')dnl
define(`MAIL_HUB', `extmail.domain.com')dnl
LOCAL_USER_FILE(`/etc/mail/sendmail.cl')
define(`ALIAS_FILE', `/etc/mail/aliases')dnl
FEATURE(`use_cw_file')dnl
dnl FEATURE(`mailertable', `dbm -T /etc/mail/mailertable')dnl
# dnl Please contact Eli Engelman, manager of C/S, before reactivating the Generics Table feature
# dnl The genericstable is handled at the application layer, and only for certain e-mails!
dnl FEATURE(`genericstable', `dbm /etc/mail/genericstable')dnl
dnl GENERICS_DOMAIN(`domain.com')dnl
dnl GENERICS_DOMAIN(`domain.com')dnl
dnl FEATURE(`generics_entire_domain')dnl
define(`DATABASE_MAP_TYPE', `dbm')dnl
FEATURE(`redirect')dnl
FEATURE(`relay_hosts_only')
FEATURE(`relay_entire_domain')
FEATURE(`access_db', `dbm -T /etc/mail/access')
MAILER(local)dnl
MAILER(smtp)dnl
EXPOSED_USER(`root')
You might also like. External Sendmail SMTP Mail Server Configuration on Solaris
%d bloggers like this: