0

On an Ubuntu 16.04 VPS, hosted by GoDaddy, I want to be able to send email using my domain name.

I created a mail user noreply@webtest.domain.com through Vestacp, installed Roundcube and checked that I could receive emails from one of my personal addresses (tried with gmail and hotmail).

However when I want to reply, exim4 fails to send, and gives me a "No route to host" error.

# cat /var/log/exim4/mainlog
exim 4.86_2 daemon started: pid=2310, -q30m, listening for SMTP on port 25 (IPv4) port 587 (IPv4) port 2525 (IPv4) and for SMTPS on port 465 (IPv4)
Start queue run: pid=2311
1iDCy2-00021u-SM H=gmail-smtp-in.l.google.com [172.217.197.27] No route to host
1iDD5o-0000bk-Gt <= noreply@webtest.domain.com U=admin P=local S=795 id=337cb2f63221d64985700e25c2074569@webtest.domain.com
1iDCy2-00021u-SM H=alt1.gmail-smtp-in.l.google.com [64.233.186.27] No route to host
1iDCy2-00021u-SM H=alt2.gmail-smtp-in.l.google.com [74.125.193.27] No route to host
[...]
1iDCy2-00021u-SM == recipient@gmail.com R=dnslookup T=remote_smtp defer (110): Connection timed out
1iDCzB-0002B3-PK ** root@webtest.domain.com: Unrouteable address
1iDCzB-0002B3-PK Frozen (delivery error message)
1iDD8s-0000gq-H3 <= <> R=1iDD8s-0000go-GN U=Debian-exim P=local S=1211

I tried to run tracepath to one of those ip, and I could see that by default it was taking the GoDaddy inner network's interface, and not the one with the Internet IP:

# tracepath 172.217.218.27
 1?: [LOCALHOST]                                         pmtu 1500
 1:  10.217.15.252                                         0.262ms
[...]
 8:  ash-b1-link.telia.net                                54.953ms asymm 12
 9:  no reply
10:  no reply

I therefore tried to add the interface directive in /etc/exim4/conf.d/transport/30_exim4-config_remote_smtp, and rebooted the VPS.

remote_smtp:
  debug_print = "T: remote_smtp for $local_part@$domain"
  driver = smtp
  interface = 148.72.xx.xx

But I am still getting the same error. I have no idea where to look now.

Angry Cub
  • 101
  • 3

2 Answers2

0

The issue wasn't where I was expecting it to be, it was "simply" the provider GoDaddy requiring me to use their relay server. I understood that by testing the port 25 with $ telnet portquiz.net 25, and to my great surprise, even-though there wasn't any connection on it, or firewall blocking it, it couldn't connect.

The fix:

This will make your mails go through GoDaddy's mail servers, but it's the simplest solution afaik. I edited the config template file /etc/exim4/exim4.conf.template, and updated the following section to have this:

######################################################################
#                      ROUTERS CONFIGURATION                         #
#               Specifies how addresses are handled                  #
######################################################################
begin routers

smarthost:
  driver = manualroute
  transport = remote_smtp
  route_list = !+local_domains dedrelay.secureserver.net

Then I ran # dpkg-reconfigure exim4-config again (I am not sure if the configuration I entered then is the only one that works, but it works for me):

- Internet site;
- System mail name: xxx.secureserver.net (find yours in GoDaddy's My Hosting > Server > YourVPS > Settings tab > Hostname)
- 127.0.0.1 ; ::1
- mydomain.com
- Domain to relay: empty
- Machines to relay: empty
- DNS dial on demand: no
- mbox
- Split config: no

And of course, as you probably have seen it a thousand times on the internet, you can test the configuration with:

echo "hello" | mail -s "Title" recipient@mail.com

However, it may take about 5min for the email to be delivered. A faster way to know if the email is properly being processed is to check if the "SMTP relays" counter is being incremented, in your server's dashboard, on GoDaddy's website.

Angry Cub
  • 101
  • 3
-1

On GoDaddy, cPanel VPS GEN4 CentOS 7 i solve like this:

enter image description here

smart_route:
driver = manualroute
domains = ! +local_domains
ignore_target_hosts = 127.0.0.0/8
transport = remote_smtp
route_list = * godaddy-server-relay.com::25
no_more
Uwe Keim
  • 2,370
  • 4
  • 29
  • 46
Max
  • 99
  • 2