How to set up email to work properly in VestaCP?

February 11, 2015 21.2k views

I have VestaCP installed on Ubuntu 14.04 x64 and have created multiple email adresses in VestaCP. I was trying to use roundcube mail client for the emails, but I face a problem when sending emails out.

Most of the servers would reject the emails and provide different error messages. Following is a mesagge from gmail:

  • SMTP error from remote mail server after end of data: host gmail-smtp-in.l.google.com [173.194.65.27]: 550-5.7.1 [178.62.181.227 12] Our system has detected that this message is 550-5.7.1 likely unsolicited mail. To reduce the amount of spam sent to Gmail, 550-5.7.1 this message has been blocked. Please visit 550-5.7.1 http://support.google.com/mail/bin/answer.py?hl=en&answer=188131 for 550 5.7.1 more information. gp3si2559708wib.60 - gsmtp *

I have not yet sent a single email succesfully, so previous spam is not a problem.

P.S. Receiving emails works as a charm.

9 Answers

To Fix this issue:

  1. Make sure your droplet name matches your server name.
    a. Power Off droplet.
    b. Click on Server Name, change this to aka: server1.yourdomain.com
    c. Go to Networking in Digital Ocean CP. Click on PTR Records.
    d. Add PTR record for aka: server1.yourdomain.com
    e. Power On droplet.

  2. Update Settings in VestCP to match.
    a. In VestaCP, click on Server Tab. (Make sure it has a FQ domain) aka: server1.yourdomain.com
    b. Under DNS, add an A record for that subdomain.

For all the settings and update to take place, it will take a while for other servers on the net to respond. But once this is done, you will be able to send/receive to pretty much any domain.

Your ip may be on a blacklist with the major isps.

I checked the common blacklist and it does show clean. http://whatismyipaddress.com/blacklist-check

One thing I did notice you have no PTR record. You need to rename your droplet so it matches up with you mail settings.

Also make sure you are setting up SPF and DKIM keys this will help mail from being dumped in the spam folders.

If it is indeed a bad ip about the only solution is snapshot the droplet. Then create new droplet from snapshot then kill off the original droplet.

  • Thanks for your response, but I did not understand the the part about having no PTR recored.
    You suggested renaming droplet so it would match with my mail settings.

    Could you please give some more info about it?

  • A PTR record is just a reverse DNS lookup. See http://support.simpledns.com/kb/a45/what-is-reverse-dns-and-do-i-need-it.aspx

    When you created your droplet if you gave it a FQDN DigitalOcean would have setup the record for you. You will see it in DO control panel under DNS.

    If you didn't you will need to rename the droplet to match the server. Like mail.mydomain.com Me personally I don't like to give out what a servers function is so I give them generic names like abc.mydomain.com

    This may not be your problem but I can tell you with my personal mail server it will bounce mail for missing and invalid dns.

Seriously it is the biggest problem with the control panel tried everything and have checked that the server's ip is not blacklisted installed ubuntu without firewall etc. etc. i was however able to send trough gmail smtp from wordpress but the webmail installed together with vestacp was still not working. And i was not able to make it work tried several setups

Same here. The Roundcube just don't send with VestaCP

I configured exim to relay outgoing mails to an external provider (like sendgrid.com -free 10k mails-). I think this is the secure and better solution.
There are lot of threads on how to do this.

We are facing same issue @ocsnetworks

We have followed all the steps 1 & 2 of your email and they are reflected

https://mxtoolbox.com/SuperTool.aspx?action=mx%3aportexcel.com&run=toolpage#

Connecting to 139.59.39.81

220 mail.portexcel.com ESMTP Exim 4.89 Sun, 02 Jul 2017 14:39:52 +0530 [6161 ms]
EHLO PWS3.mxtoolbox.com
250-mail.portexcel.com Hello pws3.mxtoolbox.com [64.20.227.134]
250-SIZE 52428800
250-8BITMIME
250-PIPELINING
250-AUTH PLAIN LOGIN
250-CHUNKING
250-STARTTLS
250 HELP [851 ms]
MAIL FROM:supertool@mxtoolbox.com
250 OK [851 ms]
RCPT TO:test@example.com
550 relay not permitted [1790 ms]

PWS3v2 10770ms

Issue is still there

1) We cannot send email to any domain like google, hotmail, yahoo etc
2) We can receive email perfectly fine

  • After you updated, did you happen to wait a while before testing? I ran the test an it show that everything is configured properly. It may have taken a bit for the other servers to update your PTR record. Let me know if you still have issues. Also in your VestCP you may want to configure faster connect timeout: In VestaCP, Server tab, then find Exim, Configure and find this line: rfc1413querytimeout = 1s ... I have set mine to 1s as it was taking to long for others to knock on the door.

Thanks @ocsnetworks !

Our SMTP port was blocked by DO

They un-blocked it and it is working now

I have update the confg change as per your input

Have a Nice Day!

I Need Help. I Have Disabled My MX Record In CloudFlare. But my Email Verification Process Not Working. When I Register New Username With Email Confirmation Link Not Come My InBox.. my Site

Have another answer? Share your knowledge.