lxh9876543210 2019-12-08 12:53 采纳率: 0%
浏览 2708

postfix怎么实现向外部邮箱服务器进行发送邮件

网上查看了好多关于postfix的相关问题,也搭建了postfix邮箱服务器,服务器使用的是阿里云的

  • 现在的情况是搭建起来的服务器已经可以内网转发,
  • 同时进行发送和接受的465端口和995端口也开放了,使用netstat命令也可以看到postfix的465端口也是开着的
  • saslauthd里的mech也设置为了shadow

使用foxmail进行了测试,发现其不能向qq或者163邮箱发邮件,报错日志显示:

Dec  8 10:48:21  postfix/error[11668]: 190B94233A: to=<xxxx@163.com>, relay=none, delay=214848, delays=214848/0.08/0/0.01, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to 163mx01.mxmail.netease.com[220.181.14.142]:25: Connection timed out)

Dec  8 10:48:21  postfix/error[11664]: 2DEE34245A: to=<xxx@163.com>, relay=none, delay=1915, delays=1915/0.08/0/0.01, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to 163mx01.mxmail.netease.com[220.181.14.142]:25: Connection timed out)

网上查阅到的资料说,smtpd设置是将本服务器当作smtp服务器来进行设置的,而当本服务器向其他的mta进行转发邮件时是当作smtp客户端来进行操作的,所以要设置smtp相关属性。
postfix作为客户端的相关设置如下

91 #SMTP认证
692 smtp_use_tls = yes
693 smtp_enforce_tls = yes
694 smtp_tls_protocols =!SSLv2, !SSLv3
695 smtp_tls_security_level = encrypt
696 smtp_tls_ciphers = export
697 smtp_sasl_auth_enable = yes
698 smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
699 smtp_tls_CAfile = /etc/pki/myca/cacert.pem
700 smtp_tls_cert_file = /etc/pki/myca/mailcert.pem
701 smtp_tls_key_file = /etc/pki/myca/mailkey.pem
702 send_cyrus_sasl_authzid = yes

不知道是不是哪里设置的不对,当使用foxmail进行向163邮箱发邮件的时候,日志如下:

Dec  8 12:47:51 iz2ze90t0frv90qnwvybgmz postfix/smtps/smtpd[12203]: connect from unknown[27.188.250.16]
Dec  8 12:47:51 iz2ze90t0frv90qnwvybgmz postfix/smtps/smtpd[12203]: Anonymous TLS connection established from unknown[27.188.250.16]: TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)
Dec  8 12:47:51 iz2ze90t0frv90qnwvybgmz postfix/smtps/smtpd[12203]: BE7B94245B: client=unknown[xxxxx], sasl_method=LOGIN, sasl_username=xxx
Dec  8 12:47:51 iz2ze90t0frv90qnwvybgmz postfix/cleanup[12208]: BE7B94245B: message-id=<xxx@xxx>
Dec  8 12:47:51 iz2ze90t0frv90qnwvybgmz postfix/qmgr[11832]: BE7B94245B: from=<xxxx@xxx>, size=1590, nrcpt=1 (queue active)
Dec  8 12:47:51 iz2ze90t0frv90qnwvybgmz postfix/smtps/smtpd[12203]: disconnect from unknown[27.188.250.16]

然后紧接着就会显示连接超时

Dec  8 12:48:52 iz2ze90t0frv90qnwvybgmz postfix/smtp[12198]: connect to 163mx02.mxmail.netease.com[220.181.14.144]:25: Connection timed out

证书是使用openssl命令进行生成的,security_level也设置为了必须采取验证,
但是却还是会去连接163邮箱服务器的25端口,不知道为什么,各位大佬们可否指点迷津

  • 写回答

2条回答 默认 最新

  • weixin_43975295 2019-12-09 09:43
    关注

    云服务器(阿里云、腾讯云),默认是不允许向外部发送邮件的,你可以发工单问一下。

    评论

报告相同问题?

悬赏问题

  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 运筹学排序问题中的在线排序
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥30 python代码,帮调试,帮帮忙吧