15

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?

  • 1
    1) Have you tried running that cron command in your usual terminal to see the output? 2) Have you checked logs (usually in /var/log) 3) Have you checked that network ports used for mailing are not blocked on your Internet connection? – webKnjaZ Feb 18 '15 at 1:08
  • Q1 Yes, I did. When I did it gave the error. Q2 Looked at the /var/log, couldn't see any problems Q3 I've tried sending mail, from home, from thethering with my cell phone, and also from work - each of them have different internet connection - and all resulted with the error in the title. – 3kstc Feb 18 '15 at 1:18
  • 1
    What logs exactly did you check? – webKnjaZ Feb 18 '15 at 1:20
  • var/log/sudo syslog - it looks fine.. seems everything is working like crock work and then it started working again, I can send emails out from the terminal now.... – 3kstc Feb 18 '15 at 21:47
  • 2
    /var/log/mail.log I guess – webKnjaZ Feb 20 '15 at 1:20
19

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
  • 3
    Could you tell us what reconfig option you selected? – Fernando Sep 6 '15 at 14:29
  • 1
    I selected server as "internet server" and domain as server domain all rest were first choice. This worked for me. – Bartosz Dabrowski Aug 16 '16 at 15:24
1

Its mainly due to file size is very large, You can zip the file and resend them..

1

On Debian I got the error

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

and an exit code of

$ echo $?
$ 36

because the hostname in /etc/hostname and the name for 127.0.0.1 in /etc/hosts differed.

0
sudo dpkg-reconfigure postfix

system mail name.

please read the log : vim /var/log/mail.err

ff@ubuntu:/var/log$ head -n 20 mail.err 
Sep  7 10:36:39 ubuntu sm-msp-queue[6302]: unable to qualify my own domain name 
(ubuntu) -- using short name
ff@ubuntu:/var/log$ 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.