sendmail Name server timeout
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...
Related videos on Youtube
broody
I'm the creator of www.nocknock.io - a 360 degree virtual tour creator. Check it out and let me know your feedbacks!
Updated on September 18, 2022Comments
-
broody over 1 year
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: [email protected] >To: [email protected] >. gmail.com: Name server timeout [email protected]... Transient parse error -- message queued for future delivery [email protected]... 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: [email protected] >Rcpt to: [email protected] >. 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.