cron icon indicating copy to clipboard operation
cron copied to clipboard

mailer used by cron

Open jpgpi250 opened this issue 3 years ago • 1 comments

using debian, apparently, the mailer used by cron cannot be configured on debian, as a result, cron doesn't send mails.

I think cron uses the link /usr/sbin/sendmail ( ls -li -> 23829 lrwxrwxrwx 1 root root 5 Jul 13 2021 sendmail -> exim4)

  • I cannot change the link (other program will not work), I tried, renamed the existing link, than sudo ln -s /usr/bin/msmtp /usr/sbin/sendmail, cron works with this config, all other programs also work.
  • I cannot change the exim4 config, mail from other programs doesn't arrive, if I reconfigure this for cron to work)

I found to pages on the web, one says the mailer is hard coded, another says the -m option can be used to change the mailer. Unfortunatelly, the -m option isn't available on debian ( invalid option -- 'm').

can this option be added OR is there another way to change the mailer (on debian)

links I found: https://forums.freebsd.org/threads/change-cron-default-sendmail-to-mail.60400/ https://serverfault.com/questions/632250/what-mailer-does-cron-use-to-send-mail

thank you for your time and effort.

jpgpi250 avatar Jul 17 '22 16:07 jpgpi250

every system that imported cron immediately zigged or zagged in terms of modifying it to suit the tastes of the importing team and/or community. the upstream version just assumes that _PATH_SENDMAIL is defined and that it points to the system's "sendmail equivalent". i don't run sendmail but since postfix comes with a "sendmail" wrapper script i have no mail-related problems in cron. sounds to me like postfix isn't the default on debian, and that exim doesn't include a "sendmail" wrapper script.

a patch that implemented "-m" as described in the freebsd cron man page would be accepted. however, i do not know how to get debian to pay attention to such a change. i'd like debian and freebsd and the others to merge against the upstream, but those maintainers may not be motivated to do it. thanks for your report and i welcome further comments or questions.

vixie avatar Oct 11 '22 08:10 vixie

merged; thanks!

vixie avatar May 27 '23 18:05 vixie