auth login后需要输入你的qq邮箱的用户名和密码,而且要转换为BASE64编码,如QQ 352000114 用户名对应MzUwNTEwMzc2,
出现的问题:
由于qq邮箱的安全设置问题,需要开启POP3/SMTP服务获取授权码登陆;
一般通过网站发送的邮件会被认为不安全的,可以在邮箱首页-自助查询-收信查询-邮件拦截 查看被过滤的邮件
2.postfix的配置(发送邮件服务器)
vim /etc/postfix/main.cf
主要配置参数:
myhostname = mail.lysine.com
#postfix邮件系统的主机名
mydomain = lysine.com
myorigin = $mydomain
#指明发件人域名,为@后面的域名
inet_interfaces = all
#指定postfix系统监听的网络接口
inet_protocols = all
mydestination = $myhostname, localhost.$mydomain, localhost,$mydomain
#指定postfix接收邮件时的收件人域名
mynetworks = 192.168.1.0/24, 127.0.0.0/8
#指定所在网络地址,区别远程还是本地,允许本地访问
broken_sasl_auth_clients = yes
smtpd_banner = $myhostname ESMTP Server
smtpd_sasl_auth_enable = yes #服务器使用smtp认证
smtpd_client_restrictions = permit_sasl_authenticated
smtpd_sasl_security_options = noanonymous #不允许匿名登陆
message_size_limit = 5242880 #邮件大小为5M
2.smtp认证的相关配置
vim /etc/sasl2/smtp.conf
为了提高安全性,不将系统用户的密码作为相应用户SMTP认证的密码,而将在后面为用户建立SMTP认证专用的密码,并采用MD5加密方式;
vim /etc/sysconfig/saslauthd
MECH=shadow
FLAGS=sasldb2
chmod 755 /etc/sasldb2
chkconfig postfix on
发送邮件
日志查看 tailf /var/log/maillog
3.dovercot 开源的IMAP和POP3,作为MRA
vim /etc/dovecot/dovecot.conf
vim /etc/dovecot/conf.d/10-auth.conf
disable_plaintext_auth = no
auth_mechanisms = plain login
在/etc/hosts 添加本地的域名映射:192.168.1.120 mail.lysine.com
测试devocot