difference between $final_*_destiny and %final_destiny_by_ccat
Mark Martinec
Mark.Martinec+amavis at ijs.si
Mon Jan 23 17:39:30 CET 2012
Stefan,
> I had these settings in my /etc/amavisd.conf (amavisd-new-2.6.6; Perl
> version 5.010000):
>
> $final_virus_destiny = D_DISCARD;
> $final_banned_destiny = D_PASS;
> $final_spam_destiny = D_PASS;
> $final_bad_header_destiny = D_PASS;
> $warnvirussender = 1;
> $warnvirusrecip = 1;
>
> And got these loglines after sending an EICAR Virus:
> [...]
> amavis[29009]: (29009-01) SEND via SMTP:
> <support at example.com> -> <user2 at example.com>...
> amavis[29009]: (29009-01) SEND via SMTP:
> <> -> <user1 at example.com> ...
>
> Then I replaced the $final_*_destiny settings by:
>
> %final_destiny_by_ccat = (
> CC_VIRUS , D_DISCARD,
> CC_BANNED , D_PASS,
> CC_UNCHECKED , D_PASS,
> CC_SPAM , D_PASS,
> CC_BADH , D_PASS,
> CC_OVERSIZED , D_PASS,
> CC_CLEAN , D_PASS,
> CC_CATCHALL , D_PASS
> );
>
> And got the following loglines after sending an EICAR Virus:
> [...]
> amavis[29851]: (29851-01) SEND via SMTP:
> <support at example.com> -> <user2 at example.com> ...
>
> With the later settings amavisd has skipped sending the senders
> notification. Is that a feature or a bug?
You have fallen victim of a compatibility hack regarding $final_virus_destiny,
which implicitly turns $final_virus_destiny D_DISCARD into a D_BOUNCE
(which enables a warning message to be sent to the sender):
if ($final_virus_destiny == D_DISCARD && c('warnvirussender') )
{ $final_virus_destiny = D_BOUNCE }
When you set $final_destiny_by_ccat{&CC_VIRUS} directly, this
hack is avoided.
Note that $warnvirussender is no longer supported since 2.7.0.
The clean way to enable sending a warning to a sender is to
use D_REJECT (instead of D_DISCARD). This avoids all the
back-compatibility hackery and should work with 2.6.*
as well as with 2.7.0. It also works either by setting the
$final_destiny_by_ccat{&CC_VIRUS} directly, or indirectly
through $final_virus_destiny (when leaving %final_destiny_by_ccat
at its default).
Mark
More information about the amavis-users
mailing list