2

I am using Ubuntu 18.10 and have added a short script to anacrontab. Now I get this log warning from Anacron:

Can't find sendmail at /usr/sbin/sendmail, not mailing output

I use the default Postfix for mail rather than sendmail and I receive messages from other utilities (printer jobs, usb connected etc) via the usual Gnome messages. Why is Anacron insisting on sendmail, and do I have to install sendmail just for Anacron?

2
  • 1
    What mail-type commands does your script use?
    – heynnema
    May 8, 2019 at 17:32
  • None whatsoever. May 8, 2019 at 18:07

1 Answer 1

5

sendmail is a generic command. As sendmail was an extremely common and widely used MTA, many scripts made previously assume sendmail is installed if e-mail is used.

This has forced other MTA's to emulate parts of sendmails behaviour.

If you have a look at postfix' file list you will see that it provides /usr/sbin/sendmail.

You do not have to install the sendmail MTA, but installing postfix with sudo apt install postfix will provide you with the sendmail command that emulates the behavior of the original sendmail's sendmail command.

8
  • 1
    But why do I need to instal an MTA just for Anacron? Why doesn't it report like the printer, usb port etc? May 8, 2019 at 18:06
  • 1
    You don't need to install it. But without the sendmail command it will not send e-mails with the result. Traditionally cron sends the output of commands to the user owning the job. Anacron will work fine without it.
    – vidarlo
    May 8, 2019 at 18:20
  • @vidario Thanks for your explanation. The script I am running just rsyncs two files and saves a list of installed packages. It has nothing to report if all goes well. When I run the script from the command line it just runs with no output. Anacrontab has three cronjobs already in it and until I added my job it never attempted to send mail. So I don't really understand what Anacron wants to email. May 8, 2019 at 18:41
  • 2
    Probably because some job produced some output.
    – vidarlo
    May 8, 2019 at 19:27
  • 1
    @StevenInBavaria I'd recommend to install an MTA, because at some point the anacron job might fail, and you will never know about that if anacron can not send you emails. If you do not want to install a full blown postfix, consider installing nullmailer. that is an MTA that only forwards everything to another mailserver via SMTP, much smaller and simpler to configure Sep 18, 2020 at 16:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .