On Mon, Jul 01, 2024 at 09:34:39 +0100, Mark Fletcher wrote: > cron isn’t a mail sending tool — not the right place to police something > like this. Seems to me that sendmail is.
There are two possible layers here. First, a cron job (typically a shell command, or a shell script) might invoke mailx(1) or mail(1) directly. In this case, it's the responsibility of mailx or mail to format and transmit the message correctly when it invokes the /usr/sbin/sendmail program. The second case, which is much more common, is that cron(8) itself invokes /usr/sbin/sendmail to inject a message whenever a job writes output to either stdout or stderr. This output is captured by cron, and then emailed to the job's owner. hobbit:~$ strings /usr/sbin/cron | grep sendmail /usr/sbin/sendmail Looks like cron is doing what I would expect. In this case, it's cron's responsibility to make sure the message is correctly formatted. If cron is injecting mail that /usr/sbin/sendmail is rejecting due to bare LF or bare CR (for whichever implementation of /usr/sbin/sendmail is installed), then this is a bug in cron. If your cron job is calling mailx or mail directly, and one of those tools is injecting a message that gets rejected due to bare LF or bare CR, then this is a bug in mailx or mail, and should be reported as such. The same applies to any CLI MUA -- mutt, nail, s-nail, Mail, etc. Also, note that mailx has multiple implementing packages in Debian, at least two that I know of: bsd-mailx and mailutils. Make sure you file your bug reports against the correct packages.