Notes For Debian Users These notes provide guidance for installing and running Exim4U on Debian and Ubuntu systems. As stated elsewhere in these instructions, Exim4U was originally developed under the RedHat/CentOS version of Linux, however, it has been installed and found to work well on other Linux and Unix systems including Debian, Ubuntu and FreeBSD. Proceed by following the instructions in the README, INSTALL, SPAMASSASSIN, WEBMAIL, APPEARANCE, and NOTES files, however, be aware that there are subtle differences in the Debian/Ubuntu file system as opposed to the RedHat/CentOS file system for which those instructions were written. These notes will cover the most significant differences and hopefully allow a smooth installation of Exim4u on your Debian/Ubuntu system. 1) EXIM (exim4) The Exim package in the Debian/Ubuntu repository is named "exim4". To install Exim from the Debian/Ubuntu repository: sudo apt-get install exim4-base sudo apt-get install exim4-daemon-heavy These commands should setup and install the following packages: exim4-config exim4-base exim4-daemon-heavy exim4 The version of Exim in the Debian/Ubuntu repositories as of this writing was 4.69 whereas Exim4U versions 1.2.x and above requires Exim version 4.71 for complete functionality. However, the only functionality that is lost with Exim 4.69 is DKIM signing and verification. See the file, EXIM_4.69, which includes instructions for modifying Exim4U versions 1.2.x and above to run with Exim version 4.69. Alternatively, you may use more current versions of Exim (4.71 and above) from Debian Backports if you want DKIM signing and verification features (read Exim From Debian Backport below) The Debian distribution has its own exim configuration system, however, you can implement a custom configuration in /etc/exim4/exim4.conf. Therefore, follow the following procedure for enabling the Exim4U exim configuration under Debian/Ubuntu: Copy the etc/exim directory and all of its contents from the Exim4U distribution to /etc/exim on the target Debian machine. Then symbolically link /etc/exim/exim.conf to /etc/exim4/exim4.conf: ln -s /etc/exim/exim.conf /etc/exim4/exim4.conf Additionally, you may want to set dc_eximconfig_configtype='none' in /etc/exim4/update-exim4.conf.conf to stop debconf from asking you questions about Debian's exim4 configuration. Use "man update-exim4.conf" for more information. Debian will now execute the Exim4U exim configuration automatically. Exim should be run under Debian/Ubuntu as the following ownership/group: user = Debian-exim group = Debian-exim The following two commands will change the user and group values to Debian-exim: sed -i -e 's/user = exim/user = Debian-exim/' /etc/exim/exim4u_local.conf.inc sed -i -e 's/group = exim/group = Debian-exim/' /etc/exim/exim4u_local.conf.inc (The default installation of Exim4u uses "exim" as the default username and group name) The mysql socket location under Debian/Ubuntu is: /var/run/mysqld/mysqld.sock (The default in exim4u is: /var/lib/mysql/mysql.sock) The mysql statement in exim4u_local.conf.inc should then be as follows: hide mysql_servers = ::(/var/run/mysqld/mysqld.sock)/exim4u/mysql_user/ (Exim4U default is: hide mysql_servers = localhost::(/var/lib/mysql/mysql.sock)/exim4u/exim4u/CHANGE) The following command can be used to set the mysql socket path correctly: sed -i -e 's/^\(hide mysql_servers =.*::(\).*\().*\)\/.*\/.*\/.*/\1\/var\/run\/mysqld\/mysqld.sock\2\/exim4u\/mysql_user\/NEWPASSWORD/' /etc/exim/exim4u_local.conf.inc where: exim4u = Database Name (default value = exim4u) mysql-user = MySQL User Name (default value = exim4u) NEWPASSWORD = MySQL Password Alternatively edit /etc/exim/exim4u_local.conf.inc and customize as required in the following format: hide mysql_servers = localhost::(/var/lib/mysql/mysql.sock)/exim4u/exim4u/CHANGE Exim on Debian/Ubuntu runs as "exim4". Therefore the service for starting/stopping/restarting exim is: /etc/init.d/exim4 ### Debian sqlite3 Command ### Exim4U utlizes the sqlite3 database engine for its greylisting database. If sqlite3 has not yet been installed on your Debian system then you need to install it as follows: sudo apt-get install sqlite3 ### Greylisting Database File Location Under Debian ### Exim4U's greylisting functionality requires that a sqlite3 database file, named greylist.db, be setup and maintained for greylisting. The Exim4U INSTALL file includes instructions for locating this file in the exim db directory (/var/spool/exim/db in RedHat/CentOS). Logically, for Debian, the greylist.db file would therefore be put in /var/spool/exim4/db, however, this location has been reported to confict with the exim4-base cron script that is installed with exim4 under Debian for cleaning up the other exim4 database files in that directory. Therefore, the greylist.db file should be located somewhere else instead of the exim db directory for Debian systems. You can put the greylist.db file anywhere else that you want in your file system, however, you must then amend etc/exim/exim-greylist.conf.inc and the greylist-tidy.sh script to reflect your chosen location for greylist.db. ### Vacation Autoreply Database File Location Under Debian ### Exim4U's vacation autoreply functionality uses db files as well. As is the case with the greylist.db file, the vacation autoreply files should be stored elsewhere other than the exim db directory for Debian systems. You may specify the directory where these files are stored with the variable, AR_ONCE_FILE, in etc/exim/exim4u_local.conf.inc. ### SPF Perl Module Location ### Install spfd with: apt-get install spf-tools-perl In Debian/Ubuntu, the SPF perl module is located at /usr/sbin/spfd instead of /usr/bin/spfd.perl-msq. Therefore, the command to put into /etc/rc.local as described in the INSTALL file should be amended to reflect this location as follows: /usr/sbin/spfd -socket=/tmp/spfd --socket-user Debian-exim --socket-group Debian-exim --set-user Debian-exim & ### Exim Versions Prior To 4.71 - Disabling DKIM ### If the following error is reported when starting exim4, then you probably are running an Exim version prior to 4.71: servername:/etc/exim# /etc/init.d/exim4 start Starting MTA:2010-03-01 15:19:54 Exim configuration error in line 129 of /etc/exim4/exim4.conf: main option "dkim_verify_signers" unknown Warning! Invalid configuration file for exim4. Exiting....failed. servername:/etc/exim# Use "exim4 -bV" to report your version of Exim. All Exim versions prior to 4.71 do not support DKIM and therefore you must remove the DKIM related items in exim4.conf from those earlier versions. The following can be used to comment out the DKIM functionality: sed -i -e 's/^\(dkim_verify_signers =.*\)$/#\1/' /etc/exim4/exim4.conf sed -i -e 's/^\(acl_smtp_dkim =.*\)$/#\1/' /etc/exim4/exim4.conf In addition, edit /etc/exim4/exim4.conf and comment out the following sections: emote_smtp_multi_IP_DK: remote_smtp_DK: 2) EXIM4U WEB INTERFACE Apache runs under Debian/Ubuntu as apache2. Install apache2, php5, libapache2-mod-php5, mysql-server, mysql-client php5-mysql and php-pear and php5-imap with apt: apt-get install apache2 php5 libapache2-mod-php5 apt-get install mysql-server mysql-client php5-mysql apt-get install php-pear php5-imap Perl should be preinstalled, however, if not then install it with: apt-get install pear Optionally, install PhpMyAdmin: apt-get install phpmyadmin The standard DocumentRoot for Debian/Ubuntu is typically /var/www or /home/www. Exim4U's INSTALL file instructions locate the web interface's DocumentRoot at /home/exim4u/public_html which is standard for RedHat/CentOS. Nevertheless, you may relocate the DocumentRoot to any other directory that you prefer. 3) CLAMAV (ClamAV) To install in Debian: apt-get install clamav clamav-daemon The socket file that the clam daemon (clamd) uses is defined in exim4u_local.conf.inc with a default setting of: av_scanner = clamd:/var/run/clamav/clamd This default works with RedHat/CentOS, however, on Debian that line should read: av_scanner = clamd:/var/run/clamav/clamd.ctl It has been reported that on Ubuntu 11.04 this line should read: av_scanner = clamd:/var/run/clamav/clamd.sock In Debian, service scripts are included in /etc/init.d for both the clamav daemon and for freshclam so there is no need to otherwise start the freshclam daemon in /etc/rc.local as described in the INSTALL file for Redhat/CentOS. 4) SPAMASSASSIN The file SPAMASSASSIN recommends to setup a set of channels to maximize SPAM protection, here are working instructions to pull perl packages required by these channels, note that some have no Debian package and must be fetched from CPAN: apt-get install spamassassin razor libmail-dkim-perl libio-socket-ssl-perl g++ perl -MCPAN -e'CPAN::Shell->install("Mail::DomainKeys")' perl -MCPAN -e'CPAN::Shell->install("IP::Country::Fast")' perl -MCPAN -e'CPAN::Shell->install("Net::Ident")' perl -MCPAN -e'CPAN::Shell->install("Encode::Detect")' perl -MCPAN -e "CPAN::Shell->force(qw(install Mail::SPF::Query));" Thanks to the Debian razor package, you may install razor with "apt-get install razor". Then, start the razor setup procedure at the step where you create the config file (read file SPAMASSASSIN for razor setup). Pyzor may also be installed from the Debian repos with: apt-get install pyzor. Force install may be required for package Mail::SPF::Query to ignore unrelevant test failure on error message comparison. For Debian Squeeze, the perl installation of Mail::DomainKeys and Mail::SPF::Query are not required. g++ is required to compile Encode::Detect. Check that spamassassin daemon is enabled $ grep ENABLE /etc/default/spamassassin ENABLED=1 5) EXIM FROM DEBIAN BACKPORT If you want to use Exim4U's DKIM feature and the Debian stable exim version is 4.69 then you need the backported exim version 4.71 or higher. Ensure you have a reference to the backport repository: $ grep backport /etc/apt/sources.list # http://www.backports.org/dokuwiki/doku.php?id=instructions deb http://www.backports.org/debian lenny-backports main contrib non-free Specify the packages you want to be pulled from backport $ cat /etc/apt/preferences Package: exim4-daemon-heavy Pin: release a=lenny-backports Pin-Priority: 999 Package: exim4-config Pin: release a=lenny-backports Pin-Priority: 999 Package: exim4-base Pin: release a=lenny-backports Pin-Priority: 999 Package: exim4 Pin: release a=lenny-backports Pin-Priority: 999 Install these packages again $ aptitude install exim4-daemon-heavy exim4-config exim4 $ dpkg -l | grep exim