EXIM on Mailhubs

File Locations:

  • /usr/exim – distribution installation directory
  • /usr/exim/configure – main configuration file (same across all hubs)
  • /usr/exim/configure.local – local server specific configuration
  • /etc/exim – directory containing utility lists and databases

The master copy of the main configuration file /usr/exim/configure is held on mailhub mx1.qub.ac.uk. The file is rsync’d to the other three mailhubs every 5 minutes using the root cron job –

# /root/scripts/rsync_exim_conf.sh

This means that you only have to make configuration changes to the file on mx1.qub.ac.uk but Exim needs to be restarted on each mailhub to effect any changes. Restart Exim using the command –

# systemctl restart exim

The file /usr/exim/configure.local is particular to each mailhub and changes must be made on each server. Again, Exim needs to be restarted if any changes are made.

Utility Lists and Databases:

The filenames in /etc/exim fall into two different categories: they are either flat text files or dbm database files. The flat text files all contain addresses, domains or IP addresses. The names should be self-explantory and they are used principally in the ACL section of the Exim configuration for blacklisting or whitelisting. These files are also rsync’d from mx1.qub.ac.uk to the other mailhubs as part of the script referred to above.

The database files are –

  • exch_table – list of local Exchange aliases
  • o365_table – list of Office 365 aliases
  • mlist_table – list of aliases from the Sympa list server
  • sm_table – list of St. Mary’s student aliases
  • local_domains – list of local domains

These database files are principally used for routing mail. They are built separately on each mailhub from correspondingly named text files with the suffix .dat – e.g. exch_table is built from exch_table.dat.

The first 2 tables are generated on each mailhub by the script /root/scripts/hub_tables.sh that utilises perl subscripts to extract mail alias information from Active Directory using LDAP. The data for the first two files is initially saved as –

  • exch_table_tmp.dat
  • o365_table_tmp.dat

These files are first checked by the script to see if they are larger than the previous data files. If they are equal or smaller, the database files are not updated. This is a safety feature to avoid the possibility of missing data from the database files. You need to check these files, particularly when numbers of accounts are being removed. If you are sure that the smaller temporary file is valid then copy it to the main data file and build the database file from it e.g.

# cp exch_table_tmp.dat exch_table.dat

# exim_dbmbuild exch_table.dat exch_table

The mlist_table database file is built from the mlist_table.dat file that is pulled across from cmc-mlist.qub.ac.uk using scp.

The local_domains file is built from local_domains.dat and that file should be updated as required.

The sm_table file is built from sm_table.dat. The information for that file should come from St. Mary’s or QSIS and usually only requires attention annually.

Sympa Mailing List Server

The server is currently running on Centos 5. The server also requires apache, mysql (or mariadb) and exim to be installed. Main file locations are –

  • /home/sympa – live distribution directory
  • /etc/sympa.conf – main configuration file
  • /etc/mail/sympa_aliases – main alias file

The sympa service can be stopped and started using the init.d scripts e.g.

# /etc/init.d/sympa start

Admin Console:

Access the management console via a browser using the URL –


You need to create a login the first time you access it using your email address as the account name. This should match the list manager address set in /etc/sympa.conf.

When you create a new list always use cmc-mlist.qub.ac.uk as the domain name. Sometimes when a new list is created and then the domain name is subsequently changed the alias entries for the list in /etc/mail/sympa_aliases may become garbled. If that happens edit the entries in the aliases file and restart sympa.

Mailhub Routing File:

The script /root/scripts/mx_alias.sh produces the file /home/sympa/tmp/mlist_table.dat that can be used for routing on the mailhubs. The script is run hourly and the mailhubs can retrieve the file using scp.