Difference between revisions of "Configure mail server"

From Organic Design wiki
(DoveCot: POP & IMAP)
(domain setup)
Line 44: Line 44:
  
 
It is possible to use both POP3 and IMAP together for the same account because both are simply different protocols for accessing the same mail. There's probably no useful purpose to do that, but if you do then make sure the client settings for the POP setup is configured to leave the messages on the server, otherwise after they're removed they will no longer exist in the IMAP folder structures either.
 
It is possible to use both POP3 and IMAP together for the same account because both are simply different protocols for accessing the same mail. There's probably no useful purpose to do that, but if you do then make sure the client settings for the POP setup is configured to leave the messages on the server, otherwise after they're removed they will no longer exist in the IMAP folder structures either.
 +
 +
== Domain setup ==
 +
Our non .co.nz domains are handled through [http://www.namecheap.com NameCheap], so I'll cover the setup for them, but it should be easy to adjust to any name hosting service. In the ''all host records'' page for your domain, go to ''mail settings'' at the bottom, and set it to "User Simplified" then click ''save changes''.
 +
 +
Now scroll to the bottom of the page again and fill in the "User Simplified" form, set ''HOST NAME'' to "mail" (this setting seems to be superfluous), fill in the ''MAILSERVER IP'' and set the ''MX PREF'' to 1, then click ''save changes''.
  
 
== See also ==
 
== See also ==
 
*[http://wiki.dovecot.org/MailServerOverview Mail Server Overview] ''- in DoveCot manual''
 
*[http://wiki.dovecot.org/MailServerOverview Mail Server Overview] ''- in DoveCot manual''

Revision as of 10:54, 15 August 2008

Procedure.svg Configure mail server
Organic Design procedure

Exim

Exim4 is the default mail transfer and delivery agent for Debian, but it's only the light version which is insufficient for running a mail server, so the organicdesign-server package includes the exim4-daemon-heavy package which will replace the light version. Exim is designed to move messages from one e-mail server to another and to deliver messages to local users mailboxes. It has nothing to do with POP3 or IMAP as those are protocols relating to the retrieval of the mail by a user and their mail client software. The default Exim configuration allows the server to send mail, but if you plan on running an IMAP or POP3 server on your server, then other configuration.

First, run through the standard Exim4 configuration script, say "yes" to splitting the configuration files, set general mail configuration to "internet". For all the rest, just keep any non-self-explanatory settings as default.

dpkg-reconfigure exim4-config

Next Exim must be told to use the maildir method of local delivery so that it matches our POP3/IMAP settings. Edit the /etc/exim4/update-exim4.conf.conf and append the following line:

dc_localdelivery='maildir_home'

Restart the mail server:

/etc/init.d/exim4 restart

DoveCot

The organicdesign-server package installs DoveCot, an IMAP and POP3 server. DoveCot responds to mail client requests by retrieving the mails from file and returning them to the client. It does not deal with the receiving the mails or storing them to disk.

We go with a configuration which is as close to default as possible and gives us both POP3 and IMAP services which both work with either TLS or SSL but not plain text. The users are by default the native linux users and passwords on the system. The minimal configuration necessary is a couple of edits to /etc/dovecot/dovecot.conf.

First, specify which protocols to use (you may like to only allow imaps and pop3s for extra security).

protocols = imap pop3 imaps pop3s

Next, add a section defining the ports for each protocol as follows (you may like to change to non-standard ports for extra security):

protocol imap {
   listen = *:143
   ssl_listen = *:993
}
protocol pop3 {
   listen = *:110
   ssl_listen = *:995
}

Client setup

Any standard mail client such as Thinderbird or Outlook should connect with no trouble, but our procedure doesn't yet include a the generation of a valid SSL certificate, so you'll get a warning initially which you can specify to be ignored for subsequent connections.

It is possible to use both POP3 and IMAP together for the same account because both are simply different protocols for accessing the same mail. There's probably no useful purpose to do that, but if you do then make sure the client settings for the POP setup is configured to leave the messages on the server, otherwise after they're removed they will no longer exist in the IMAP folder structures either.

Domain setup

Our non .co.nz domains are handled through NameCheap, so I'll cover the setup for them, but it should be easy to adjust to any name hosting service. In the all host records page for your domain, go to mail settings at the bottom, and set it to "User Simplified" then click save changes.

Now scroll to the bottom of the page again and fill in the "User Simplified" form, set HOST NAME to "mail" (this setting seems to be superfluous), fill in the MAILSERVER IP and set the MX PREF to 1, then click save changes.

See also