What's the deal with amavisd-new 2.3.3 on Debian?


Or   What's the deal with amavisd-new 2.4.2 on Debian?

Let me start by saying "absolutely no warranty" and "use at your own risk".
I encourage you to first inspect any files for malicious content prior to downloading them. Most of this document only applies to the Debian version of amavisd-new 1:2.3.3-4 (and older versions of the 2.3.3 package). Fortunately many of the problems listed here have been resolved in version 1:2.3.3-6 so if you plan on using the Debian package I urge you to upgrade to that (or newer) version to avoid many of the problems listed here.

If you install the new 1:2.3.3-1 (or -2, -3, -4) version of amavisd-new via the Debian package, you are in for a few (possibly unpleasant) surprises. This long awaited package is now available in the 'testing' (etch) branch of Debian. To start with, this new version requires libcompress-zlib-perl (Compress::Zlib) version 1.35 or later, but the latest version in 'stable' (sarge) is 1.34. If you upgrade this module to the testing version (which you must do), it may also upgrade libc6, libc6-dev, locales, libdb4.3, perl, perl-base and perl-modules. This may not be desirable and can be avoided by manually installing Compress::Zlib or better yet, install libcompress-zlib-perl from http://www.backports.org/dokuwiki/doku.php?id=instructions. In fact, installing programs from 'testing' or 'unstable' could potentially remove your kernel. If you are running a 2.6.8 or earlier kernel at the present time, and you wish to install programs from 'testing' or 'unstable' that depend on a newer version of libc6 at any time in the future, it is quite possible you are going to have to migrate to one of the new linix-image kernels. See http://verchick.com/mecham/public_html/spam/kernel.html

The new 2.3.3+ Debian version of amavisd-new is designed to no longer use amavisd.conf. If you upgrade from 20030616p10 your old amavisd.conf will be renamed amavisd.conf.disabled. Most likely amavisd-new will not start after the upgrade. If you try to start it from the command line with 'amavisd-new start' it will die and complain that you are missing amavisd.conf (which you are at this point). If you try to start it with '/etc/init.d/amavis start' it may start or it may fail to start. It may say "Found old config file /etc/amavis/amavisd.conf" even if the file no longer exists. This is because it actually looks for /etc/amavis/amavisd.conf.disabled and may fail to start if it exists. I suggest mv'ing this file to /etc/amavis/amavisd.conf-current (or similar). Doing so will allow you to start amavisd-new using "/etc/init.d/amavis start". At this point however you are reading your configuration from Debian supplied files located in /usr/share/amavis/conf.d and /etc/amavis/conf.d directories. Sure, you can get your amavisd.conf file back by mv'ing /etc/amavis/amavisd.conf.disabled to /etc/amavis/amavisd.conf. This may allow you to start amavisd-new using "/etc/init.d/amavis start" but your amavisd.conf file may not be read at all if you use the init script. This is the way the Debian package maintainers want you to start/stop amavisd-new. They do not want you to use amavisd.conf at all. They want you to completely reconfigure your system using the new configuration files. With amavisd.conf back in action however, you may now be able to start amavisd-new from the command line but in this case amavisd.conf may be used and all the new settings in the /conf.d directories may be ignored. The new configuration files located in /usr/share/amavis/conf.d are:

10-debian_scripts
20-package


and in /etc/amavis/conf.d there are:

01-debian
05-node_id
15-av_scanners
15-content_filter_mode
20-debian_defaults
30-template_localization
50-user


It appears the files are read sequentially, with the files located in /usr/share/amavis/conf.d read first, so any settings you place in the '50-user' file should override previous settings.

The standard versions of amavisd-new use the default English version of notification templates which are included in the body of the amavisd-new executable itself. These templates change with different versions of amavisd-new. The Debian versions of amavisd-new are configured to use external language specific notification template files located in subdirectories of /etc/amavis. Those directories are (or at least were) en_US, de_DE, it_IT and pt_BR. Each directory has a list of files:

charset
template-dsn.txt
template-spam-admin.txt
template-spam-sender.txt
template-virus-admin.txt
template-virus-recipient.txt
template-virus-sender.txt


all of which are required when using external template files in this manner. The external template files are controlled by the setting:
read_l10n_templates('en_US', '/etc/amavis');
in amavisd.conf. To discontinue use of the external files, you can comment out this setting in amavisd.conf (or now it's located in /etc/amavis/conf.d/30-template_localization). When you upgrade from 20030616p10 to 2.3.3, due to the fact that the old templates are outdated for this new amavisd-new version, the files in /etc/amavis/en_US are all replaced with newer versions. No one has translated the remaining templates, so the package maintainers simply renamed the directories so they cannot be used:

de_DE.outdated_for_2.3.3-2
it_IT.outdated_for_2.3.3-2
pt_BR.outdated_for_2.3.3-2


If you use a program like Maia Mailguard, upgrading amavisd-new (to any version) will of course break your system, but an upgrade to 2.3.3 is doubly bad. Besides the obvious fact that your amavisd-new file has been replaced (which of course is the easy part to fix) and you no longer have an amavisd.conf file (which is also easily fixed - remember, it was renamed amavisd.conf.disabled), the init script will no longer read your amavisd.conf (or you may not be able to start amavisd-new because of its existence), and the newer en_US template files may not be compatible with Maia. I will let you fix the the first two problems, and I will provide a way to fix the last two:

Note that none of the init scripts supplied with Debian package version 1:2.3.3-x should be used with the original version of amavisd-new (downloaded from http://www.ijs.si/software/amavisd/), or the one supplied with Maia Mailguard. The init script supplied with version -4 and older will not allow you to start amavisd-new if amavisd.conf.disabled exists, and from version -5 on, you cannot start amavisd-new if either amavisd.conf.disabled or amavisd.conf exist.

You should realize that in version 1:2.3.3-5 of the amavisd-new executable, the package maintainers moved the code that "loads the configuration from files located in the the /conf.d directories" from the init script, into amavisd-new itself. This was done to insure the Debian version of amavisd-new will no longer use amavisd.conf.

It should be noted there was another bug in versions up to -6. Quarantined items were sent to a single mbox file '/var/lib/amavis/quarantine' if a directory by the same name did not exist prior to the installation of the package.  In version -6 the package maintainers reverted to placing quarantined items in the '/var/lib/amavis/virusmails' directory.

For those that wish to use Maia Mailguard, or the original version of amavisd-new (both of which use amavisd.conf), you must replace the init script. To replace your 1:2.3.3-x init script with the old 20030616p10 init script (which will not specifically load the settings in the new /conf.d directories and will allow you to once again use amavisd.conf with non-Debian versions of amavisd-new), follow these instructions:
First, download from me both the old and new scripts to have on hand:

cd /etc
wget http://verchick.com/mecham/public_html/debian/amavis-init-20030616
wget http://verchick.com/mecham/public_html/debian/amavis-init-2.3.3-6
wget http://verchick.com/mecham/public_html/debian/amavis-init-2.3.3-4

Now, to replace your 1:2.3.3-x script with the old 20030616p10 script:

cp /etc/amavis-init-20030616 /etc/init.d/amavis
chmod +x /etc/init.d/amavis

If for some reason you need to revert to using the 1:2.3.3-4 or -6 init script:

cp /etc/amavis-init-2.3.3-4 /etc/init.d/amavis
(or)
cp /etc/amavis-init-2.3.3-6 /etc/init.d/amavis
chmod +x /etc/init.d/amavis

As far as the templates go, I have made copies of the templates for versions 20030616-p10, 2.2.0 and 2.3.3. You are welcome to download them from me and replace your template files as you see fit, or as I mentioned earlier, you can configure amavisd-new to not use the external template files (which is the easy fix if you have not customized any templates).

If you choose to use my templates, this may save some typing. Notice the various versions:
Before you begin, make a backup:
cp -r /etc/amavis/en_US /etc/amavis/en_US-backup

If you need to use the 20030616p10 templates (Maia version 1.0.0 RC5):

cd /etc/amavis/en_US
rm charset
rm template-dsn.txt
rm template-spam-admin.txt
rm template-spam-sender.txt
rm template-virus-admin.txt
rm template-virus-recipient.txt
rm template-virus-sender.txt
wget http://verchick.com/mecham/public_html/amavisd/20030616p10/en_US/charset
wget http://verchick.com/mecham/public_html/amavisd/20030616p10/en_US/template-dsn.txt
wget http://verchick.com/mecham/public_html/amavisd/20030616p10/en_US/template-spam-admin.txt
wget http://verchick.com/mecham/public_html/amavisd/20030616p10/en_US/template-spam-sender.txt
wget http://verchick.com/mecham/public_html/amavisd/20030616p10/en_US/template-virus-admin.txt
wget http://verchick.com/mecham/public_html/amavisd/20030616p10/en_US/template-virus-recipient.txt
wget http://verchick.com/mecham/public_html/amavisd/20030616p10/en_US/template-virus-sender.txt

The 2.2.0 version is suitable for use with Maia 1.0.0:

cd /etc/amavis/en_US
rm charset
rm template-dsn.txt
rm template-spam-admin.txt
rm template-spam-sender.txt
rm template-virus-admin.txt
rm template-virus-recipient.txt
rm template-virus-sender.txt
wget http://verchick.com/mecham/public_html/amavisd/2.2.0/en_US/charset
wget http://verchick.com/mecham/public_html/amavisd/2.2.0/en_US/template-dsn.txt
wget http://verchick.com/mecham/public_html/amavisd/2.2.0/en_US/template-spam-admin.txt
wget http://verchick.com/mecham/public_html/amavisd/2.2.0/en_US/template-spam-sender.txt
wget http://verchick.com/mecham/public_html/amavisd/2.2.0/en_US/template-virus-admin.txt
wget http://verchick.com/mecham/public_html/amavisd/2.2.0/en_US/template-virus-recipient.txt
wget http://verchick.com/mecham/public_html/amavisd/2.2.0/en_US/template-virus-sender.txt

If you need to revert to the 2.3.3 templates:

cd /etc/amavis/en_US
rm charset
rm template-dsn.txt
rm template-spam-admin.txt
rm template-spam-sender.txt
rm template-virus-admin.txt
rm template-virus-recipient.txt
rm template-virus-sender.txt
wget http://verchick.com/mecham/public_html/amavisd/2.3.3/en_US/charset
wget http://verchick.com/mecham/public_html/amavisd/2.3.3/en_US/template-dsn.txt
wget http://verchick.com/mecham/public_html/amavisd/2.3.3/en_US/template-spam-admin.txt
wget http://verchick.com/mecham/public_html/amavisd/2.3.3/en_US/template-spam-sender.txt
wget http://verchick.com/mecham/public_html/amavisd/2.3.3/en_US/template-virus-admin.txt
wget http://verchick.com/mecham/public_html/amavisd/2.3.3/en_US/template-virus-recipient.txt
wget http://verchick.com/mecham/public_html/amavisd/2.3.3/en_US/template-virus-sender.txt


If you need the 2.4.0 templates:

cd /etc/amavis/en_US
rm charset
rm template-dsn.txt
rm template-spam-admin.txt
rm template-spam-sender.txt
rm template-virus-admin.txt
rm template-virus-recipient.txt
rm template-virus-sender.txt
wget http://verchick.com/mecham/public_html/amavisd/2.4/en_US/charset
wget http://verchick.com/mecham/public_html/amavisd/2.4/en_US/template-dsn.txt
wget http://verchick.com/mecham/public_html/amavisd/2.4/en_US/template-spam-admin.txt
wget http://verchick.com/mecham/public_html/amavisd/2.4/en_US/template-spam-sender.txt
wget http://verchick.com/mecham/public_html/amavisd/2.4/en_US/template-virus-admin.txt
wget http://verchick.com/mecham/public_html/amavisd/2.4/en_US/template-virus-recipient.txt
wget http://verchick.com/mecham/public_html/amavisd/2.4/en_US/template-virus-sender.txt


If you need the 2.4.1 templates:

cd /etc/amavis/en_US
rm charset
rm template-dsn.txt
rm template-spam-admin.txt
rm template-spam-sender.txt
rm template-virus-admin.txt
rm template-virus-recipient.txt
rm template-virus-sender.txt
wget http://verchick.com/mecham/public_html/amavisd/2.4.1/en_US/charset
wget http://verchick.com/mecham/public_html/amavisd/2.4.1/en_US/template-dsn.txt
wget http://verchick.com/mecham/public_html/amavisd/2.4.1/en_US/template-spam-admin.txt
wget http://verchick.com/mecham/public_html/amavisd/2.4.1/en_US/template-spam-sender.txt
wget http://verchick.com/mecham/public_html/amavisd/2.4.1/en_US/template-virus-admin.txt
wget http://verchick.com/mecham/public_html/amavisd/2.4.1/en_US/template-virus-recipient.txt
wget http://verchick.com/mecham/public_html/amavisd/2.4.1/en_US/template-virus-sender.txt


If you need the 2.4.3 templates:

cd /etc/amavis/en_US
rm charset
rm template-dsn.txt
rm template-spam-admin.txt
rm template-spam-sender.txt
rm template-virus-admin.txt
rm template-virus-recipient.txt
rm template-virus-sender.txt
wget http://verchick.com/mecham/public_html/amavisd/2.4.3/en_US/charset
wget http://verchick.com/mecham/public_html/amavisd/2.4.3/en_US/template-dsn.txt
wget http://verchick.com/mecham/public_html/amavisd/2.4.3/en_US/template-spam-admin.txt
wget http://verchick.com/mecham/public_html/amavisd/2.4.3/en_US/template-spam-sender.txt
wget http://verchick.com/mecham/public_html/amavisd/2.4.3/en_US/template-virus-admin.txt
wget http://verchick.com/mecham/public_html/amavisd/2.4.3/en_US/template-virus-recipient.txt
wget http://verchick.com/mecham/public_html/amavisd/2.4.3/en_US/template-virus-sender.txt


To prevent future accidental upgrades, place the amavisd-new package on hold:

echo "amavisd-new hold" | dpkg --set-selections

If in the future, you would like to take amavisd-new off hold:
echo "amavisd-new install" | dpkg --set-selections

If you would like some samples of amavisd.conf files I have modified for use with Debian:
http://verchick.com/mecham/public_html/debian/amavisd.conf-20030616p10
http://verchick.com/mecham/public_html/debian/amavisd.conf-2.2.0
http://verchick.com/mecham/public_html/debian/amavisd.conf-2.3.2
http://verchick.com/mecham/public_html/amavisd/2.4/amavisd.conf
http://verchick.com/mecham/public_html/amavisd/2.4.2/amavisd.conf
http://verchick.com/mecham/public_html/amavisd/2.4.3/amavisd.conf

If you have already installed the 2.3.3 (or greater) package from Debian, and you don't like the way it's set up and you want to go back to the old way of doing things (configuring amavisd-new by modifying /etc/amavis/amavisd.conf) then please see the instructions at http://verchick.com/mecham/public_html/spam/debian-amavisd-new_2.4.2.html

Gary V
mr88talent at yahoo dot com
16 OCT 2006