Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using mail from the Mac OS X terminal to send the results of a database query to me via email. Most of the time it works, but sometimes there is a long delay before the mail arrives (often when another similar script is run). It looks like there is some kind of send queue, but I can't find any documentation mentioning this. Is there something I need to do to flush mail from the terminal?

UPDATE: Sometimes delivery doesn't even seem to happen, though I get no errors at the console. Very weird.

share|improve this question

3 Answers 3

up vote 0 down vote accepted

I think this happens because postfix in MacOSX >= 10.4 is configured to run "on demand". To enable it permanently, you have to edit

/System/Library/LaunchDaemons/org.postfix.master.plist

and add some settings:

<key>RunAtLoad</key>
<true/>
<key>OnDemand</key>
<false/>

Also see the posting from stephendv here:

http://hints.macworld.com/article.php?story=20031025022626398

share|improve this answer

OS X comes with postfix installed and configured for basic use. Its configuration files are in /etc/postfix. Documentation at postfix.org.

Look in /var/log/mail.log for possible error messages.

Look in /var/spool/postfix for queued messages which postfix has accepted but haven't gone out yet.

My guess is that your ISP is preventing outbound messages. By blocking outbound traffic destined for port 25 on other servers, ISPs can block spam sent unknowingly by infected computers. The ISP will only let your computer connect to port 25 on its designiated smtp server.

If this is your problem, add a line with smtp_fallback_relay to /etc/postfix/main.cf like this:

smtp_fallback_relay = smtp.comcast.net, smtp.myisp.net

(replacing those domain names with the domains of your ISP's smtp servers)

share|improve this answer

On SnowLeopard postfix is pre-configured to be launched on demand by launchd (see /system/library/org.postfix.master.plist).

In my case mail was sent without any PostFix configuration but the recipient's mailserver rejected it :

master-mini postfix/smtp[3691]: 0200D6FFBF0: to=<rubber@ball.com>, relay=mail.example.com[xx.xx.xx.xx]:25, delay=2.7, delays=0.01/0/1.9/0.76, dsn=5.0.0, status=bounced (host mail.example.com[xx.xx.xx.xx] said: 550-Verification failed for <nobody@master-mini.local> 550-The mail server could not deliver mail to nobody@master-mini.local. The account or domain may not exist, they may be blacklisted, or missing the proper dns entries. 550 Sender verify failed (in reply to RCPT TO command))

The recipient's mail server is complaining because master-mini.local (the local host name) is an invalid domain name. The top-level pseudo domain local is used by Zeroconf.

The solution in this case was to edit /etc/postfix/main.cf and update myhostname to a valid domain.

share|improve this answer

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.