Cannot send mail from my droplet

Posted December 16, 2017 5.1k views

Hi i have problems with sending emails from my droplets. I am usim exim. I tested for example by typing

mailx *** -s"TEST"
but I am receiving this error:

2017-12-16 18:19:17 1eQH3M-00031M-Ud ** *** R=lookuphost T=remote_smtp H=gmail- [] X=TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128 CV=yes: SMTP error from remote mail server after end of data: 550-5.7.1 This message does not have authentication information or fails to pass\n550-5.7.1 authentication checks. To best protect our users from spam, the\n550-5.7.1 message has been blocked. Please visit\n550-5.7.1 for more\n550 5.7.1 information. p14si3542435qki.429 - gsmtp

If I try protonmail:

2:ECDHE-RSA-AES256-GCM-SHA384:256 CV=yes: SMTP error from remote mail server after RCPT TO:<****>: 504 5.5.2 root@localhost: Sender address rejected: need fully-qualified address

Please help :)

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Gmail will only accept email from a configured domain so mails that say they are from user@localhost or something similar are automatically rejected. For best results, before attempting to send mail through Google’s servers you should:

Ensure your domain and PTR are set up properly. (The PTR is created automatically based on the name of your droplet. This should be a resolvable domain or subdomain name).

Create an SPF record for your domain This record will tell the receiving mail server that this IP address is authorized to send emails for your domain.

With these changes the Gmail servers should begin accepting messages from your server.

by Pablo Carranza
A carefully tailored SPF record will reduce the likelihood of your domain name getting fraudulently spoofed and keep your messages from getting flagged as spam before they reach your recipients.