12

I am new to setting up a mail server, and everywhere I look I get either outdated or really complex instructions on setting up a mail server.

Is there any simple methods on installing an IMAP mail server?

  • There is mypostfixadmin. So long that you lock it down, it's pretty nice and fancy to have. – earthmeLon Sep 21 '14 at 21:58
22

You can use Dovecot for mail server

  1. Install the packages

    sudo apt-get install dovecot-imapd dovecot-pop3d

  2. Configure the protocol you need to be used by appending the protocol in the file /etc/dovecot/dovecot.conf:

    protocols = pop3 pop3s imap imaps

  3. Choose the mailbox you would like to use. Dovecot supports maildir and mbox formats. Edit the file /etc/dovecot/dovecot.conf and change the line

    mail_location = maildir:~/Maildir # (for maildir)

    or

    mail_location = mbox:~/mail:INBOX=/var/spool/mail/%u # (for mbox)

  4. Restart the service

    sudo /etc/init.d/dovecot restart

  5. Use telnet to check that dovecot is working properly.

    telnet localhost imap

That's it.

PS. Also make sure your firewall is configured properly to accept connections on the appropriate ports.

Source : Official Dovecot Server Documentation

  • 1
    Great answer. However, you might want to enhance this a little by explaining how to tell if one is using mbox or maildir formats, as well as the fact that on Ubuntu 14.04 Server, it uses Upstart for Dovecot now and so you have to do "start/stop/restart/status dovecot" type commands. – Volomike Mar 20 '15 at 17:31
  • 1
    Also, I found that if you get a prompt for SSL, skipping it will cause dovecot not to load. You'll have to do a self-signed SSL on the mail until you can replace with a real cert. Also, dpkg-reconfigure dovecot-imap doesn't work -- you'll have to do apt-get --purge remove dovecot-core dovecot-imapd dovecot-pop3d to remove and start over. – Volomike Mar 20 '15 at 19:57
  • 1
    Current dovecot version uses a /etc/dovecot/conf.d where it stores different configuration files, so protocol selection is made placing files there. Anyway, there's no need to modify anythin, default installation already sets everything right. – jesjimher Aug 4 '17 at 13:02
  • Docs can now be found at help.ubuntu.com/18.04/serverguide/dovecot-server.html, but I don't know if the rest of the answer needs reviewing since 2013... – mwfearnley Dec 24 '19 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.