Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
DriedSponge

Issue with Postfix send only mail server.

Recommended Posts

Posted · Original PosterOP

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

Desktop:

AMD Ryzen 7 3800X | MSI B450 TOMAHAWK MAX | G.Skill Trident Z RGB 16 GB DDR4-3600 | Gigabyte GeForce RTX 2080 SUPER 8 GB 

SK hynix Gold S31 500GB SSDSeagate Barracuda Compute 2 TB 7200RPM HDD | 1TB Samsung 860 EVO SSD | 3x Noctua NF-A14 PWM 140 mm 

Phanteks AMP 650 W 80+ Gold Certified Modular  | Phanteks Eclipse P300A Mesh Mid Tower | Windows 10 Home

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 post
Share on other sites
Posted · Original PosterOP

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

Desktop:

AMD Ryzen 7 3800X | MSI B450 TOMAHAWK MAX | G.Skill Trident Z RGB 16 GB DDR4-3600 | Gigabyte GeForce RTX 2080 SUPER 8 GB 

SK hynix Gold S31 500GB SSDSeagate Barracuda Compute 2 TB 7200RPM HDD | 1TB Samsung 860 EVO SSD | 3x Noctua NF-A14 PWM 140 mm 

Phanteks AMP 650 W 80+ Gold Certified Modular  | Phanteks Eclipse P300A Mesh Mid Tower | Windows 10 Home

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 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


×