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:
root: [email protected]
But whenever I'm trying to send an email to any address (root, [email protected]) 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.
Log output:
root@tok:/var/mail# sendmail [email protected] test37
Feb 27 13:35:40 tok sendmail[23616]: r1RCZanW023616: from=tys, size=7, class=0, nrcpts=1, msgid=<[email protected]>, relay=root@localhost
Feb 27 13:35:40 tok sm-mta[23617]: r1RCZe41023617: from=<[email protected]>, size=289, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb 27 13:35:40 tok sendmail[23616]: r1RCZanW023616: [email protected], 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 [email protected] 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.