mik342003
By:
mik342003

Cannot send mail from my droplet

December 16, 2017 677 views
Email CentOS

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

mailx ***@gmail.com -s"TEST"
TEST
.
but I am receiving this error:

2017-12-16 18:19:17 1eQH3M-00031M-Ud ** ***@gmail.com R=lookuphost T=remote_smtp H=gmail-
smtp-in.l.google.com [209.85.232.27] 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 https://support.google.com/mail/answer/81126#authentication 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:<****@protonmail.com>: 504 5.5.2 root@localhost: Sender address rejected: need fully-qualified address

Please help :)

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.
Have another answer? Share your knowledge.