Ubuntu带账号认证发邮件
Ubuntu 16.04(heirloom-mailx用s-nail替换了):
# apt-get install s-nail
# vi /etc/s-nail.rc
set smtp-use-starttls
set ssl-verify=ignore
set smtp=10.0.0.4:587
set from=zhi.yang@ming.com
set smtp-auth-user=zhi.yang@ming.com
set smtp-auth-password=123456
set smtp-auth=login
:wq
Ubuntu 14.04:
安装heirloom-mailx
# apt-get install heirloom-mailx
修改/etc/nail.rc(最后添加)
set from=zhi.yang@ming.com
set smtp=10.0.0.4
set smtp-auth-user=zhi.yang@ming.com
set smtp-auth-password=123456
set smtp-auth-login
:wq
# echo "bb" mail -s "aa" zhi.ming@ming.com 此时发件人即是zhi.yang@ming.com
Redhat系统是安装mailx软件,配置文件名为/etc/mail.rc,内容同Ubuntu
如果公司用的是exchange邮箱端口587且启用了TLS,则设置如下,并需在exchange管理端启用“User NT AUTHORITY\SELF is listed”
set smtp-use-starttls
set ssl-verify=ignore
set from=zhi.yang@ming.com
set smtp=10.0.0.4:587
set smtp-auth-user=zhi.yang@ming.com
set smtp-auth-password=123456
set smtp-auth-login
本文转自linux博客51CTO博客,原文链接http://blog.51cto.com/yangzhiming/1739882如需转载请自行联系原作者
yangzhimingg