[SOLVED] Help on setting up PMG with DirectAdmin

netbela

Member
Jan 18, 2023
7
1
8
EDIT: While typing this, I figured it must be something DirectAdmin related, and figured out it was the firewall on the DA side.

Hi Guys,

I've been trying to setup PMG as the relay for my DirectAdmin servers and am hitting some strange issues where e-mails are not relayed properly and Exim on DirectAdmin fails with a 'connection refused' when trying to relay e-mails.

Setup as a smarthost in DirectAdmin using this: https://docs.directadmin.com/other-hosting-services/exim/smarthost.html and also using port 26.
Code:
[root@web01 etc]# cat /etc/exim.routers.pre.conf
smart_route_forward:
    driver = manualroute
    domains = ! +local_domains
    ignore_target_hosts = 127.0.0.0/8
    condition = ${if !eq{$original_domain}{$domain}}
    condition = ${if !eq{$original_domain}{}}
    condition = "${perl{check_limits}}"
    transport = remote_smtp_forward_transport
    route_list = * mx.mydom.com::26
    no_more

smart_route:
    driver = manualroute
    domains = ! +local_domains
    ignore_target_hosts = 127.0.0.0/8
    condition = "${perl{check_limits}}"
    transport = remote_smtp
    route_list = * mx.mydom.com::26
    no_more

I've added my /24 and /48 networks as Trusted Network in 'Mail Proxy --> Networks'.
Additionaly i've added these in 'Mail Proxy --> Whitelist --> IP Network'.

2025-07-07 17:11:32 cwd=/usr/local/directadmin 3 args: /usr/sbin/exim -M 1uYnID-0000000219v-3kSj
2025-07-07 17:11:34 1uYnID-0000000219v-3kSj H=mx.mydom.com [2a11:xxxx:xxxx:x::4] Connection refused
2025-07-07 17:11:35 1uYnID-0000000219v-3kSj H=mx.mydom.com [193.xx.xx.84] Connection refused

I can telnet on both port 25 and 26 from my directadmin server to the PMG, so that seems to be working.

The only issue I keep seeing on the DirectAdmin mail log side is:
Code:
2025-07-07 17:20:40 Received from testuser@mydom-test.online H=(da-01.mydom.com) [::1] P=esmtpa A=login:testuser@mydom-test.online S=585 id=4bb5f7966e66f7b3de55c34c2f756c52@mydom-test.online T="ewatewt"
2025-07-07 17:20:40 ping@tools.mxtoolbox.com R=smart_route T=remote_smtp defer (-54): retry time not reached for any host for 'tools.mxtoolbox.com'
2025-07-07 17:22:15 H=mx.mydom.com [2a11:xxxx:xxxx:x::4] Connection refused
2025-07-07 17:22:16 H=mx.mydom.com [193.xx.xx.84] Connection refused
2025-07-07 17:22:16 ping@tools.mxtoolbox.com R=smart_route T=remote_smtp defer (111): Connection refused

I was hoping if anyone has any clue for me where to look at?
 
Last edited: