Fail to send Email to Gmail ....

I’ve actually configured postfix as on this tutorial: How to Install and Configure Postfix as a Send-Only SMTP Server on Ubuntu 16.04

Then, I tried Step 3 to send an Email to my Gmail account, as follows:

 echo "This is the body of the email" | mail -s "Gmail Test"

But, I always obtained the following ERROR message:

▸N 43 Mail Delivery Syst 2019-02-17 12:43   80/3112  Undelivered Mail Returned to Sender                                                                                                                      
[-- Message 43 -- 80 lines, 3112 bytes --]:
From Sun Feb 17 12:43:27 2019
Date: Sun, 17 Feb 2019 12:43:27 +0000 (UTC)
From: (Mail Delivery System)
Subject: Undelivered Mail Returned to Sender
To: doaccount@do-computer
Message-Id: <>

[-- #1.1 23/933 text/plain, 7bit, us-ascii --]
[-- Notification --]

This is the mail system at host

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                   The mail system

<>: host[] said:
    550-5.7.1 This message does not have authentication information or fails to
    pass 550-5.7.1 authentication checks. To best protect our users from spam,
    the 550-5.7.1 message has been blocked. Please visit 550-5.7.1 for more 550
    5.7.1 information. d65si10644912pfc.201 - gsmtp (in reply to end of DATA

[-- #1.2 20/806 message/delivery-status, 7bit, us-ascii --]
[-- Delivery report --]

[-- No MIME handler installed, or not applicable --]

[-- #1.3 15/507 message/rfc822 --]
[-- Undelivered Message --]

Subject: Gmail Test
To: <>
Message-Id: <>
Date: Sun, 17 Feb 2019 12:43:26 +0000 (UTC)
From: XXXXX <doaccount@do-computer>

This is the body of the email

Can anybody please give me a hand…

Cheers Pei

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Hi @jiapei1000 ,

These days there are alot of servers setup as spam mailserver. Because of that, e-mail providers like Outlook, Gmail, etc. do alot of checking before allowing anything to come in. If you like to setup your own mailserverver, you will have to try a bit harder. :)

Some things you will have to take into account:

  1. Your FQDN needs to match your PTR - IP
  2. You will have to setup an SSL certificate (it can be a free let’s encrypt one)
  3. You will have to create DKIM keys, and sign your mail with them + add a DKIM record in your DNS
  4. You will have to create an SPF record in your DNS
  5. You will have to check your IP, most of the time this IP is on a blacklist. This will have to be removed.

So as you can see there are some things you will have to look into. This is however a great opportunity to learn something new! I have setup more than 20+ mailservers and know alot about it, so I do also know that debugging them can be a pain.

If this is not clear enough, please tell me. I could write some tutorial about it if needed.

Hi all

A tutorial (still) would be great :)

I’m having some troubles sending emails. And having lot’s of problem configuring everything to send it

My goal is to send mails to my own gmail accounts, and I’m always gettings the authentication fails answer…


Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel