Managing cron and similar E-Mails from headless systems
Chris Green
cl at isbd.net
Fri Feb 17 18:13:10 UTC 2017
On Fri, Feb 17, 2017 at 01:06:13PM -0500, Robert Heller wrote:
> At Fri, 17 Feb 2017 11:00:16 -0500 "Ubuntu user technical support, not
> for general discussions" <ubuntu-users at lists.ubuntu.com> wrote:
>
> >
> > On Friday 17 February 2017 06:14:01 Chris Green wrote:
> >
> > > I have several headless systems doing useful work around the place:-
> > >
> > > A Raspberry Pi providing local DNS and DHCP
> > >
> > > A Beaglebone Black on our boat monitoring temperatures and
> > > batteries
> > >
> > > An old desktop doing backups in the garage
> > >
> > > etc.
> > >
> > >
> > > Most of these have one or more cron jobs running periodic rsync
> > > backups, copying data, etc. If the cron job has an error then it
> > > sends E-Mail to the owner of the job ('chris' in most cases, might be
> > > root in a couple).
> > >
> > > It's (moderately) easy to set up an MTA and /etc/aliases so that the
> > > messages are sent to my normal E-Mail. However I can't come up with a
> > > straightforward way of indicating where the messsage is *from*.
> > >
> > > You can't just invent a domain name for the headless system because
> > > that gets the E-Mail rejected by intermediate systems that try and
> > > look up the sender host name. Cron doesn't seem to have any mechanism
> > > for setting the sender's name, cron errors just come from 'root@'.
> > >
> > > Can anyone suggest a neat way of handling this so that I know where
> > > the errors are coming from?
> > >
> > > --
> > > Chris Green
> >
> > A hosts file based home network should suffice to fix that. I did have it
>
> The OP is already running a DNS server, so he really does not need to bother
> with a hosts file.
>
> I expect the problem is that he is sending these E-Mails off the local LAN to
> some E-Mail address "in the cloud" and spam filters are going to reject them
> because the From: header will be wonky (like root at rpi3.my.local.domain).
>
That's exactly the problem.
> What he needs to do is set up a "gateway" system -- one of the machines on the
> LAN needs to be set up as an outbound SMTP server for the LAN and needs to
> Masqurade the addresses (eg rewrite the From: header) to something sane, like
> his personal E-Mail address and add an X-Orig-From: headr line with the
> original From: header. Or else set up a procmail recipe (on of the machines on
> the LAN) that forwards the messages from his personal address.
>
The headless computers which send the messages are not all on one LAN,
one is just connected via a marina WiFi link.
--
Chris Green
More information about the ubuntu-users
mailing list