I need to send server reports to myself from my remote servers, and I don't mind them going to spam, so I don't need SPF, DKIM, etc.I tried using mailutils to send something like this: uptime | mail -s uptime foo@bar.com, but the emails don't go through. In /var/mail/root I received a message saying the HELO was invalid. So then I tried also adding -r root@my-ip, and now I don't get any error messages but I don't receive the email either.How can I do this?
How to set up a mail server on Linux only for sending admin/debug emails?
email;linux
Ok I solved it:$ apt-get install mailutils$ vim /etc/postfix/main.cfmyhostname = mydomain.com$ service postfix restartThen configure your domain's records to have mail.mydomain.com point to your machine's IP, MX record point to mail.mydomain.com, and also set the SPF using the TXT record like this: v=spf1 include:mydomain.com ip4:1.2.3.4 -all (replace for actual IP)Now you can send mails with the mail command.