I spent a few days attempting to get this to work. I finally got it successfully working today. I am posting this to help anyone else struggling to get exim4 working with an external email server (ISP) for sending email and forwarding local mail sent to root to an external Internet email address. I followed these documented steps to no avail: https://www.debian.org/releases/stable/ ... 04.en.html. You may all be experts at setting this up, but I am now posting this to help someone out there get this working quickly.
Here is how I got it working under the latest available Debian release as of this post:
1)2)3)For the configuration, your entries are important to get this working. This is what I entered using Zoho as an external SMTP mail server. Replace your SMTP external Internet mail server as needed:
4) Please select the mail server configuration type that best meets your needs: Mail sent by smarthost; received via SMTP or fetchmail (choose second option)
5) The 'mail name' is the domain name used to 'qualify' mail addresses without a domain name:6) Please enter a semicolon-separated list of IP addresses. The Exim SMTP listener daemon will listen to all IP addresses listed here:7) Please enter a semicolon-separated list of recipient domains for which this machine should consider itself the final destination:
<enter your appropriate local host domain name; the default option is most likely appropriate for you; change it as required>
8) Please enter a semicolon-separated list of IP address ranges for which this system unconditionally relay mail, functioning as a smarthost:
<I left this blank; enter what is appropriate for you>
9) Please enter the IP address or the host name of a mail server that this system should use as an outgoing smarthost:Zoho is my Internet mail server. This SMTP host and port works for Zoho Mail. Please enter what is appropriate for you. Note that two colons are required for the port.
10) The headers of outgoing mail can be rewritten to make it appear to have been generated on a different system. Hide local mail name in outgoing mail?11) Visible domain name for local users:
<enter your email address domain name that is appropriate for you; your external SMTP server must support this domain name; enter the domain name portion of your external email address>
12) Keep number of DNS-queries minimal?
<I entered No, but enter what applies to you>
13) Delivery method for local mail:
<I entered Maildir format in home directory, but enter what applies to you>
14) Split confirguration into small files?
<I entered No; enter Yes if you wish>
Configuration is complete.
While still accessing root, create a .forward file under /root/.forward:
Make sure this .forward file contains your valid Internet email address.
Additionally, edit your /etc/email-addresses file for all local users you wish to have local mail forwarded to your Internet address. In my case, I am the sole user of this server, so all local mail gets forwarded to my single Internet email address:Also, edit your /etc/aliases file to add your Internet email address to root and your appropriate local users:
Next, enter:Finally, restart exmin4:After doing all of the above, all mail sent to root gets forwarded to my Internet email address successfully.
Here is how I got it working under the latest available Debian release as of this post:
1)
Code:
su -
Code:
apt install exim4 mutt
Code:
dpkg-reconfigure exim4-config
4) Please select the mail server configuration type that best meets your needs: Mail sent by smarthost; received via SMTP or fetchmail (choose second option)
5) The 'mail name' is the domain name used to 'qualify' mail addresses without a domain name:
Code:
localhost
Code:
127.0.0.1
<enter your appropriate local host domain name; the default option is most likely appropriate for you; change it as required>
8) Please enter a semicolon-separated list of IP address ranges for which this system unconditionally relay mail, functioning as a smarthost:
<I left this blank; enter what is appropriate for you>
9) Please enter the IP address or the host name of a mail server that this system should use as an outgoing smarthost:
Code:
smtp.zoho.com::587
10) The headers of outgoing mail can be rewritten to make it appear to have been generated on a different system. Hide local mail name in outgoing mail?
Code:
<Yes>
<enter your email address domain name that is appropriate for you; your external SMTP server must support this domain name; enter the domain name portion of your external email address>
12) Keep number of DNS-queries minimal?
<I entered No, but enter what applies to you>
13) Delivery method for local mail:
<I entered Maildir format in home directory, but enter what applies to you>
14) Split confirguration into small files?
<I entered No; enter Yes if you wish>
Configuration is complete.
While still accessing root, create a .forward file under /root/.forward:
Code:
email@example.com
Additionally, edit your /etc/email-addresses file for all local users you wish to have local mail forwarded to your Internet address. In my case, I am the sole user of this server, so all local mail gets forwarded to my single Internet email address:
Code:
# This is /etc/email-addresses. It is part of the exim package## This file contains email addresses to use for outgoing mail. Any local# part not in here will be qualified by the system domain as normal.## It should contain lines of the form:#root: email@example.comuser: email@example.com
Code:
mailer-daemon: postmasterpostmaster: rootnobody: roothostmaster: rootusenet: rootnews: rootwebmaster: rootwww: rootftp: rootabuse: rootnoc: rootsecurity: rootroot: email@example.com
Code:
newaliases
Code:
systemctl restart exim.service
Statistics: Posted by Dryst — 2024-11-27 13:38 — Replies 0 — Views 8