We all know that a mail server is the first to rack the DNS service. Set up SendMail mail server for everyone to study together.
Step One, install the Snedmail service to see if you have installed SendMail.
#rpm-qa|grep Bind
#rpm-qa|grep caching*
If it is not installed, please install it on your own, usually on Linux system installation CD.
Step Two, in the original set up DNS interpretation file plus MX record, file path is:/var/named/chroot/var/named/kenson.com.zone (as shown)
Detecting MX Records:
#nslookup
>set Q=MX
>linux.kenson.com
The output is as follows:
The results shown above are not a problem with DNS.
step three, modify the /etc/mail/sendmail.mc file.
#vi/ETC/MAIL/SENDMAIL.MC
Find the next and two lines:
DNL Trust_auth_mech (' EXTERNAL digest-md5 cram-md5 LOGIN PLAIN ') dnl
DNL define (' confauth_mechanisms ', ' EXTERNAL GSSAPI digest-md5 cram-md5 LOGIN PLAIN ') dnl
#刪掉上面兩行前面的 DNL
#注意: Do not leave spaces in front of trust_auth_meth and define
DNL daemon_options (' port=smtp,addr=127.0.0.1, Name=mta ') dnl
#前面加上 DNL, start this line (DNL = do not load)
#或改成下面這樣也可以
Daemon_options (' port=smtp,addr=0.0.0.0, Name=mta ') dnl
#修改端口, find the following line.
Dnldaemon_options (' Port=submission,name=msa,m=ea ') dnl
Remove the comment from the beginning of the line and modify the content to port=25:
After modification, the following:
Daemon_options (' Port=25,name=msa ') dnl
Run the M4 program and regenerate the sendmail.cf file:
#m4/ETC/MAIL/SEDNMAIL.MC >/ETC/MAIL/SENDMAIL.CF
step Four, change the Access database file access.db
1) Open the Edit Access file and add a behavior: keson.com RELAY
#vi/etc/mail/access
Save exit, make database update
#makemap Hash/etc/mail/access.db </etc/mail/access
Start Test port
#telnet localhost 25
Then enter: Ehlo localhost as shown
Step five, modify the/etc/dovecot.conf POP3 service file
#vi/etc/dovecot.conf
Change #protocols=imap IMAPS POP3 pop3s this line into
Remove the " #" comment symbol
PROTOCOLS=POP3
This line configures the functionality of the POP3 service
Step six, mail test. Restart all services (to ensure that the service is up)
#service named restart (DNS boot)
#service dovecot Restart (POP3 service start)
#service sendmail Restart (mail service startup)
Send a message with mail to test for success
#mail [email protected]
Enter the message title, subject, and press the "Ctrl+d" key to end the send.
Check the mail log and the user's mailbox for receiving mail (user mail is in "/var/spool/mail/[linux User name]" file)
The Mail log is in the "/var/log/maillog" file, you can check it yourself, of course, you may use Windows OE to test the mail, but remember that when the OE set up the user account, the Linux account name is your e-mail address for example: the root user's email address is [ Email protected] , Root's account is also [email protected] , not root.
Also pay attention to the place is to send and receive e-mail problems, pay attention to check your log, analysis of specific issues.
Mail runs on port 53 to see if your Linux system firewall is open for this port (file "/etc/sysconfig/iptables") remember to open this port.
It's over here and I hope it will be helpful to everyone.
Linux SendMail mail Server Setup