Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Resolve a sendmail issue with DSL and PPPoE UNIX
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
Now all is well.

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.

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 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.
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)

Resolve a sendmail issue with DSL and PPPoE | 4 comments | Create New Account
Click here to return to the 'Resolve a sendmail issue with DSL and PPPoE' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Resolve a sendmail issue with DSL and PPPoE
Authored by: jkooy on Mar 06, '03 12:41:29PM

I think you could also solve this problem by starting sendmail in a script that runs when PPPoE dials your ISP. The system will run /etc/ppp/ip-up when PPP gets connected if the script exists and is executable. This way sendmail will only start when your DSL line gets connected. The script will run as root so there may be issues.
If you want PPPoE to connect at startup you can use the ping -c 1 I enabled the network time sync in the system preferences and that seems to force PPPoE to connect on startup. I am not sure if there is a command line way of making PPPoE connect at startup without using ping or ntp or something like that.

[ Reply to This | # ]
Resolve a sendmail issue with DSL and PPPoE
Authored by: Iceberg on Mar 06, '03 03:17:11PM

Great... let's have millions of Mac users ping Google every time they connect to the net. That's not a very nice way of doing things! (yes, I'm exagerating, but you get the idea...)

A better way would be to execute a script that actually starts PPPoE or create a seperate startup item that does this and modify the StartupParameters.plist appropriately (the "Provides" and "Requires" directive).

[ Reply to This | # ]
Bad idea--Resolve a sendmail issue with DSL and PPPoE
Authored by: BraindeadMac on Mar 07, '03 07:55:19AM

Uh this is a bad idea. The ping -c 1 command will wait until the ping has returned; if the network isn't up for some reason, then it waits until ping times out. Not sure what the timeout period is for ping, probably 15 or 30 seconds, something like that.

It's also not a "good" solution as it doesn't use the proper tool for the job. Looking at what you've done, I'm not even sure your ping does anything that should make sendmail work. The fact that your network is working better now may just be fortuitous. Remember, the Sendmail script in System/Library/StartupItems/Sendmail/ just starts sendmail the first time. Once started it should run in the background as a deamon (that's what -bd does). But sendmail will have to do some name resolution at some point, which is just what your ping does. You haven't told us how your system does name resolution either (do you run your own DNS server or get one from outside) or what sendmail errors you were getting previously. Is sendmail acting as a send and receive mailer or a send only mailer? There are about a thousand reasons for sendmail to not behave as expected.

If sendmail really does "give up too quickly" (unlikely) you could force sendmail to reprocess queues by changing q1h to q5m or something like that.

You can make sure your ppp connection is "up"; you can use pppd to do this. There are a lot of "pppisup" scripts floating around out there and I've seen at least one for jaguar. I don't use ppp myself anymore, although I am contemplating switching to SBC DSL when I move in a few months.

[ Reply to This | # ]
Resolve a sendmail issue with DSL and PPPoE
Authored by: brw3sbc on Mar 07, '03 09:11:07AM

In the original message, "wealthychef" includes, in his
"Explanation" section, "DSL uses PPPoE, and connects "on
demand," . I have DSL, and use PPPoE, but I am permanently
connected. In fact, that is one of the characteristics of DSL that is
often promoted in the sales pitch for the service. Hence I am
confused as to why the author's experience is 'connect on
demand'. Also, I am wondering why a service provider would want
to provide the service as connection time sensitive. After all, it is
Ethernet, and there should be no additional hardware resources
used in the path when 'connected' than when 'not connected',
unlike traditional dial-up connections that establish a switched
path, thus consuming, for the duration of the call, resources.

I agree with other commentors that the ping idea is not a good
one, but in my experience with DSL, any proposed "pre-action" to
the Sendmail should be totally unnecessary. I am, however, open
to further enlightenment.

[ Reply to This | # ]