On 2017-09-20 11:45, Bas Zoutendijk wrote: > When I boot at home, Cron sends mail to root@hostname.homedomain. > ‘homedomain’ is automatically added to all host names on my home > network by the router. It can only be resolved inside the network; it > is not a registered domain name. I can receive mail from Cron just > fine. > > When I boot at work, Cron sends mail to root@hostname. Note that the > domain name ‘workdomain’ is not added to the host name. I can still > receive Cron mail. However, when I take the laptop home without > rebooting and connect to the home network, Sendmail is unable to > deliver the Cron mail for root@hostname.homedomain and sends > notifications of this to root@hostname.homedomain, which somehow do > seem to arrive without problems. The error message is “config error: > mail loops back to me”.
According to crontab(5), you can configure where the mail is sent, by setting the MAILTO variable in the crontab file. [This is for cronie, I am not sure if other cron variants do this.] So, you could tell it to send to <me@localhost>; presumably this would solve the problem. Despite being one of the retro/traditionalist guys on this list, I have to say installing sendmail just for this purpose doesn't seem proportionate. Even if you don't want to look into the smallish MTA packages (nullmailer etc.), you can make /usr/sbin/sendmail to be a pretty trivial script (or a link to one) that just locks the destination mailbox and appends the input to it. Heck, procmail could do that. -- Please don't Cc: me privately on mailing lists and Usenet, if you also post the followup to the list or newsgroup. Do obvious transformation on domain to reply privately _only_ on Usenet.