1

Exim is configured on a newly provisioned VM from a public cloud provider with public IPs (scaleway.net)

Purpose:

Be able to send mails from CLI (or scripts) to public destination recipients (gmail,yahoo,...)

Results:

Exim4 log file /var/log/exim4/mainlog shows "Connection timeout" with all tested servers (gmail, free.fr, online.net)

Configuration details:

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.5 LTS
Release:    16.04
Codename:   xenial
  • No firewalls configured on the server and no rules from the cloud provider.
  • The resolved smtp servers IP addresses (from exim log file) are pingable.

Tested with different smtp servers: (gmail, free.fr, online.net)

cat /etc/exim4/update-exim4.conf.conf

# /etc/exim4/update-exim4.conf.conf
#
# Edit this file and /etc/mailname by hand and execute update-exim4.conf
# yourself or use 'dpkg-reconfigure exim4-config'
#
# Please note that this is _not_ a dpkg-conffile and that automatic changes
# to this file might happen. The code handling this will honor your local
# changes, so this is usually fine, but will break local schemes that mess
# around with multiple versions of the file.
#
# update-exim4.conf uses this file to determine variable values to generate
# exim configuration macros for the configuration file.
#
# Most settings found in here do have corresponding questions in the
# Debconf configuration, but not all of them.
#
# This is a Debian specific file

dc_eximconfig_configtype='smarthost'
dc_other_hostnames=''
dc_local_interfaces='127.0.0.1 ; ::1'
dc_readhost=''
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost='smtp.online.net::587'
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname='false'
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool

Accounts and passwords correctly configured for each test with smtp server:

cat /etc/exim4/passwd.client

#gmail-smtp.1.google.com:destination@gmail.com:pass1
#smtp.online.net:destination@online.net:pass2
smtp.free.fr:destination@free.fr:pass2

root@scw-5c50c6:~# tail -f /var/log/exim4/mainlog

root@scw-5c50c6:~# tail -f /var/log/exim4/mainlog
2018-10-27 17:32:47 1gGSDM-0002ib-5Y == destination1@gmail.com R=smarthost T=remote_smtp_smarthost defer (-53): retry time not reached for any host
2018-10-27 17:32:47 1gGSKT-0002sr-C6 == destination1@gmail.com R=smarthost T=remote_smtp_smarthost defer (-53): retry time not reached for any host
2018-10-27 17:32:47 1gGSF6-0002ij-UA == destination1@gmail.com R=smarthost T=remote_smtp_smarthost defer (-53): retry time not reached for any host
2018-10-27 17:32:47 1gGSJs-0002no-EM == destination1@gmail.com R=smarthost T=remote_smtp_smarthost defer (-53): retry time not reached for any host
2018-10-27 17:32:47 1gGSHC-0002is-0H == destination1@gmail.com R=smarthost T=remote_smtp_smarthost defer (-53): retry time not reached for any host
2018-10-27 17:32:47 End queue run: pid=12074
2018-10-27 17:32:53 1gGSQA-00038q-A1 H=smtpauth-dc2.online.net [62.210.16.40] Connection timed out
2018-10-27 17:32:53 1gGSQA-00038q-A1 == destination1@gmail.com R=smarthost T=remote_smtp_smarthost defer (110): Connection timed out

2018-10-27 17:47:12 1gGSg4-00039P-CW <= root@localhost U=root P=local S=369
2018-10-27 17:47:12 1gGSg4-00039P-CW == destination2@yahoo.com R=smarthost T=remote_smtp_smarthost defer (-53): retry time not reached for any host


2018-10-27 18:02:34 1gGSst-0003JZ-5k H=smtp.free.fr [212.27.48.4] Connection timed out
2018-10-27 18:02:34 1gGSst-0003JZ-5k == destination2@yahoo.com R=smarthost T=remote_smtp_smarthost defer (110): Connection timed out
2018-10-27 18:03:09 1gGSvV-0003KT-9k <= root@localhost U=root P=local S=369
2018-10-27 18:03:09 1gGSvV-0003KT-9k == destination2@yahoo.com R=smarthost T=remote_smtp_smarthost defer (-53): retry time not reached for any host

Am I missing something in the configs?

  • 1
    Aside from being able to ping those host addresses, are you able to connect to the SMTP ports on those hosts? You can test this by trying to telnet to those hosts/ports or by using nmap. – Matt Southward Oct 27 '18 at 20:29
5

Scaleway blocks outgoing SMTP by default. You need to unblock it from within your control panel. Access to this option requires a validated account; if you can't enable it, then open a ticket with Scaleway for further instructions.

  • Thanks a lot @michael-hampton, indeed, I looked over the security policy. I marked the question as solved, because now at least, it can talk to SMTP server, even though whatever the smtp I use (google or other), the logs show "authentication required" ==============> 2018-10-29 13:53:21 1gH7yr-0001yj-PS ** destination@yahoo.com R=smarthost T=remote_smtp_smarthost H=smtpauth-dc2.online.net [62.210.16.40] X=TLS1.2:RSA_AES_128_CBC_SHA1:128 CV=yes DN="CN=*.online.net": SMTP error from remote mail server after RCPT TO:<destination@yahoo.com>: 550 authentication required – AJN Oct 29 '18 at 13:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.