E-mail server section

From SaruWiki
Revision as of 18:27, 29 October 2008 by Saruman! (talk | contribs) (Page started)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

E-mail server setup

What we want to accomplish here is the setup of a mail server with the following properties:

  • can serve multiple mail domains
  • can relay mail for other domains to other mail servers
  • can have one or more mailboxes per domain
  • users of these mailboxes can be virtual (do not need to have a Linux user account)
  • can have multiple aliases per mailbox
  • can forward mail for certain aliases to multiple mailboxes

For this type of mail server setup, we owe a great thankyou to Christoph Haas

Preparation

We'll assume that the server currently has no mailserver installed, at least no other than the default exim mailserver. Furthermore, the server is already fitted with MySQL, and this database is running without problems.

The hostname of the server must be set correctly, so that hostname -f returns a valid DNS name, like lighthouse.saruman.biz.. It might also be an internal name like lighthouse.saruman.lan. but that will require us to give extra attention to the name under which Postfix will contact its collegues on the Internet. Also, the server can correctly [Networking_section#DNS_resolution_under_Debian | resolve DNS names] like www.debian.org, preferably by running it's own caching DNS server.

The server is kept on the correct date and time using NTP, TCP port 25 is open on the server, the ISP will allow connections from Internet to this port, and if there's a firewall running on this server, then it has port 25 open so as to not block incoming e-mail.

Software installation

As a first step, we use apt or aptitude to make sure that our server is up-to-date. Then we can install the necessary software packages. Under Debian 5.0 "Lenny", the packages are:

  • postfix, the mail server itself
  • postfix-doc, the accompanying documentation
  • postfix-mysql, necessary to have Postfix talk to our MySQL server
  • postfix-tls so we can secure connections to Postfix with the TLS protocol
  • postfix-pcre to be able to parse regular expressions, which which we can combat spam

At the same time we can purge the following packages: