1

On my Debian system I have a traditional local-only "mail" setup. The package install set up some sensible default. (Maybe it prompted me to accept the settings; I don't remember).

EDIT: In Debian 9 and above, exim4-daemon-light is no longer installed as part of the Debian "standard task" (package set).

The main reason this is useful is for errors in cron jobs (and also at jobs), which are delivered as local "mail".

$ aptitude why exim4-daemon-light
i   exim4 Depends exim4-daemon-light | exim4-daemon-heavy | exim4-daemon-custom
$ aptitude why exim4
i   logrotate Depends    cron | anacron | cron-daemon          
i A cron      Recommends exim4 | postfix | mail-transport-agent

Fedora Workstation does not include a functioning mail setup. You have to choose to install it, and you probably need to do some extra configuration.

Ubuntu is based on Debian. On Ubuntu Desktop, assuming you installed cron (or at), will you have a (working) local mail setup for it?

EDIT: I guess on Debian 9 you already need to choose to install a mail system if you want one, despite the "Recommends".

(I have written some Ansible stuff which sets up cron jobs on a Debian system. I expect to switch the system to Ubuntu Desktop eventually. So I am thinking about the assumptions my scripts are making).

  • The recent Debian 9 comes with no MTA neither. – Tomasz Jun 12 at 22:04
  • And the cron package has the same "you should probably install ..." info. – Tomasz Jun 12 at 22:06
  • Recommends: exim4 | postfix | mail-transport-agent – Tomasz Jun 12 at 22:09
  • @Tomasz again, thanks. I've added "EDIT" lines to avoid spreading mis-information. The original question sort of depended on my confusion about this point, so that seemed the easiest way to address it. – sourcejedi Jun 12 at 22:31
  • You can also find it here: packages.debian.org/en/jessie/cron Maybe the recommendations are a bug, I don't know. Their changelog doesn't work for me now, so I can't tell when the change was introduced. – Tomasz Jun 12 at 22:39
2

Ubuntu Desktop 18.04 does not include cron.

If you do install cron, it will not automatically install a mail transport agent. The Ubuntu cron package no longer "Recommends" any "mail transport agent" packages.

(This feels like another inconsistency, as the package description for cron still says "you should probably install a mail system as well so that you can receive these messages". They didn't bother adding a Suggests in place of the Recommends... probably because no-one would really notice if they did anyway.)

Also, there is a link in the question about pam_mail. It looks like a default install of Ubuntu Desktop 18.04 still includes pam_mail lines in /etc/pam.d/* - unlike Fedora Workstation.

If you do not need mail specifically, you might be interested in systemd-cron. Apparently it logs cronjob output to the system log. If a mail system is available, it additionally sends any output as a mail.

Patches were submitted in 2012 to provide similar feature in the Debian cron package. (Except by default, it only logged output if it could not send a mail). So far the ticket has not been resolved.

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.