Resolve a sendmail issue with DSL and PPPoE

Mar 06, '03 09:45:00AM

Contributed by: wealthychef

I was recently having troubles getting sendmail to work with SBC DSL. I had enabled sendmail on my OS X box, and it had worked fine with my cable modem and AT&T broadband cable internet, but something about this PPPoE behavior confuses sendmail. The symptoms I was having was that sendmail would not send mail for me unless I sent a HUP signal or did:

 % sudo /System/Library/StartupItems/Sendmail/Sendmail restart
from the command line (both are actually the same thing). I have fixed the problem by modifying the /System -> Library -> StartupItems -> Sendmail -> Sendmail file as follows. Right before this line:
 /usr/sbin/sendmail -bd -q1h
I put this line:
 /sbin/ping -c 1 www.google.com
Now all is well.

Explanation:
DSL uses PPPoE, and connects "on demand," when a network client tries to reach another IP address on the network. Before such a client tries to connect, the TCP/IP network is (in some sense) not enabled. The above change forces PPPoE to dial up my ISP and set up TCP/IP before sendmail starts up. I guess without it, sendmail gives up too quickly for PPPoE to make the connection.

Notes:
You must put the ping command before the sendmail command, or it won't work. Also, note that the "-c 1" part is very important, or else your computer will hang at startup. Also, I chose www.google.com because it is always up on the network, so ping finds it pretty quickly. If ping hangs, your system will hang, and you'll have to restart with Command-S and edit your files with vi to fix things. You have been warned! Thanks to Sean Ahern for his help with this.

Comments (4)


Mac OS X Hints
http://hints.macworld.com/article.php?story=2003030413443420