I've been trying to get command line sendmail to work, but no success. I need this to output my anacron error somewhere.
I've installed the sendmail package. Configured /etc/aliases with:
But whenever I'm trying to send an email to any address (root, firstname.lastname@example.org) the sendmail log keeps telling me its relayed to 'localhost' and sent. Never to be found again. Some files get made in /var/mail/mqueue.
root@tok:/var/mail# sendmail email@example.com test37 Feb 27 13:35:40 tok sendmail: r1RCZanW023616: from=tys, size=7, class=0, nrcpts=1, msgid=<201302271235.r1RCZanW023616@tok.mydomain.nl>, relay=root@localhost Feb 27 13:35:40 tok sm-mta: r1RCZe41023617: from=<firstname.lastname@example.org>, size=289, class=0, nrcpts=1, msgid=<201302271235.r1RCZanW023616@tok.mydomain.nl>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1] Feb 27 13:35:40 tok sendmail: r1RCZanW023616: email@example.com, ctladdr=tys (1000/1000), delay=00:00:04, xdelay=00:00:00, mailer=relay, pri=30007, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (r1RCZe41023617 Message accepted for delivery)
Why does it decide that firstname.lastname@example.org should be delivered to localhost and does it never try to actually connect to gmail.com?
How should I configure this? I rather don't have any mailserver running at all. I just want the
sendmail command to work and to forward my local root mails to mail address.
Can't sendmail just lookup the MX record for the rcpt domain on itself and just deliver it there?
I've also tried putting the alias in /root/.forward, tried forwarding to local file. All without success. I've ran
newaliases after editing /etc/aliases. I've tried restarting init.d/sendmail.