My development server rosinante runs in the diapup IP range of the German Telekom. Therefore it is very likly that she can’t send out emails because these IPs are blacklisted.
My solution is to use the ISP’s SMTP-Server as a smarthost for my development root-server rosinante.
My exim4 package was previously installed with apt-get install exim4.
1. First of all I had to make sure that exim can contact the the smarthost with AUTH PLAIN / AUTH LOGIN because my ISP SMTP Server will not support a secured connection.
I made the following changes to: /etc/exim4/exim4.conf.template
# Because AUTH PLAIN sends the password in clear, per default we only allow it
# over encrypted connections. If you want to change this disable the existing
# “client send” entry and enable the one below without the “if !eq{$tls_cipher}{}”
# by removing the hash-mark (#) at the beginning of the line.
plain:
driver = plaintext
public_name = PLAIN
## LS changes on 16.12.2004 – allow Plain AUTH without SSL
## client_send = “${if !eq{$tls_cipher}{}{\
## ^${extract{1}{::}\
## {${lookup{$host}lsearch*{CONFDIR/passwd.client}{$value}fail}}}\
## ^${extract{2}{::}\
## {${lookup{$host}lsearch*{CONFDIR/passwd.client}{$value}fail}}}\
## }fail}”
## replaced with the follwing line:
client_send = “^${extract{1}{::}{${lookup{$host}lsearch*{CONFDIR/passwd.client}
{$value}fail}}}^${extract{2}{::}{${lookup{$host}lsearch*{CONFDIR/passwd.client}{$value}fail}}}”
# Because AUTH LOGIN sends the password in clear, per default we only allow it
# over encrypted connections. If you want to change this disable the existing
# “client send” entry and enable the one below without the “if !eq{$tls_cipher}{}”
# by removing the hash-mark (#) at the beginning of the line.
login:
driver = plaintext
public_name = LOGIN
## LS changes on 16.12.2004 allow Plain LOGIN without SSL:
## client_send = “${if !eq{$tls_cipher}{}{}fail}\
## : ${extract{1}{::}\
## {${lookup{$host}lsearch*{CONFDIR/passwd.client}{$value}fail}}} \
## : ${extract{2}{::}\
## {${lookup{$host}lsearch*{CONFDIR/passwd.client}{$value}fail}}}”
## replaced by the following line:
client_send = “: ${extract{1}{::}{${lookup{$host}lsearch*{CONFDIR/passwd.client}{$value}fail}}} :
${extract{2}{::}{${lookup{$host}lsearch*{CONFDIR/passwd.client}{$value}fail}}}” ´
2. Now let exim know it’s new role and contact a smarthost for delivery.
Run
dpkg-reconfigure exim4-config
Split config-files = no
type of mail configuration: mail sent by smarthost; received via SMTP or fetchmail
systemmailname: schenk-live.dyndns.org (hostname portions of the adress shown on outgoing emails)
IP-addresses to listen on: (empty) want to listen an all interfaces
Other destinations for which mail is accepted: (empty)
Machone to relay mail for: (empty)
smarthost: smtp.1und1.com (put your ISP SMTP Hostname in here)
Hide local mail name in outgoint: yes
Visible domain name for local users: lars-schenk.de
Keep DNS queries minimal: no
3. Next step is to say exim4 what username and passwort she has to use when talking to the smarthost:
vi /etc/exim4/passwd.client
# Format:
targetmailserver.smarthost:login:password
(to make it clear: in my case the targetmailserver’s name is smtp.1und1.com)
That’s it. To make sure exim4 get’s up the updated configurations you can restart exim4.
Another hint:
In order to allow root to send mail I have added the following in /etc/email-addresses
root: [email protected]
Now I could use this for verbose testing:
mail -v -a “from: [email protected]” -s “This is a test” [email protected]
Further helpful links:
http://scrapped.mine.nu/node/view/15
http://www.aucupor.de/article.php3?id_article=82
Hi Lars,
Thank you for your guide its very good. Your setup of exim is exactly as i require mine, please can you send me further instructions on updating my exim4.conf.template file. I am not sure which parts to update and hash out. Please could you send me your exim4.conf.template file?
Your help is very much appreciated.
Kind Regards
Pete Rodgers