一、环境描述
[root@mysql-121~]#head-n1/etc/issue CentOSrelease6.6(Final) [root@mysql-121~]#
二、安装步骤
1.安装sendmail服务器
[root@mysql-121~]#yuminstallsendmail-y [root@mysql-121~]#servicesendmailstart [root@mysql-121~]#servicesendmailstatus
2.在/etc/mail.rc文件中添加发件人的邮箱认证信息
vi/etc/mail.rc ######addbelow############# setfrom=xxx@163.com setsmtp=smtp.163.com setsmtp-auth-user=xxx setsmtp-auth-password=xxxxx setsmtp-auth=login
3.邮件发送测试、可以发送到多个邮箱,带附件
echo"Testusingxxx@163.comtosendemail"|mail-a/root/dbbackup.log-s"ThisemailfromLinux"xxxx@139.comxxxx@qq.com
三、问题处理
1.sendmail 启动慢,需要大概3分钟
[root@mysql-121mail]#servicesendmailstop Shuttingdownsm-client:[OK] Shuttingdownsendmail:[OK] [root@mysql-121mail]#servicesendmailstart Startingsendmail:.....卡在这里几分钟
原始配置:
[root@mysql-121~]#more/etc/hosts 127.0.0.1localhostlocalhost.localdomainlocalhost4localhost4.localdomain4 ::1localhostlocalhost.localdomainlocalhost6localhost6.localdomain6 127.0.0.1mysql-121#addedbyApacheFriendsXAMPP 192.168.80.121mysql-121
修改后配置
vi/etc/hosts 127.0.0.1localhostlocalhost.localdomainmysql-121 ::1localhostlocalhost.localdomainlocalhost6localhost6.localdomain6 127.0.0.1mysql-121#addedbyApacheFriendsXAMPP 192.168.80.121mysql-121
重启,秒级别
[root@mysql-121~]#servicesendmailrestart Shuttingdownsm-client:[OK] Shuttingdownsendmail:[OK] Startingsendmail:[OK] Startingsm-client:[OK]
2.sendmail和postfix 冲突
[root@mysql-121~]#servicesendmailstatus sendmaildeadbutsubsyslocked sm-client(pid22112)isrunning...
检查postfix服务的状态
[root@mysql-121~]#servicepostfixstatus master(pid1777)isrunning...
停止postfix服务
[root@mysql-121~]#servicepostfixstop Shuttingdownpostfix:[OK]
重新启动sendmail服务
[root@mysql-121~]#servicesendmailrestart Shuttingdownsm-client:[OK] Shuttingdownsendmail:[OK] Startingsendmail:[OK] Startingsm-client:
禁用postfix在reboot后自动启动
[root@mysql-121~]#chkconfig--list|greppostfix postfix0:off1:off2:on3:on4:on5:on6:off [root@mysql-121~]#chkconfigpostfixoff [root@mysql-121~]#chkconfig--list|greppostfix postfix0:off1:off2:off3:off4:off5:off6:off [root@mysql-121~]#
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。