0

I have two Debian 11 boxes with cron and postfix installed. Both seem to have the exact same config (but probably not) and one of them does deliver cron output to the correct /var/mail/user file and the other seems to do nothing with the output.

I find it difficult to search for solutions as most people seem to have problems with mailing to external addresses while I just want it in /var/mail/user.

Both work fine if I run something like echo hi | mail user.

How can I debug this? What could be the cause of it?

1 Answers1

1

Debugging usually starts with checking your logs:

  1. Is cron running and actually executing your batches?
    Check the cron logs for that.
    If not: see Why is my crontab not working, and how can I troubleshoot it?

  2. Do your batches actually generate output? Because without stdout cron won't email you. Check your existing jobs (for output redirection) and maybe create a test job that does generate output.

  3. Is cron configured to suppress sending mails?
    Check the cron configuration and/or batch specifications for an (empty) MAILTO variable.
    Check the crond start-up options, mail can be disabled using -m off or an incorrect mailer command.

  4. Is cron configured to log via syslog rather than send emails?
    Check the crond start-up options, mail is suppressed and redirected to syslog via -s.

Rob
  • 1,137
  • 7
  • Sorry, forgot to mention some of those things as I already did them: 1. Yes, they both run. 2. Yes it does output stuff, they run the same job. 3. No empty MAILTO variables exist. 4. The logs only contain the normal cron command execution lines, not the actual output. This is just default Debian out-of-the-box crond start-up options on both. – Frank Groeneveld Jun 28 '22 at 07:57