Jump to content

Issue with Postfix send only mail server.

Hello, I've been trying to setup my own send-only mail server so I could send emails using PHP scripts, but I've been running into some issues. Whenever I send a test email to my gmail account, it doesn't go thorugh and I get the following errors in the mail.log file:

Apr  9 06:17:55 driedsponge postfix/smtp[28482]: connect to alt1.gmail-smtp-in.l.google.com[74.125.129.27]:25: Connection timed out
Apr  9 06:18:25 driedsponge postfix/smtp[28482]: connect to alt2.gmail-smtp-in.l.google.com[142.250.11.27]:25: Connection timed out
Apr  9 06:18:55 driedsponge postfix/smtp[28482]: connect to alt3.gmail-smtp-in.l.google.com[173.194.77.27]:25: Connection timed out
Apr  9 06:19:25 driedsponge postfix/smtp[28482]: connect to alt4.gmail-smtp-in.l.google.com[64.233.177.27]:25: Connection timed out
Apr  9 06:19:25 driedsponge postfix/smtp[28482]: 57B4E26099E: to=<XXXXXXXXXXX@gmail.com>, relay=none, delay=1985, delays=1835/0.04/150/0, dsn=4.4.1, status=deferred (connect to alt4.gmail-smtp-in.l.google.com[64.233.177.27]:25: Connection timed out)

I figured it was because my ISP was probably blocking port 25, so I changed it in the master.cf file to port 587 to see if it would work, but it didn't. The only time I was actually able to send an email was when I used Gmail SMTP. I would just use the Gmail SMTP server, but it prevents me from using my own domain.

 

Any help would be much appreciated! Thank you!

 

Here are the tutorials I followed:

Configure Postfix to Use Gmail SMTP on Ubuntu
https://easyengine.io/tutorials/linux/ubuntu-postfix-gmail-smtp/

How to Install and Configure Postfix as a Send-Only SMTP Server on Ubuntu 16.04

https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-postfix-as-a-send-only-smtp-server-on-ubuntu-16-04

 

(I don't use a hosting provider, I just host off a machine I own)

Remember to quote or @mention others, so they are notified of your reply

AMD Ryzen 9 5950X | Arctic Liquid Freezer II 360 | MSI B450 TOMAHAWK MAX | G.Skill Trident Z RGB 32 GB DDR4-3600 | Gigabyte GeForce RTX 2080 SUPER 8 GB 

Samsung 980 EVO Plus 2TB | SK hynix Gold S31 500GB SSD | Seagate Barracuda Compute 2 TB 7200RPM HDD | 1TB Samsung 860 EVO SSD | 3x Phanteks T30-120

Corsair RM1000e 1000 W 80+ Gold Certified Modular PSU | Corsair 5000D Airflow Windows 11 Home

Link to comment
Share on other sites

Link to post
Share on other sites

The ISP is probably blocking the incoming 25 port, not the outgoing one, so it's probably something bad configured if you can't still send emails using GMAIL as a relay host 

 

Also, afaik GMAIL only uses SSL, from the log I can clearly see you are configuring gmail to relay mails to the port 25

Link to comment
Share on other sites

Link to post
Share on other sites

I can still send emails using the Gmail relay host, but without it, I can't. What I'm wondering is if there is a way to change the port 25 to port 587?

Remember to quote or @mention others, so they are notified of your reply

AMD Ryzen 9 5950X | Arctic Liquid Freezer II 360 | MSI B450 TOMAHAWK MAX | G.Skill Trident Z RGB 32 GB DDR4-3600 | Gigabyte GeForce RTX 2080 SUPER 8 GB 

Samsung 980 EVO Plus 2TB | SK hynix Gold S31 500GB SSD | Seagate Barracuda Compute 2 TB 7200RPM HDD | 1TB Samsung 860 EVO SSD | 3x Phanteks T30-120

Corsair RM1000e 1000 W 80+ Gold Certified Modular PSU | Corsair 5000D Airflow Windows 11 Home

Link to comment
Share on other sites

Link to post
Share on other sites

It is probably failing the PTR lookup on your IP.  Most mail servers expect the reverse name lookup to match the forward name lookup.  I'm betting that yours comes back as your ISP.  Which means you are going to fail the SPF lookups by the remote mail server and it will not accept your mail.

 

The reason it works relayed via Google is because you are using your account and it is appearing to come from gmail.

 

What is the error you get?  Have you just tried connecting directly to the MX host for the email address you are trying to send to?  Just use telnet or similar

 

telnet mail.someplace.com 25

HELO <your hostname here>

 

I bet right about there, it drops your connection.

 

-Ronan

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×