centos set up mail server

Centos7 installs mailx-12.5-12.el7_0.x86_64 by default. If not, you can install it online with
sudo yum install mailx
mailx introduction: http://blog.chinaunix.net/uid-583036-id-2090043.html
mailx configuration: http: //blog.csdn.net/hansel/article/details/7672549
sendmail: http://server.51cto.com/463-164207.htm
sendmail command: http://man.linuxde.net/sendmail
mailx is just a send And the program that reads mail, we also have a mail transfer agent sendmail, mailx uses sendmail as an agent by default,
install
sudo yum install sendmail
#install sudo service sendmail start
#start sudo chkconfig sendmail on #set boot start
You can also install postfix
sudo yum install postfix
sudo service postfix start
sudo chkconfig postfix on
I installed sendmail, choose one of the two
Check sendmail status
zabbix@zabbixServer sbin]$ service sendmail status
Redirecting to /bin/systemctl status  sendmail.service
● sendmail.service - Sendmail Mail Transport Agent
   Loaded: loaded (/usr/lib/systemd/system/sendmail.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2016-08-09 16:27:33 CST; 14s ago
  Process: 17015 ExecStart=/usr/sbin/sendmail -bd $SENDMAIL_OPTS $SENDMAIL_OPTARG (code=exited, status=0/SUCCESS)
  Process: 16990 ExecStartPre=/etc/mail/make aliases (code=exited, status=0/SUCCESS)
  Process: 16989 ExecStartPre=/etc/mail/make (code=exited, status=0/SUCCESS)
Main PID: 17038 (sendmail)

测试:
mail [email protected] 按回车键
输入标题
test press enter
Enter content
it just a test
press enter
ctrl+d to
view mailbox:



view sendmail, mailbox queue
[zabbix@zabbixServer sbin]$ sudo sendmail -bp
/var/spool/mqueue is empty
Total requests: 0
delete Mail queue:
The files of the mail queue are saved in the /var/spool/mqueue/ folder,
rm -f /var/spool/mqueue/* delete all queues Send mail

using SMTP: http://blog.sina.com. cn/s/blog_4d22b97201019yav.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326494148&siteId=291194637
Recommended