Bill Williams's picture

All emails sent from drupal system or the contact form get trapped in my mail queue with status "connect to aspmx2.googlemail.com[173.194.75.26]:25: Connection timed out" or a varient with another google MX record. Google hosts the mail for my domain and my MX records are set correctly for that. I could see google maybe rejecting it but what is odd is the connection timeout when this system has full nework conenctivity. 

The server has fine network connectivity and this happens whether I host it myself on my ISP or on amazon, ruling out amazon firewall,  and my isp does not block SMTP as I have settup and run exchange servers that were able to send mail directly. 

Forum: 
Tags: 
Jeremy Davis's picture

My first guess with emails not working (especially in a preconfigured system that should just work OOTB like TKL) is spam filtering somewhere along the line... Amazon is well known for being problematic in the regard, and common ISP dynamic IPs are also commonly flagged and blocked as spam  (because of all those compromised zombie win PCs I reckon...). ISPs also commonly blocked common server ports (such as 25 - the default SMTP port) which could also be a factor?

There is a TKL user called Chris who has written here on the forums about getting AWS servers to send email reliably (sorry no link handy but a search should turn up something), although with google as your SMTP you may also need to do some work there too?

Bill Williams's picture

Thanks for the suggestion. I really don't think its spam because when I had a AWS micro instance running the same drupal that wasn't based on a turnkey appliance it worked. Also the error indicates a connection time out but when I shell into the appliance I have no prolem telenetting to and getting a valid smtp reply from telnet aspmx2.googlemail.com 25

Chris Musty's picture

Re spam Ensure you set up your host name correctly or HELO requests will flag you. Reverse dns should also be setup with aws and note if you are sending email through Gmail they have strict sending policies. 

As for the time outs I would imagine some kind of server configuration is causing that. Do you have your domain records hosted with a reliable registrar? The cheap ones are in the us and they can have considerable latency from here. 

Post the email headers so we can see what's happening. If it's Gmail you can open the email and go to settings then show original. If from postfix you could install mutt and read emails from the command line. 

I am on a phone so it's hard to go into detail sorry. 

Chris Musty

Director

Specialised Technologies

Bill Williams's picture

I have the DNS records on amazon route 53. Google is where the MX records point. The only errors I get are from emails generated on my server, ie the drupal contact form or drupal generated emails. These emails get trapped in the postfix message que and show the error I posted originally.

I guess I need to configure postfix to relay through google since it is not the server that actually hosts the email?

Thanks for the help.

Chris Musty's picture

You do not have to route through gmail.

I run my email on googles servers (ie mx pointed to google) and can send emails from drupal, wordpress and joomla without config on my own servers (although without some config spam filters would go nuts).

Have you changed postfix config at all (/etc/postfix/main.cf)?

Have a look in you log messages for postfix and mail.err and post the results.

Basically would need more info.

Chris Musty

Director

Specialised Technologies

Add new comment