Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Complete sendmail newbie here... I've been trying to get mailing to work in PHP and I've root caused it down to sendmail's complaint about "Name server timeout":

>sendmail -t -v
>From: help@me.com
>To: username@gmail.com
>.
gmail.com: Name server timeout
username@gmail.com... Transient parse error -- message queued for future delivery
username@gmail.com... queued

So it sounds like a DNS issue? But I can do a "dig mx gmail.com" and it will query successfully.

Here's what confuses me... I can get sendmail to work two other ways. The first way is through telnet:

>telnet 127.0.0.1 25
>Helo me
>Mail from: help@me.com
>Rcpt to: username@gmail.com
>.
message sent

And the second way is by explicitly appending the sendmail.cf, but this is strange because it's the exact same file I use to configure sendmail to begin with:

>sendmail -t -v -C/etc/mail/sendmail.cf

But none of these solutions will resolve my PHP mailing... I am clueless as to what is going on... appreciate any help.

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

Man, after three days I finally solved it... I don't know how much this'll apply to anyone out there cuz it's such a corner case.

So I'm working in a chrooted environment of Ubuntu on Android. When you access any type of socket in Ubuntu (sendmail, mysql, etc) your process needs to be running in group 3003 (AID_INET) or root and that's because android forces this (CONFIG_ANDROID_PARANOID_NETWORK). The reason why it worked with telnet was cuz I was root, the same reason why it worked by appending -C (-C forces sendmail to run under root...)

My lightbulb starting going off when I noticed that I could not resolve any hostnames unless I was root (ping, wget, dig,), which is a permissions issue.

SOOOO solution is to create a group called aid_inet and give it 3003, then add anything that requires sockets to that group

groupadd -g 3003 aid_inet
usermod -G aid_inet user

It is now one of my deepest wishes that this info will save some poor lost soul in the future from breaking his head on the table as I did...

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.