6. Mailscanner :: Sendmail :: 02 First Time

Table of Contents

MailScanner:: Sendmail

Setting up Sendmail for the first time

Simply copy and past the following in to a ssh session as sudo.

This assumes you already have a FQDN assigned to this server.

yum install sendmail ftp db4-devel
export MAILNAME=`grep DOMAINNAME /etc/sysconfig/network|cut -d"=" -f2`

/bin/cat << EOF >> /etc/mail/access
# USE>>>>>>>>>>>>>>>>>>>>>makemap hash /etc/mail/access.db </etc/mail/access
EOF

echo Connect:$MAILNAME RELAY >> /etc/mail/access

/bin/cat << EOF >> /etc/hosts.allow
sendmail: ALL EXCEPT \
203.204.204.204
EOF

sed -ie 's/.*DaemonPortOptions.*$/#O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA/' /etc/mail/sendmail.cf \
&& grep DaemonPortOptions /etc/mail/sendmail.cf

sed -ie 's/.*Port=smtp,Addr=127.0.0.1.*$/dnl # DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA'\'')dnl/' /etc/mail/sendmail.mc \
&& grep Port=smtp,Addr=127.0.0.1 /etc/mail/sendmail.mc

/bin/cat << EOF >> /etc/mail/local-host-names
$MAILNAME
EOF