# /etc/amavis/conf.d/60-ku_settings
#
# overrides definizioni per amavis
#
# ::copy::
# ::maintainer::
#
use strict;

# abilita antivirus (commentato in 15-content_filter_mode)
@bypass_virus_checks_maps = (
   \%bypass_virus_checks, \@bypass_virus_checks_acl, \$bypass_virus_checks_re);

# abilita antispam (commentato in 15-content_filter_mode)
@bypass_spam_checks_maps = (
   \%bypass_spam_checks, \@bypass_spam_checks_acl, \$bypass_spam_checks_re);

# DOMAIN KEYS IDENTIFIED MAIL (DKIM)
$enable_dkim_verification = 1;

# Don't be verbose about sending mail:
# FIXME non ho capito bene cosa fa, dovrei metterlo uguale a @local_domains_acl?
# mydomain e` solo il dominio principale di posta, ma noi gestiamo virtual domains
@whitelist_sender_acl = qw( .$mydomain );

$final_virus_destiny      = D_DISCARD;
$final_banned_destiny     = D_PASS;	#[ku] BANNED, passa marcandolo, decide l'utente cosa fare
$final_spam_destiny       = D_PASS;	#[ku] SPAM, passa marcandolo, decide l'utente cosa fare
$final_bad_header_destiny = D_PASS;

$virus_admin	= '::amavis.notify_email::';
$spam_admin	= '::amavis.notify_email::';

#$sa_tag_level_deflt  = -999.0;

# definizione dei domini su cui applicare il controllo SPAM
#
@local_domains_acl = qw( ::amavis.enable_domains:: );

# custom, se questa variable e` true, carica dai virtual di postfix
# e li aggiunge a quelli definiti sopra
#
my $ku_auto_load_virtuals	= ::amavis.auto_load_virtuals::;

if ($ku_auto_load_virtuals) {
	my $KUSADOMAINS = '/etc/postfix/virtual.d/_domains';
	if (open( KUSADOMAINS, "<$KUSADOMAINS" )) {
		while( <KUSADOMAINS> ) {
			chomp();
			push( @local_domains_acl, "." . $_ );
		}
		close( KUSADOMAINS );
	} else {
		printf( STDERR "error opening $KUSADOMAINS: $!\n" );
	}
}

#------------ Do not modify anything below this line -------------
1;  # insure a defined return
