Can't send mail from crontab, postfix error

I manage 90-some remote sites, and some of them have dynamic IP addresses from their ISPs. In order to keep track of the shifting IPs (especially now that it's thunderstorm season and there seems to be a power failure somewhere every week) I have written a little snippet which I insert in the crontab of the root user on an onsite machine that looks up the external IP address and sends an email to me once each day.

# This is root's crontab

# created on 8/8/18

# created by Cathy Fasano

MAILTO=myEmailAddress

# minute
hour
mday month
wday
command

11 9 * * *
hostname ; dig +short myip.opendns.com @resolver1.opendns.com

I've got this in the crontabs at eleven sites, and it works beautifully on eight, but with three sites I don't get any emails, and there is a cryptic postfix error in the system.log. On one computer (running 10.6.8) I am getting triplets of error messages streaming through the system.log every 10 seconds, and those were there even before I created the crontab:

Aug 27 15:01:31 10.6.8host postfix/master[23312]: fatal: 0.0.0.0:smtpd: nodename nor servname provided, or not known

Aug 27 15:01:32 10.6.8host com.apple.launchd[1] (org.postfix.master[23312]): Exited with exit code: 1

Aug 27 15:01:32 10.6.8host com.apple.launchd[1] (org.postfix.master): Throttling respawn: Will start in 9 seconds


On the other two machines that "don't work", I only get error messages right at 13:30 when cron is supposed to send email. 10.12.3 gives me the same triplet as 10.6.8, but just once:

Aug 27 09:11:02 10.12.3host com.apple.xpc.launchd[1] (com.apple.postfix.master[8120]): Service exited with abnormal code: 1

Aug 27 09:11:02 10.12.3host com.apple.xpc.launchd[1] (com.apple.postfix.master): Service only ran for 1 seconds. Pushing respawn out by 9 seconds.

Aug 27 09:11:12 10.12.3host com.apple.xpc.launchd[1] (com.apple.postfix.master[8130]): Service exited

with abnormal code: 1

While the 10.13.4 host has only the first error message of the triple:

Aug 28 13:30:02 10.13.4host com.apple.xpc.launchd[1] (com.apple.postfix.master[85473]): Service exited with abnormal code: 1


The eight machines that I'm getting email from are running 10.5.8(2), 10.8.5, 10.10.4, 10.10.5, 10.11.6(3)


Anybody know what's going wrong with postfix? Is it the operating system? Something else I'm not seeing?

Posted on Aug 28, 2018 1:50 PM

Reply

Similar questions

1 reply

Aug 28, 2018 6:36 PM in response to cathy fasano

There are commercial solutions for this. Some are free some are paid.


https://forums.techguy.org/threads/how-to-keep-track-of-a-dynamic-ip.698300/


https://dyn.com/update-client-faqs/



Did you verify that you can send email from these machines?


Aug 27 15:01:31 10.6.8host postfix/master[23312]: fatal: 0.0.0.0:smtpd: nodename nor servname provided, or not known This smells like a configuration issue.

R

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Can't send mail from crontab, postfix error

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.