Lähettäjä: Marjorie Roome Päiväys: Vastaanottaja: dng Aihe: Re: [DNG] Configuring cron and exim4 to send e-mail after running
cronjob
On Sat, 2020-11-14 at 16:03 -0800, Marc Shapiro via Dng wrote: > I use Thunderbird for e-mail, so I have never bothered with
> configuring an MTA.
>
> I have a few lines in root's crontab to do periodic backups and I
> would
> like to receive an e-mail when the job is completed. I have added a
> MAILTO line to my crontab with my gmail address. The job runs, the
> backup is created, but I do not receive any e-mail from cron. I am
> assuming that I need to run dpkg-reconfigure on exim4-config, but I
> don't want to mess up my e-mail that is going through Thunderbird.
>
> Can anyone tell me how to configure exim4-config to do this, or
> provide a link that will rpovide this information?
> If this is a cron job running on your local machine then rather than
having to fully comnfigure your MTA to send acceptable emails to gmail
(i.e. static ip, spf, dkim, etcetera) it would be simpler to enable
local delivery to your local email account. You can then just read this
by setting up an account in Thunderbird (it's a mbox file so use the
spool option) and it will remain segregated from your gmail.
Rather than redirect the cron mail output I just let root user jobs go
to the default root account and alias that to my local email account
(using /etc/aliases and the newalliases command).
This will then also pick up any other root jobs that generate emails
(in my case unattended-upgrades of security updates, and failed
logins).