Cron Email – Mail Cannot Send Message: Process Exited with Non-Zero Status

cronemailssmtp

I've had a cronjob working for about a fortnight without any problems.
Then last night I checked I didn't get the email that I usually get.
I went to the terminal to try send myself an email, I got the following error:

mail: cannot send message: process exited with a non-zero status

I haven't changed anything with my ssmtp cfg file. It just stopped working, when I check and recheck everything, the code, ssmtp, everything is perfect.

I send out my emails twice a day via cronjob. The crontab hasn't been interfered either. I really don't know why it would stop working.

The system sends out emails via gmail – I've gone into the gmail account and sent out test emails, they are sent and received without any problems.

Additionally I've checked throughout google, forums, websites I don't see any mistakes. This makes sense as everything was working fine 24 hours ago, and now it's just stopped.

Q: Is there any way of diagnosing and troubleshooting how to solve such a problem?

Best Answer

I have get the same problem in an Ubuntu 14.04 server. And I find error message in /var/log/mail.err, which said:

postfix/sendmail[27115]: fatal: open /etc/postfix/main.cf: No such file or directory

Then I just reconfigured postfix and solved this problem.

sudo dpkg-reconfigure postfix
Related Question