[Amavisd-new-debian-devel] Re: Amavisd-new 2.2.1

Brian May amavisd-new-debian-devel@lists.alioth.debian.org
Sat, 16 Apr 2005 12:32:07 +1000


On Fri, Apr 01, 2005 at 11:15:05AM +1000, Brian May wrote:
> Suggestion #1:
> 
> /etc/amavis/conf.d: directory for configuration.
> 
> 00-upstream    - default settings from upstream.
>                  e.g. pristine config file from upstream.
> 10-debian      - default settings recommended by Debian,
>                  may override above.
> 20-debconf     - settings automatically detected by
>                  installation scripts, either by automatic checks
>                  or use of debconf (or combination).
> 30-???         - reserved
> 40-???         - reserved
> 50-???         - end user customisation, depends on user requirements.
>                  we don't touch anything here.

I have implemented almost the exact scheme.

Files can be downloaded from
<URL:http://snoopy.apana.org.au/~bam/tmp/>

This is very experimental.
Not tested, except it installs.
Not commited to CVS.
There might be errors in the default config.
Next version will keep same version number.

Complete sample config exists in

/usr/share/doc/amavisd-new/examples/amavisd.conf-sample.gz, but I haven't
worked out yet how users are to use it:
1. see 2 below.
2. It contains many entries that are already set in 10-debian that
most users shouldn't need to override.

Some changes I had to make:

1. complete config file is built as /etc/amavis/amavisd-all.conf,
not /var/lib/amavis/amavisd-all.conf, as amavisd complains if it
has write permission to file.

2. /etc/amavis/conf.d/30-user is currently a conffile and contains debian
values, this is because the values depend on $myhostname, and cannot appear
earlier:

# USER CONFIG FILE

# These settings *must* be configured here, as they depend on $mydomian
@local_domains_maps = ( [".$mydomain"] );
$virus_admin               = "virusalert\@$mydomain";  # notifications recip.
$mailfrom_notify_admin     = "virusalert\@$mydomain";  # notifications sender
$mailfrom_notify_recip     = "virusalert\@$mydomain";  # notifications sender
$mailfrom_notify_spamadmin = "spam.police\@$mydomain"; # notifications sender
$mailfrom_to_quarantine = ''; # null return path; uses original sender if undef

3. /etc/amavis/conf.d/20-debconf doesn't use debconf at the moment,
it is automatically generated (and overwritten) by the postinst:

        mydomain=`cat /etc/mailname || true`
        myhostname=`hostname -f || true`
        cat > /etc/amavis/conf.d/20-debconf << EOF
# ADMINSTRATORS: DO NOT CHANGE THIS FILE
# Change values in /etc/amavis/conf.d/30-user instead.

\$mydomain = "$mydomain";
\$myhostname = "$myhostname";

1;
EOF

(this could be extended to extract values from /etc/amavis/amavisd.conf
if desired).

If this doesn't work, values can be overriden in /etc/amavis/conf.d/30-user.

I really don't like the fact that /etc/amavis/conf.d/30-user is a conffile, I
think this is the first issue I will need to deal with.

e.g. Maybe I could cut back on
/usr/share/doc/amavisd-new/examples/amavisd.conf-sample.gz, and have it
installed as 30-user but only if the file doesn't already exist.

Any comments?

My first run on test system went as:

--- cut ---
[579] [scrooge:bam] ~/source/debian/unstable/amavisd-new/amavisd-new >telnet localhost 10024
Trying 127.0.0.1...
Connected to scrooge.apana.org.au.
Escape character is '^]'.
220 [127.0.0.1] ESMTP amavisd-new service ready
MAIL FROM: bam@snoopy.apana.org.au
250 2.1.0 Sender bam@snoopy.apana.org.au OK
RCPT TO: bam@snoopy.apana.org.au
250 2.1.5 Recipient bam@snoopy.apana.org.au OK
DATA
354 End data with <CR><LF>.<CR><LF>
Subject:  test

.
451 4.5.0 Error in processing, id=09229-01, virus_scan FAILED: virus_scan: NO VIRUS SCANNERS AVAILABLE
quit
221 2.0.0 [127.0.0.1] amavisd-new closing transmission channel
Connection closed by foreign host.
--- cut ---

which kind of makes sense as I really don't have any virus scanners installed
(let alone a MTA).

Hmmm. The stop operation is broken:

scrooge:/home/bam/source/debian/unstable/amavisd-new# dpkg --purge
amavisd-new
(Reading database ... 136422 files and directories currently installed.)
Removing amavisd-new ...
Stopping amavisd: (not running).
Purging configuration files for amavisd-new ...
Removing user `amavis'...
done.
Removing amavis files and directories...
scrooge:/home/bam/source/debian/unstable/amavisd-new# ps auwx | grep amavi
106       9228  0.0 13.7  38700 35352 ?        Ss   13:05   0:00 amavisd (master)
106       9229  0.0 13.8  39340 35524 ?        S    13:05   0:00 amavisd (ch1-avail)
106       9231  0.0 13.8  39340 35440 ?        S    13:05   0:00 amavisd (virgin child)
root     10484  0.0  0.1   1544   468 pts/1    S+   13:26   0:00 grep amavi

...and /var/run/amavis still exists after the purge operation.

Some more issues to investigate.

Out of time right now, need to prepare for LCA2005 ;-).
-- 
Brian May <bam@debian.org>