LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-03-2016, 10:31 AM   #1
Bluestreak
Member
 
Registered: Feb 2003
Location: Worcester, Massachusetts
Distribution: Ubuntu 11.04 and Mandriva Powerpack 2010
Posts: 41

Rep: Reputation: 15
Post [Postfix] Sending mail through Sendgrid is failing: Reported error is connection timeout


I have been troubleshooting this issue for the last several weeks, and am at a point where I have tried everything that made sense to me. Here's the scenario:
  • Test Server
CentOS 7
Postfix configured to forward messages to root to an outlook.com email address through a Sendgrid SMTP relay. This is currently working.
Firewall is disabled. This is a VM, and is shut down when not in use.
  • Production Server
CentOS 7
Postfix configured to forward messages sent to root to a company.com email address through Sendgrid SMTP relay. This is currently not working. Error below:
Nov 3 09:55:39 SYS-MONITOR-01 postfix/error[25099]: 33E2D684F4: to=<mycompanyemail@companydomain.com>, orig_to=<root@SYS-MONITOR-01.companydomain.com>, relay=none, delay=239549, delays=239489/60/0/0.02, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to smtp.sendgrid.net[108.168.190.109]:25: Connection timed out)

Firewall enabled, allowed ports 25 and 587.

Here is a different view of the scenarios:
  • Test Server
Monitoring software -> root -> Postfix -> Sendgrid -> Company email
  • Production Server
Monitoring software -> root -> Postfix -> Firewall 25, 587 -> Sendgrid -> Company email

I needed to use a relay, because messages to the company domain were getting blocked. The whitelist tool they have requires that a message is sent to the source (test server) and a click be clicked on to verify that the source is legit (which I don't know if it's possible to do through the command line. Granted, there's curl, but that assumes that if you can actually read a message in the shell, and 'clicking' a link would open a curl session to proceed with whitelisting - time sink for me)

I also tested both scenarios with an external email address, and both worked.
  • Test Server
Monitoring software -> root -> Postfix -> Sendgrid -> Outlook email
  • Production Server
Monitoring software -> root -> Postfix -> Firewall 25, 587 -> Sendgrid -> Outlook email

So, now when I try to send it to the company email, I get the response shown above. Any ideas on what else I can try? Thank you.
 
Old 11-04-2016, 10:42 AM   #2
Bluestreak
Member
 
Registered: Feb 2003
Location: Worcester, Massachusetts
Distribution: Ubuntu 11.04 and Mandriva Powerpack 2010
Posts: 41

Original Poster
Rep: Reputation: 15
Quick update:

On the Sendgrid account, I saw that my company domain was being blocked. I added my company domain in the whitelist on the Sendgrid account, and I am still experiencing this error. I also added set up notifications of bounced messages. All I got so far was for spam sent from another account.
 
Old 11-14-2016, 02:27 PM   #3
Bluestreak
Member
 
Registered: Feb 2003
Location: Worcester, Massachusetts
Distribution: Ubuntu 11.04 and Mandriva Powerpack 2010
Posts: 41

Original Poster
Rep: Reputation: 15
[resolved]

Figured this out. The solution is two fold:

1) The production server is hosted in the cloud, and I found out last week that by default, port 25 is blocked.
2) In postfix, I had to set the port to 587 in the main.cf file.

This explained why my test server was able to send the messages. Since it's a local VM on my laptop, it did not have the port restriction that the production server had. Although messages to my company domain were in fact blocked, I was able to confirm that I could send them to an external domain, like Outlook.com.

I am now able to receive messages from the production server.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix Server unable to send certain emails :: Error - read timeout on connection custangro Linux - Enterprise 1 05-23-2012 09:50 AM
Connection timeout in postfix for e-mail messages from Asterisk ergosteur Linux - Software 8 12-10-2009 11:10 PM
Mail sending problem Postfix Connection timed out (port 25) malesh Linux - Server 3 03-20-2009 05:39 PM
smtp 0x800ccc0f error sending mail to postfix Corsari Linux - Networking 4 09-22-2008 10:51 AM
Postfix not sending mail, exits without error kevlarboxers Linux - Software 0 11-28-2004 02:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration