Receive mail from all of your crons into one mailbox, digest and filter.
Normal usage, just update Cron to mail your account on this system.
The value for $HASH
should be replaced with your cronmail account hash.
MAILTO="$HASH@cronmail.io"
Works with
exim,
msmtp,
postfix,
sendmail,
ssmtp
and a custom sendmail script that uses curl
Call me old-school but I still use cron. I use them all, dcron , fcron, vcron -- all the time. And I use them all all kinds of things, database-servers, app-servers, bare-iron, VPS, containers, IOT-devices, Raspberry Pi. Cron is just very useful and (mostly) depends on SMTP for delivery.
But! I have a problem. See, I have to configure all these devices (I mean, I have to deploy no matter what, scripted or not). In this process I needed to get these systems to send mail, just for cron. I want the cron output.
There are many options, various mail clients such as Exim, Postfix and Sendmail and single-purpose mailers such as sSMTP. The first three seem overweight and require more configuration than seems necessary for what is ultimately a null-mailer. That leaves sSMTP, which requires an upstream mailhub, which I then have to configure too. And that mailhub configuration is not so dynamic that systems can be added/removed easily.
For ages I maintained a proper mailhub for all these systems and evenutally landed on a solution that looked like what you see here. I abstracted a little, setup a dedicated host and built some front-end scripts.