Mailserver on Ubuntu 6 (Dapper Drake)
Should be pretty easy huh ? Well, not really… there’s one glitch with Exim4 — by default, it delivers email to “mail_spool”, as can be seen from the /var/log/exim4/mainlog here :
=> wanto <wanto@kantor> F=<harry @kantor> P=<harry @kantor> R=local_user T=mail_spool
Incoming email ended up never arrived in my users Maildir.
The solution :
- Edit /etc/exim4/update-exim4.conf.conf : gedit /etc/exim4/update-exim4.conf.conf
- Add the following line at the end of it : dc_localdelivery=maildir_home
- Shutdown Exim4 : pkill exim4
- Reconfigure Exim4 : dpkg-reconfigure exim4-config
(Follow the guide below if you’re confused what to answer on the questions) - That’s it ! Now incoming email will be delivered to your users’ Maildir
I’ve setup this particular server so users can send and fetch email locally.
Email for external destination (Internet) will be relayed through a smarthost. This makes sending huge email very speedy. So they can return to their work quickly and happy (leaving this server working hard trying to send their multi-megabyte emails through a tiny internet pipe *grin* )
With help from Dovecot, they can also send email to each other by [my_name]@office email addresses. This saves me from the headache of setting up a file server AND controlling the access rights.
To set it up this way, follow these steps :
(disclaimer: this is from on top of my head, so please CMIIW)
aptitude install exim4 exim4-config dovecot-pop3d- When configuring Exim4, follow these steps :
- Split configuration into small files? NO
- General type of mail configuration: (there are 6 choices) : mail sent by smarthost; received via SMTP or fetchmail
- System mail name: Whatever, mine is “office“
- IP-addresses to listen on for incoming SMTP connections: Leave this blank
- Other destinations for which mail is accepted: I entered office again here
- Machines to relay mail for: Enter your LAN network, mine is 192.168.10.0/24
- Machine handling outgoing mail for this host (smarthost): smtp.gmail.com, or whatever works for you
- Hide local mail name in outgoing mail? YES
- Visible domain name for local users: Set to your company’s internet domain name, example : ToughNut.com
- Keep number of DNS-queries minimal (Dial-on-Demand)? Up to you really, I chose NO because my company got a fixed (always-on) internet access
- Once everything done, Exim4 and Dovecot will be running. But there’s still one thing left to configure - the smarthost
- Setup the Smarthost (relay for external/internet email) :
# gedit /etc/exim4/passwd.client
# Then put something like this : smtp.gmail.com:my-email@gmail.com:mypassword - Restart exim4 :
pkill exim4
invoke-rc.d exim4 start
Done ! Now your mailserver is functioning.
On your users’ computer, set up as follows :
- SMTP server : office
- POP3 server : office
- POP3 username : Their username in that server
- POP3 username : Their password in that server
Enjoy.
