I'd like my cronjobs to be able to send mail from my home computer. My servers configure exim4 like this:
dc_eximconfig_configtype='internet'
dc_other_hostnames=''
dc_local_interfaces='127.0.0.1'
dc_readhost=''
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost=''
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname=''
dc_mailname_in_oh='true'
dc_localdelivery='maildir_home'
However, at home, my ISP blocks mail sent directly via a firewall. I have a password proteced ssl smtp server that I could route the mail through, but I have been unsuccessful in figuring out how to configure exim4 to make this work. I'm hoping somebody can give me a configuration example where I can plug in the host name, user name, password, and "use ssl" to get it to send mail through a single smtp server.
I finally found a detailed set of instructions by Tony Scelfo that actually work. It appears that you have to use transport layer security (TLS) on port 587. I have not gotten SSL SMTP to work.
First run
sudo dpkg-reconfigure exim4-config
and use these config options:Then run
sudo vi /etc/exim4/passwd.client
and add the following lines for your mail host, and any aliases it has (found throughnslookup
). Substitute <email address> and <password> with the account you want to route mail through):Once you edit the
passwd.client
file, runsudo update-exim4.conf
which will integrate your changes into your Exim4 config.Run
sudo /etc/init.d/exim4 restart
and make sure that the service stops and starts properly. If the service is unable to restart, something probably went wrong when you edited thepasswd.client
file.If Exim4 restarted, go ahead and run
sudo tail -f /var/log/exim4/mainlog
to watch the mail logs. In a different window, send an email from your system and make sure that you see a record go by withR=smarthost T=remote_smtp_smarthost H=gmail-smtp-msa.l.google.com ... X=TLS-1.0:RSA_ARCFOUR_MD5:16
in it. TheX=TLS
means that the mail is being sent with transport layer security which is what you want.If your ISP requires authentication, you should set dc_smarthost to the mail server hostname and port combination your ISP uses, and dc_eximconfig_configtype to "smarthost" like so:
Then, you can add your credentials to
/etc/exim4/passwd.client
like so:Then, any mail sent via your exim4 server will be routed through this mail host.
This works very well for me. My ISP uses port 25 and
dc_smarthost='myisp.mail.server:25'
after changing this files and issue commands:update-exim4.conf
/etc/init.d/exim4 restart
After I made a test to send an email through exim4 classic sample like:
And these flow ok to inbox of
my-user
inmy-domain-url
.The server-name in
/etc/exim4/passwd.client
have to be the canonical name after the name-resolutionexample for:
it is the value
sfwdallmx.t-online.de
from :The file
passwd.client
looks like: