Sendmail.v7

From Access Information
Jump to: navigation, search


Installing New Server Mrepo smartd RAID Hardening YUM Crontabs LogWatch systemctl firewalld CentOS 7
Packages
Apache Bind Cacti DHCP mariadb Samba Sarg Sendmail Smokeping Rsync Work Apps
Problems VPN VPN Win Extras Bash MailScanner Horde Google CE Wake Up KVM
Other Computer Lab ISO2USB aiContact Google CE Android USB Live SRS XML

YUM

yum remove postfix
yum install sendmail sendmail-cf

Sendmail Setup

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

systemctl

systemctl status sendmail
systemctl start sendmail
systemctl enable sendmail

ERROR

SYSERR(root): savemail: cannot save rejected email anywhere
/etc/aliases
MAILER-DAEMON:    postmaster

To the top of the file and make sure root (postmaster) goes some where valid.

Smart Host

Using Google

For Sendmail V8.12 and above 1. Set your authorization informations by putting the following line to /etc/mail/authinfo file:

AuthInfo:relay.dnsexit.com "U:USERNAME" "P:PASSWORD" "M:PLAIN"

Note: Replace USERNAME and PASSWORD with the DNSEXIT mail relay username and PASSWORD.

2. Add following lines to /etc/mail/sendmail.mc (check if apropriate settings doesn't already exists):

define(`SMART_HOST', `relay.dnsexit.com')  
FEATURE(`authinfo')

3. Update sendmail.cf and access.db files:

cd /etc/mail  
m4 sendmail.mc >sendmail.cf  
makemap hash authinfo < authinfo 

4. Reload or restart sendmail:

systemctl restart sendmail

For any version of Sendmail

1. Set your authorization informations by adding following line to /etc/mail/access file:

AuthInfo:relay.dnsexit.com "U:USERNAME" "P:PASSWORD" "M:PLAIN"

Note: Replace USERNAME and PASSWORD with the DNSEXIT mail relay username and PASSWORD.

2. Add following lines to /etc/mail/sendmail.mc (check if apropriate settings doesn't already exists):

define(`SMART_HOST', `relay.dnsexit.com')  
FEATURE(`access_db')

3. Update sendmail.cf and access.db files:

cd /etc/mail  
m4 sendmail.mc >sendmail.cf  
makemap hash access <access 

4. Reload or restart sendmail:

systemctl restart sendmail

Note: If it does not work, you need to make sure the saslauthd is running on the server. saslauthd is the daemon for sending authentication . You may issue "service saslauthd start" to start the service.

testing

mail -s test fred@dagg.net.nz <.bash_profile

Then

tail -f /var/log/maillog

Finally

emacs /etc/aliases

and change

root:           fred@dagg.net.nz

to finish

newaliases

What you might like to do now is from this server send an email to root and see if your alias gets it.

And Test:

mail -s test root <.bash_profile
  • Did you find this page useful?
  • Do you have an issue that you have not yet fixed?

We can do this for you.

I am available for technical support. Please follow this link. Tech Support Request.
+64-6-880-0000 : ++1-808-498-7146 : help@ai.net.nz
Getting us to help you