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 :

  1. Edit /etc/exim4/update-exim4.conf.conf : gedit /etc/exim4/update-exim4.conf.conf
  2. Add the following line at the end of it : dc_localdelivery=maildir_home
  3. Shutdown Exim4 : pkill exim4
  4. Reconfigure Exim4 : dpkg-reconfigure exim4-config
    (Follow the guide below if you’re confused what to answer on the questions)
  5. 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)

  1. aptitude install exim4 exim4-config dovecot-pop3d
  2. When configuring Exim4, follow these steps :
  3. Split configuration into small files? NO
  4. General type of mail configuration: (there are 6 choices) : mail sent by smarthost; received via SMTP or fetchmail
  5. System mail name: Whatever, mine is “office
  6. IP-addresses to listen on for incoming SMTP connections: Leave this blank
  7. Other destinations for which mail is accepted: I entered office again here
  8. Machines to relay mail for: Enter your LAN network, mine is 192.168.10.0/24
  9. Machine handling outgoing mail for this host (smarthost): smtp.gmail.com, or whatever works for you
  10. Hide local mail name in outgoing mail? YES
  11. Visible domain name for local users: Set to your company’s internet domain name, example : ToughNut.com
  12. 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
  13. Once everything done, Exim4 and Dovecot will be running. But there’s still one thing left to configure - the smarthost
  14. 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

  15. 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.

8 Responses to “Mailserver on Ubuntu 6 (Dapper Drake)

  • 1
    Amal
    September 15th, 2006 03:10

    Previously, I always set up my own SMTP in a part of fetchmail-mutt-procmail “guardian club”. Ubuntu changed my habbit: it comes without mail server in default and provide my system with a desktop-based choice. I “comply” this situation by not-installing SMTP server and let my Evolution connect directly to my organisation’s mail server.

    Yeah, it is evolution of my style… :)

  • 2
    harry
    September 15th, 2006 03:41

    Welcome to Ubuntu Pak :) btw; on 19 Sep we’ll be in a meeting with Canonical, in our attempt to propose for the Ubuntuk Indonesia Local Community team. Would you like to join in ? If you can make it, it’ll be in #ubuntu-meeting @ irc.freenode.net
    .
    Enjoy Ubuntu :)

  • 3
    Plastic Girl
    March 17th, 2008 00:00

    Thanks for the advice, I;d been struggling with Exim4

  • 4
    sufehmi
    March 18th, 2008 02:31

    You’re most welcome, Plastic Girl.

  • 5
    HP IBM Server
    May 28th, 2008 14:43

    Wondering if we can use anything instead of Exim4..Thanks

  • 6
    oyun indir
    June 14th, 2008 16:34

    Wondering if we can use anything instead of Exim4..Thanks

  • 7
    sufehmi
    June 15th, 2008 23:52

    You could, but I haven’t tried it, so you’re on your own.

  • 8
    AlexM
    August 13th, 2008 08:54

    I found your site on technorati and read a few of your other posts. Keep up the good work. I just added your RSS feed to my Google News Reader. Looking forward to reading more from you down the road!

Leave a Reply

Subscribe without commenting