1

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 protected]>, 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 protected]
(connect to alt2.gmail-smtp-in.l.google.com[173.194.68.27]:25: Connection timed out)
                                         [email protected]

Any Ideas?.

2
  • 1
    Connection timed out suggests you don't have connectivity on SMTP port 25. Probably you are trying to host the server on a connection that doesn't either allow hosting mail servers or blocks SMTP by default. Call your service provider. Dec 15, 2020 at 15:50
  • It's my own aws ec2 server and I have opened the ports egress and ingress, I was able to receive email too, but sending to Gmail keeps giving me this problem, could the problem be from reverse dns, because I didn't define it.
    – mbakabilal
    Dec 15, 2020 at 16:01

1 Answer 1

3

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .