Use DA Exim + Dovecot setup as SMTP for a website on other server

cdekker

New member
Joined
Mar 7, 2016
Messages
3
I have a DirectAdmin Custombuild 2.0 setup with the following email services:

Latest version of dovecot: 2.2.29.1
Installed version of dovecot: 2.2.29.1

Latest version of dovecot.conf: 0.2
Installed version of dovecot.conf: 0.2

Latest version of Exim: 4.89
Installed version of Exim: 4.89

Latest version of exim.conf: 4.5.4
Installed version of exim.conf: 4.5.4

I have a couple domains with users set up in DA with correctly configured SPF and DKIM and they can send and receive email just fine, including using my mail server as outbound server.

Now I would like to set up my Ruby on Rails web application on a different server to also use this (outbound) SMTP mail server to send transactional email (lost password, complete signup, etc.)

  • It uses a domain that is not used or configured in DirectAdmin
  • Only outgoing mail needs to be setup. Inbound is not relevant in this case
  • Both servers (DA and WebApplication) can only talk to eachother via external IP, although for $$ they can be put on a VLAN
  • Certificates are set up correctly. Connecting over TLS/SSL should be priority.
  • Assume I can setup SPF and DKIM on this other domain manually

How should I set this up on the DirectAdmin side? At one point I need a hostname, port, username and password to connect to. Should I just add the domain of the web application to DirectAdmin just to set up an email account to send with?

Do I need to whitelist the (external) IP of the web application server in Exim so it is allowed to use it as a relay? Currently I have the following in my /etc/exim.variables.conf
hostlist relay_hosts=127.0.0.1 : 111.111.111.111 : 222.222.222.222
(where 111 is my DirectAdmin Exim server and 222 is my web application server)

About this whitelisting of relays, how come I need to do this, while all my (DA) users can use my mail server from anywhere in the world? What is the difference in how they connect?
 
Hello,

The simplest would be to add a desired domain into Directadmin and disable "Local Mail Server" for the domain (https://help.directadmin.com/item.php?id=8)

Create email account with a desired name and password.

Configure your application to use SMTP credentials of DA server.

p.s. Update SPF/DKIM per needs.
 
Back
Top