-2

How to configure my linux machine to send emails from terminal.

I tried the following

apt-get install postfix mailutils
sudo systemctl start postfix
echo "Email Text" | mail -s "Subject" "user@address.com"

But the mail isn't sent.

I also checked postfix status and there is some error with guidelines.

sudo systemctl status postfix

...
Our system has detected that 550-5.7.1 this message does not meet IPv6 
sending guidelines regarding PTR 550-5.7.1 records and authentication.
...

Is there an easy way to configure my linux machine to send emails?

I'm using debian.

dkris
  • 1
  • In addition to this question being similar in context to the one noted in the previous comment, it lacks environment details that would be necessary to supply a viable answer. Is this on a home network, a hosting service, AWS, etc. is just one of many pieces of information that would be helpful. It is also too broad a question. "is there an easy way to...". I suggest that you start with the Postfix HowTo referred to in the other question. Perhaps setting Postfix to use only IPv4. – Deathgrip Aug 08 '17 at 20:27

1 Answers1

0

This is an error message provided by the SMTP server that Postifx is contacting to send your mail. It looks like an error message emitted by gmail SMTP servers. If so, see Gmail help which states (among other interesting things):

Additional guidelines for IPv6

  • The sending IP must have a PTR record (i.e., a reverse DNS of the sending IP) and it should match the IP obtained via the forward DNS resolution of the hostname specified in the PTR record. Otherwise, mail will be marked as spam or possibly rejected.
  • The sending domain should pass either SPF check or DKIM check. Otherwise, mail might be marked as spam.

The best is to use the SMTP server of your ISP, and to use authentication.

xhienne
  • 17,793
  • 2
  • 53
  • 69