Women in Technology

Hear us Roar

  Update to Mac OS X Terminal, Part 3
Subject:   sendmail slowness/host name (localhost) unknown; sleeping for retry
Date:   2002-07-01 12:15:17
From:   benwillies
After following the instructions in Chris Stone's excellent article, you may notice a drastic slowdown in how long it takes sendmail to actually send something. In the /private/var/log/mail.log you'll see that sendmail goes to sleep for a full minute because it doesn't like that locahost is not in the familiar www.yourdomain.com format (hence the "sleeping" log entry).

To fix, edit the /etc/hosts file so that the line... localhost

reads... localhost mail.yourdomain.com

where mail.yourdomain.com can be anything you want (yes, anything with 3 names separated by dots will work, but I use mail.benwillies.com because I'm gonna have a real domain someday :-).

Now tell sendmail to use the /etc/hosts file to resolve localhost...

edit the /etc/mail/sendmail.cf file and uncomment the line that says...

#O HostsFile=/etc/hosts

or in other words, remove the '#' on this line. Please note that this configuration option should be put into the mc file like the DONT_BLAME_SENDMAIL option, but I don't know how to do that (define? feature?), so I just changed the cf file directly.

Now test it...

mail -s testing yourusername

Check the /private/var/log/mail.log and you will probably still see another error message, but it should have been sent anyway, without sleeping. There are lots of reasons why you might get another error, depending on your setup, which you could fix, but it still works.

If you changed the security of some of these files, like jrperry's post says below, then you will have to add write permissions to the sendmail.cf to make the changes, then remove write permissions or sendmail might complain (thanks, perry!).

I would also highly recommend the "Apple Repair Privileges Utility for 10.1.5" for getting things back to the base. This fixed some general slowness and jerkiness that I introduced by mass-changing privileges everywhere (because I was too lazy to read the logs).

BTW, this is not Apple's fault, but is caused by the new version of sendmail, which was tightened-up for security reasons. It's just a shame that sendmail couldn't circumvent some of this stuff for us little localhost guys who aren't running mail servers, but most peeps are not behind firewalls, so better safe than sorry.

Please respond if anything goes wrong because there is some other stuff you might have to do to get it perfect (smart host, etc).

Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • sendmail slowness/host name (localhost) unknown; sleeping for retry
    2002-07-09 14:43:56  dasper [View]

    Thanks. I took your advice. Now sendmail initializes quickly and I can send messages without finding errors in the mail log. I receive messages that I send to my login id. I am concerned, however, about editing sendmail.cf, as you mentioned. And I wonder why I can't receive messages from my email address when I send them with the mail command. I don't see errors occur when I do this, but I don't receive the messages in my Mozilla inbox.

    I also wonder about this message, which I see in my console.log:

    Jul 9 17:17:44 localhost lookupd[174]: DNSAgent: dns_send_query_server - timeout for