This is a basic question for which I apologise. It is also something I have done before, but on this new server it is not working.
I want a backup (cron) job to email me its logfile. I use a line such as:
/bin/cat $LOGFILE | /bin/mailx -s "Backup log" email@example.com.
In the past I have succeeded without running sendmail daemon on the server in question, simply by editing the /etc/hosts file to include a line like:
But this time I am receiving the following if I run in verbose mode:
$ firstname.lastname@example.org... Connecting to [127.0.0.1] via relay...
email@example.com... Deferred: Connection refused by [127.0.0.1]
If I use /usr/bin/sendmail I get the same message. It looks to me as though mailx/sendmail is not finding my reference to the mail server.
Could someone help me find the obvious oversight I am missing?