Information about our mail services
As our main mail services, we provide SMTP (via [http://www.exim.org/ Exim]), IMAP (via [http://cyrusimap.org/ Cyrus]), and mailing lists (via [http://www.list.org/ Mailman]).
Notes on Migration to a full Zimbra Solution
We plan to migrate our mail services to the Zimbra groupware of the University, so that we can shut down local mail handling in the near future. As a preliminary step, we have deactivated the local delivery of mails. The Cyrus IMAP server is still running and accessible via the deprecated SquirrelMail Webfrontend if the the local mailboxes require inspection:
Accessiblity of the SMTP port
Due to the HIZ firewalling rules, port 25 (SMTP) is not accesible from outside the university network. Knowing this, our mail server is configured to accept all mails on port 25 without authentication. [TODO: why is this necessary?].
But if port 25 is blocked, how are emails from the outside getting to the mail server? The MX record for the ps.uni-saarland.de domain looks like this:
ps.uni-saarland.de. 86341 IN MX 10 mail.ps.uni-saarland.de. ps.uni-saarland.de. 86341 IN MX 20 mail.cs.uni-saarland.de. ps.uni-saarland.de. 86341 IN MX 30 mail.uni-saarland.de.
So whenever an external mail server tries to send a mail to a ps.uni-saarland.de domain, it first tries mail.ps.uni-saarland.de. It will then fail due to the firewalling rule. It then tries the next best mail server, namely mail.cs.uni-saarland.de. This server is reachable, so it takes the mail. When this server wants to relay this email to us, it looks up the MX record again [TODO: maybe it "knows" our server is responsible for handling our mail without asking the DNS, but I doubt it]. As an university server, it can access port 25 of our server, so it succesfully delivers the mail.
The Mail Transfer Agent (Exim)
Best Practices when Administrating the Mail Server
It is of paramount importance not to lose any email! Email has a responsibility principle built in, i.e. if and only if you accept the email you are responsible for it. The first step thus always should be to shut down exim. After editing the configuration, run the update-exim4.conf command to rebuild the configuration file. Now, try testing the service without starting the server, if possible. It is useful to do a sendmail -bt <mailaddress> (address testing mode) first to check whether forwards etc. work correctly. Now it's time to start exim again. Send an email to your fellow administrator (or yourself) to check that email actually works. Also observe if you get the usual emails (logcheck, update reports etc.). It has already happened that only local mail worked or vice versa.
Configuration Details
Our local Exim installation takes care of routing of mail for two domains: ps.uni-saarland.de (the default mail domain) and mozart-oz.org. Mail for any other domain is sent to our smarthost, mail.cs.uni-saarland.de. To change this general behaviour, call dpkg-reconfigure on the exim4-config package.
Exim comes with an extensive suite of documentation that should answer most of your questions concerning its configuration. In our location installation, Exim's configuration file is generated from a set of smaller files (below /etc/exim4/conf.d/) by the help of the update-exim4.conf command. (Note that Exim reloads its configuration every time its action is required; therefore, there is no need to restart the daemon after re-building the configuration.)
Here is a list of files added to conf.d for our local mail setup:
main/05_exim4-config_pslab This file contains some basic settings specific to our Lab setup, as well as some useful macros.
main/05_pslab_mailman This file contains the mailman data exim needs + useful macros
rewrite/40_pslab_namespaces Rewrites mozart-name@... to name@mozart-oz.org
transport/30_exim4-config_cyrus This file provides the default method of local mail delivery for our configuration: Instead of dropping mail to the user's spool mailbox, it is sent to a Unix
socket connected to the IMAP server, which then drops it into the recipient user's mailbox. To change this behaviour, open /etc/exim4/update-exim4.conf.conf (sic!), change the line that starts with dc_localdelivery to use one of the other mechanisms in /etc/exim4/conf./transport, and run update-exim4.conf to update the configuration.
transport/30_pslab_mailman responsible for relaying mailing list mail to mailman
router/325_exim4-config_ldap_redirect This file defines a router that queries the LDAP server for an entry whose mail attributes match the address that is routed. If such an entry is found, the router
will extract its uid (user ID) attribute, and continue routing with the address uid@ps.uni-saarland.de. This allows us to manage our routing using LDAP: Each user entry should contain all mail addresses under which the respective user wants to be reached---both his or her primary mail address (mail attribute), and any alias addresses (using gosaMailAlternateAddress). Mail to any of these addresses is routed to the local mail folder (specified using the user's UID).
router/110_julius This file seems to have something to do with julius mail routing(obviously) but I don't know what. Since we don't really use julius any more this should not really matter
router/199_pslab_hack This file reroutes @ps.uni-saarland.de and @mail.ps.uni-saarland.de mails to @ps.uni-saarland.de
router/404_pslab_mozart_lists This file is responsible for mozart-list aliases(defined in LDAP)
router/405_pslab_mailman Essentially the same, but for non-mozart lists
IMAP Server (Cyrus)
Accounts and authentication
In case you wonder how cyrus gets to know about new users: cyrus accounts are managed through GOsa; cyrus authentication happens through the saslauthd daemon, which uses PAM passwords. These are the relevant settings in /etc/imapd.conf:
# Force PLAIN/LOGIN authentication only # (you need to uncomment this if you are not using an auxprop-based SASL # mechanism. saslauthd users, that means you!). And pay attention to # sasl_minimum_layer and allowapop below, too. sasl_mech_list: PLAIN # The mechanism(s) used by the server to verify plaintext passwords. Possible # values are "saslauthd", "auxprop", "pwcheck" and "alwaystrue". They # are tried in order, you can specify more than one, separated by spaces. # # Do note that, since sasl will be run as user cyrus, you may have a lot of # trouble to set this up right. sasl_pwcheck_method: saslauthd
SSL Encryption
As referenced in /etc/imapd.conf the keypair is expected in the following places:
tls_cert_file: /etc/ssl/certs/mail.ps.uni-saarland.de.crt [..] tls_key_file: /etc/ssl/private/mail.ps.uni-saarland.de.key
To keep track of the keys there's a CA in /root/ca where you can follow the following step to make a new (self-signed) Certificate
/usr/lib/ssl/misc/CA.pl -newreq
- . to create a new Certification Request. Use the following Values:
- Country Name (2 letter code): DE
- State or Province Name (full name): Saarland
- Locality Name (eg, city): Saarbrucken
- Organization Name (eg, company): Saarland University
- Organizational Unit Name (eg, section): Programming Systems Lab
- Common Name (eg, YOUR name): mail.ps.uni-saarland.de
Email Address: kuhlmann@ps.uni-saarland.de
- . to create a new Certification Request. Use the following Values:
/usr/lib/ssl/misc/CA.pl -sign
. To sign this request. If it fails with the error message 'TXT_DB error number 2' the you need to revoke the old key first, by finding out it's index (see demoCA/index.txt) and calling openssl ca -revoke demoCA/newcerts/??.pem to actually revoke it.
- {{{openssl rsa -in newkey.pem -out newcert.key
openssl x509 -in newcert.pem -out newcert.crt}}}
- .to create private keys and certificates in the representation the mail server needs them
- {{{cp newcert.crt /etc/ssl/certs/mail.ps.uni-saarland.de.crt
cp newcert.key /etc/ssl/private/mail.ps.uni-saarland.de.key}}}
- .To copy them to their appropriate location.
Mailing List (mailman)
Administration tools
The administration of the mailing lists (list exist mailing lists, change the mailing lists' administrators password, remove/add mailing lists is done via the tool located in /usr/lib/mailman/bin. They are named in a meaningful way.
Supported email-addresses
This is a list of all currently accepted email-addresses.
- *@mail.ps.uni-saarland.de (rewritten to ps.uni-saarland.de)
- *@mail.ps.uni-saarland.de (rewritten to ps.uni-saarland.de)
- all addresses mentioned in any users "mail" or "gosaMailAlternateAddress" LDAP/GOSA entry
group@mozart-oz.org (as long as group has the "acceptsMail:mozart" or "acceptsMail" attribute in the description)
group@ps.uni-saarland.de (as long as group has the "acceptsMail:ps" or "acceptsMail" attribute in the description)
group@ps.uni-saarland.de (identical to above)
- mozart-*@ps.uni-saarland.de/ps.uni-saarland.de/mozart-oz.org (the mozart- is stripped)
RBG Aliases
The following aliases are configured on the RBG Mailserver (mail.cs.uni-saarland.de) for @cs.uni-saarland.de:
smolka: smolka@ps.uni-saarland.de g-smolka: g-smolka@ps.uni-saarland.de csadminps: cs-admin@ps.uni-saarland.de sek-gs: sek-gs@ps.uni-saarland.de tapkan: tapkan@ps.uni-saarland.de duchier: duchier@ps.uni-saarland.de henz: henz@ps.uni-saarland.de mehl: mehl@ps.uni-saarland.de mmueller: mmueller@ps.uni-saarland.de niehren: niehren@ps.uni-saarland.de popow: popow@ps.uni-saarland.de schulte: schulte@ps.uni-saarland.de vanroy: vanroy@ps.uni-saarland.de walser: walser@ps.uni-saarland.de wuertz: wuertz@ps.uni-saarland.de
The following mail addresses are dropped on the RBG mail server:
neumann@ps.uni-saarland.de anwalt@ps.uni-saarland.de dansim@ps.uni-saarland.de lorenz@ps.uni-saarland.de