Header RSS Feed
If you only want to see the articles of a certain category, please click on the desired category below:
ALL Android Backup BSD Database Hacks Hardware Internet Linux Mail MySQL Monitoring Network Personal PHP Proxy Shell Solaris Unix Virtualization VMware Windows Wyse

Connection failed error when trying to send mail on Android
Thursday - Apr 22nd 2010 - by - (0 comments)
It's been bugging me for weeks. And it hasn't changed since. No, I'm not talking about volcanic eruptions on Iceland. Neither am I talking about my little cat Twix which is still not able to open the little cat-door so the cat-toilet has to stay inside... No, I'm talking about the problem of the Android Email application which can't send mails. If you try to send an e-mail using your Android Email application (not Gmail!) you may see a yellow bar which contains the disappointing text CONNECTION FAILED. Why is that, you may ask yourself. Should I have bought an iPhone instead, may be the next question. The answer to all that is to analyze the problem. On the remote mail server, the try to send the e-mail is clearly refused because of a helo check:

Apr 22 15:53:04 area-1 postfix/smtpd[23187]: NOQUEUE: reject: RCPT from area-1.ch[]: 554 5.7.1 : Helo command rejected: you are not me; from= to= proto=ESMTP helo=

A debugged log of Postfix shows the following connection coming from Android:

gprs47.swisscom-mobile.ch[]: 220 area-1.ch ESMTP Postfix (Debian/GNU) watchdog_pat: 0x559270 gprs47.swisscom-mobile.ch[]: EHLO localhost gprs47.swisscom-mobile.ch[]: 250-area-1.ch gprs47.swisscom-mobile.ch[]: 250-PIPELINING gprs47.swisscom-mobile.ch[]: 250-SIZE 10240000 gprs47.swisscom-mobile.ch[]: 250-VRFY gprs47.swisscom-mobile.ch[]: 250-ETRN lost connection after EHLO from gprs47.swisscom-mobile.ch[]

The problem is, that the used HELO/EHLO command used by the Android Email application is 'localhost' which of course is a senseless SMTP helo - everybody is localhost and you don't connect to a remote host like this. Now it would be interesting to compare this with the iPhone, and here we go:

gprs31.swisscom-mobile.ch[]: EHLO [] gprs31.swisscom-mobile.ch[]: 250-area-1.ch gprs31.swisscom-mobile.ch[]: 250-PIPELINING gprs31.swisscom-mobile.ch[]: 250-SIZE 10240000 gprs31.swisscom-mobile.ch[]: 250-VRFY gprs31.swisscom-mobile.ch[]: 250-ETRN

So here we can compare it. Android uses 'localhost' and iPhone some internal IP ( which isn't perfect either but much better than localhost. Depending on the mail server configuration this might also fail but the chances are definitely greater that the internal IP gets accepted. Many mail servers however reject remote hosts trying to send e-mails and identifying themselves as localhost for a good reason; a lot of spam servers are using this method. There is already a bug report open, issue no. 1063 handles this case. But unfortunately without resolution. I'll follow up on that and try to see what happens, when the entries in /etc/hosts are changed...


Add a comment

Show form to leave a comment

Comments (newest first):

No comments yet.

Go to Homepage home
Linux Howtos how to's
Monitoring Plugins monitoring plugins
Links links

Valid HTML 4.01 Transitional
Valid CSS!
[Valid RSS]

6937 Days
until Death of Computers