外部电子邮件连接被拒绝 [英] Outside e-mail connection refused

查看:222
本文介绍了外部电子邮件连接被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已将Postfix设置为在Microsoft Azure内运行的Ubuntu 18.04上的邮件服务器.我们的目标是将域名(worthingtonhistoricalsociety.org)用作电子邮件地址的一部分,该电子邮件地址将自动将电子邮件转发给我们的每个用户帐户. 因此,发送到john.doe@worthingtonhistoricalsociety.org的电子邮件将自动转发到jdoe@someothere-mail.com.我们计划对8-9个地址执行此操作.我们已完成以下操作:配置/var/postfix/main.cf,(从Azure门户)打开端口25以入站 和出站流量,确保没有正在运行的防火墙阻止流量,更新和验证A记录和MX记录,检查iptables以确保那里没有阻塞.我们可以从服务器发送电子邮件.服务器将不会收到电子邮件. 因此,问题似乎是服务器方面的接收,而不是传输.我已经监视了/var/log/e-mail.log,没有证据表明正在接收电子邮件.我已经收到并可以转发几封退回给我的退回电子邮件" 给我自己发送电子邮件后. 退回"消息指出"

还有其他我们可以/应该取消阻止的功能来接收和转发电子邮件吗? 我们已经了解了一项服务"ScanGrid",该服务也可以在Microsoft Azure下运行.此转发方案是否适合于ScanGrid?如果是这样,是否有任何文档说明如何设置MX记录以指向它?

预先感谢您的帮助.

解决方案

我个人建议您调查SendGrid而不是设置邮件服务器

https://docs.microsoft.com/zh-CN /azure/sendgrid-dotnet-how-to-send-email

https://sendgrid.com/docs/for-developers/sending-email/postfix/

我们为您的情况提供此服务,并且可能会为您提供更多功能和更轻松的设置.另外,在收件人中由于将IP列入黑名单而导致收件人没有收到邮件时,在Azure中托管邮件服务器时也存在一些已知问题.

如果您决定继续使用当前的解决方案,请检查以确保您还有一个网络安全组,该网络安全组允许在子网级别上访问端口25的流量.您可以在子网和VM级别上都具有NSG.如果您转到虚拟网络,请选择子网, 选择您的子网,您可以查看是否有任何NSG.如果未添加,则要在VM上添加相同的NSG,以确保端口25上允许流量.

我不确定您是否在遵循任何文档,但是我确实在Ubuntu网站上找到了一些信息来帮助设置PostFix.可能也有帮助

https://help.ubuntu.com/lts/serverguide/postfix.html

通常,如果您遇到连接被拒绝的错误,则可能是来宾OS阻止了流量.

我可能建议您设置防火墙iptables,而不只是禁用防火墙

https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-using-iptables-on-ubuntu-14-04


We have set up Postfix as a mail server on Ubuntu 18.04 running inside Microsoft Azure. Our goal is to use our domain name (worthingtonhistoricalsociety.org) as part of an e-mail address that will automatically forward e-mail to each of our users accounts. Thus, e-mail sent to john.doe@worthingtonhistoricalsociety.org will automatically forward to jdoe@someothere-mail.com. We plan to do this for 8-9 addresses. We have done the following: Configured /var/postfix/main.cf, (from Azure portal) open Port 25 to inbound and outbound traffic, insured there is no firewall running that would block traffic, updated and verified A records and MX records, checked iptables to be sure there is no blocking there. We can send e-mail from the server. The server will not receive e-mail. The problem thus appears to be reception on the part of the server, not transmission. I have monitored /var/log/e-mail.log, there is no evidence that e-mails are being received. I have received and can forward several 'bounced e-mails' that came back to me after sending e-mail to myself. The 'bounce' message states that 'the recipient's email system refused to accept a connection from your email system'.

Is there anything else we can/should unblock to receive and forward e-mail? We have read about a service, 'ScanGrid' which also runs under Microsoft Azure. Is this forwarding scheme an appropriate use of ScanGrid. If so, is there any documentation of how to set up the MX records to point to it?

Thanks in advance for your help.

解决方案

I personally would suggest you look into SendGrid rather than setting up a mail server

https://docs.microsoft.com/en-us/azure/sendgrid-dotnet-how-to-send-email

https://sendgrid.com/docs/for-developers/sending-email/postfix/

We have this service for cases such as yours and will likely provide you with more capability and easier setup. Also, there have been known issues when hosting a mail server in Azure when it comes to recipients not getting mail due to IPs being blacklisted. 

If you decided to proceed with this current solution, check to make sure you also have a network security group allowing traffic to port 25 on your subnet level. You can have NSGs on both subnets and VM levels. If you go to the virtual network, select subnets, select your subnet you can see if you have any NSGs. If not add the same NSG you have on the VM to ensure traffic is allowed on port 25. 

I am not sure if you are following any documentation but I did find some info on the Ubuntu site to help setup PostFix. It might also help

https://help.ubuntu.com/lts/serverguide/postfix.html

Generally if you are getting a connection refused error it is something with the Guest OS that is blocking traffic. 

I might suggest setting up the firewall iptables instead of just disabling the firewall 

https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-using-iptables-on-ubuntu-14-04


这篇关于外部电子邮件连接被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆