大网数据广告活动
服务器运维问答

Postfix unable to send mail to Gmail

· 52CE 我爱测

I am learning how to host a postfix server (Beginner), i have been able to receive email from gmail, but i am trying to send to Gmail, this is my "tail /var/log/mail.log" Dec 15 14:24:49 thepocketmerlin postfix/smtp[25424]: conne…

问题原文

原帖链接 · mbakabilal · CC BY-SA 4.0

I am learning how to host a postfix server (Beginner), i have been able to receive email from gmail, but i am trying to send to Gmail, this is my "tail /var/log/mail.log"

Dec 15 14:24:49 thepocketmerlin postfix/smtp[25424]: connect to gmail-smtp-in.l.google.com[172.253.112.27]:25: Connection timed out
Dec 15 14:24:49 thepocketmerlin postfix/smtp[25424]: connect to gmail-smtp-in.l.google.com[2607:f8b0:4024:c00::1a]:25: Network is unreachable
Dec 15 14:24:49 thepocketmerlin postfix/smtp[25424]: connect to alt1.gmail-smtp-in.l.google.com[2607:f8b0:4002:c08::1a]:25: Network is unreachable
Dec 15 14:25:19 thepocketmerlin postfix/smtp[25424]: connect to alt1.gmail-smtp-in.l.google.com[64.233.177.26]:25: Connection timed out
Dec 15 14:25:49 thepocketmerlin postfix/smtp[25424]: connect to alt2.gmail-smtp-in.l.google.com[173.194.68.27]:25: Connection timed out
Dec 15 14:25:49 thepocketmerlin postfix/smtp[25424]: 528BB3F132: to=<[email omitted]>, relay=none, delay=90, delays=0.03/0.01/90/0, dsn=4.4.1, status=deferred (connect to alt2.gmail-smtp in.l.google.com[173.194.68.27]:25: Connection timed out)

mailq (result)

528BB3F132      372 Tue Dec 15 14:24:19  [email omitted]
(connect to alt2.gmail-smtp-in.l.google.com[173.194.68.27]:25: Connection timed out)
                                         [email omitted]

Any Ideas?.

已采纳解答

原帖链接 · Esa Jokinen · CC BY-SA 4.0

In the comments you say it's an AWS EC2 instance. AWS restricts outbound SMTP by default. The internal firewall rules on your instance doesn't help with that, but you have to request for a removal.

How do I remove the restriction on port 25 from my EC2 instance?

Resolution

Amazon EC2 restricts outbound traffic on port 25 of all EC2 instances by default. You can request the removal of this restriction.

  1. Sign in with your AWS account, and then open the Request to remove email sending limitations form.

You'd also need...

A clear and detailed use case for sending email from your EC2 instance.

Learning how to host a mail server isn't necessarily a reason good enough for them. Securing the mail server properly so that you won't end up being used as a relay for spam is hard business.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-12-15)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。