Bjoern Olausson

Linux HowTo

Debian EXIM4 smarthost

These are the steps to get a flawless working SMARTHOST on Debian Lenny 5.04.
All you need to do is to run the exim4-conf and add some lines to /etc/exim4/passwd.client.
You do not even need to touch the template file.

In this setup Exim will deliver mail to the local inbox, if it finds a .forward file in ~ exim will deliver the mail
to the address provided in the .forward file.

 

 

# dpkg-reconfigure exim4-config
mail sent by smarthost; received via SMTP or fetchmail
 
System mail name:
<your FQDN (like in /etc/hosts)>
 
IP-addresses to listen on for incoming SMTP connections:
127.0.0.1
 
Other destinations for which mail is accepted:
<all destinations you want to be delivered localy (<localhost;your FQDN (like in /etc/hosts)>)
This ensures that exim tries to deliver to the users inbox. There you can place a .forward file to redirect the message to a real address.
 
Machines to relay mail for:
<EMPTY>
 
IP address or host name of the outgoing smarthost:
smtp.gmail.com::587
 
Hide local mail name in outgoing mail?
<NO>
 
Keep number of DNS-queries minimal (Dial-on-Demand)?
<NO>
 
Delivery method for local mail:
<mbox format in /var/mail/>
 
Split configuration into small files?
<NO>

 

Add these lines to /etc/exim4/passwd.client:Make it readable for exim4:

1
2
3
gmail-smtp.l.google.com:yourAccountName @ gmail.com:y0uRpaSsw0RD
*.google.com:yourAccountName @ gmail.com:y0uRpaSsw0RD
smtp.gmail.com:yourAccountName @ gmail.com:y0uRpaSsw0RD
# chown root:Debian-exim /etc/exim4/passwd.client

Update the config and restart exim4:
1
2
# update-exim4.conf
# /etc/init.d/exim4 restar

 

Now in /etc/aliases make shure your user is the final recipient of all system mails:

# /etc/aliases
mailer-daemon: postmaster
postmaster: root
nobody: root
hostmaster: root
usenet: root
news: root
webmaster: root
www: root
ftp: root
abuse: root
noc: root
security: root
root: YOUR_LOGIN

For more advanced filter options refer to the exim doc:
http://www.exim.org/exim-html-4.50/doc/html/filter_3.html#SECT3.1
1
2
# Exim filter
deliver YOU @ SOMEPROVIDER.TLD


Note, that GMAIL will store all the send mails. So you should clean it now and then ;)

Thats all. No messing around with the template file.
Parts of the above instructions where taken from:
http://wiki.debian.org/GmailAndExim4

Add comment


Security code
Refresh

www. is deprecated

Play OGG

Qt Ambassador

Latest comments

Gixen