How to configure Exim to relay mail to remote SMTP server on Debian and Ubuntu

I’m required to do some mail relaying on a Debian Linux host which should use a remote mail server to relay its mails.
Until so far I’ve had not much experience with exim as I prefer using qmail, whever a mail server is needed. However since now only a relaying was necessery and exim is the default installed MTA on Debian, I’ve decided to use exim to take care of the SMTP mail relaying.
After a bit of reading it happened configuring exim to relay via remote SMTP server is more than easy!

All I had to do is run the command:

debian-relay:~# dpkg-reconfigure exim4-config

Next in the Ncruses interface to appear:

Debian Exim relay smtp config screenshot

I had to choose the option:

mail sent by smarthost; no local mail

Next a dialog appears asking for:
System mail name:
Therein it’s necessery to type in the hostname of the remote SMTP to be used for mail relay.
Next dialog asks for:
IP-addresses to listen on for incoming SMTP connections:
and I left it with 127.0.0.1 however if exim is supposed to be visible from external network one might decide to put in real IP address there.

Pressing OK leads to the next dialog:
 Other destinations for which mail is accepted: 
I decided to leave this blank as I don’t want to accept mail for any destinations.
Next pane reads:
Visible domain name for local users:
I’ve typed inside my smtp relay server e.g.:
smtp.myrelaymail.com

Further comes:
IP address or host name of the outgoing smarthost:
There once again I typed my mail relay host smtp.relaymail.com

The next config screen is:
Keep number of DNS-queries minimal (Dial-on-Demand)?
On any modern Linux host the default answer of No is fine.
Following prompt asked if I want to:
Split configuration into small files?
I’ve decided not to tamper with it and choosed No
Afterwards mail relaying works like a charm thx God 😉

Share this on:

More helpful Articles

Download PDFDownload PDF

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

4 Responses to “How to configure Exim to relay mail to remote SMTP server on Debian and Ubuntu”

  1. JeffDupp says:
    Firefox 4.0.1 Firefox 4.0.1 Windows 7 Windows 7
    Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1

    I have a computer that I don’t use, and I want to make it into a dedicated server computer for game servers. I want to have It where I can host other people servers on that computer and give them access to their server and files (to change/modify) from their computer.

    View CommentView Comment
  2. hip0 says:
    Firefox 27.0 Firefox 27.0 Windows 7 x64 Edition Windows 7 x64 Edition
    Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0

    In other words this is exim mail forwarding 🙂

    View CommentView Comment
  3. Simon says:
    Google Chrome 39.0.2171.95 Google Chrome 39.0.2171.95 Windows 7 x64 Edition Windows 7 x64 Edition
    Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36

    Although you formally discuss host with various other VPS servers, yours maybe restarted without influencing others.

    View CommentView Comment
  4. Linux "bash: mail: command not found" error fix - Installing mail cli on Fedora, Debian, CentOS, Ubuntu - ☩ Walking in Light with Christ - Faith, Computing, Diary ☩ Walking in Light with Christ – Faith, Computing, Diary says:
    WordPress 4.7.11 WordPress 4.7.11
    The Incutio XML-RPC PHP Library -- WordPress/4.7.11

    […] If you just hired a cheap VPS with some kind of Linux OS installed or just installed a home Linux test system environment inside a Virtual Machine (such as VirtualBox) on your notebook and you want to read system email reports delivered by services (e.g. track possible errors with the OS) or simply test whether Email relaying is configured properly […]

    View CommentView Comment

Leave a Reply

CommentLuv badge