3

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.

3 Answers 3

0

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

5

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)

1

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=<[email protected]>, 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 <[email protected]> 550-The mail server could not deliver mail to [email protected]. 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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .