Scan locally generated email

Patrick Ben Koetter p at sys4.de
Mon Nov 12 23:16:43 CET 2012


* Simon Brereton <simon.buongiorno at gmail.com>:
> On 12 November 2012 10:20, Rob Sterenborg (lists) <lists at sterenborg.info> wrote:
> > Hello,
> >
> > I'm trying to get local email scanned. Found a lot of hints to exclude local
> > email from being scanned, but for some reason I can't get the opposite to
> > work. (Yes, I actually want to do that.)
> >
> > I have:
> >
> > $mydomain = 'mytestdomain.tld';
> > $myhostname = 'mx1.mytestdomain.tld';
> >
> > @local_domains_maps = (0);      # Also tried undef
> > @mynetworks = qw(127.0.0.2);    # Doesn't accept (), '', undef or anything
> > like that, so I just put in an unused IP address.
> >
> > @bypass_spam_checks_maps = (0); # Also tried undef
> >
> > @lookup_sql_dsn = (
> > ['DBI:mysql:database={dbname};host={hostname};port={port}', '{dbuser}',
> > '{dbpass}'] );
> >
> > $sa_tag_level_deflt = -999.0;
> >
> > In the database: spam_tag_level = -999
> >
> > In the received email I can see that the email went through Amavis, but
> > there's no Amavis/SA header line telling me what score it got.
> >
> > Can anyone please tell me what I'm overlooking?

Map your IPs to a policy bank:

#############################################################################
## POLICY BANKS: MAPPINGS
#

@client_ipaddr_policy = (
  [qw( 0.0.0.0/8 127.0.0.1/32 [::] [::1] )] => 'LOCALHOST',
  [qw( !172.16.1.0/24 172.16.0.0/12 192.168.0.0/16 )] => 'PRIVATENETS',
  [qw( 192.0.2.0/25 192.0.2.129 192.0.2.130 )] => 'PARTNER',
  [qw( 88.217.225.250/32 )] => 'CUSTOMERS',
  \@mynetworks => 'MYNETS',
);


Add a policy bank to e.g. LOCALHOST _and_ tell amavis mails in this policy bank
are originating:

#############################################################################
## POLICY BANKS: LOCALHOST
#
$policy_bank{'LOCALHOST'} = {
    originating => 1,
    final_spam_destiny => D_BOUNCE,
    final_virus_destiny => D_REJECT,
    final_banned_destiny=> D_PASS,
    final_bad_header_destiny => D_PASS,
    banned_filename_maps => ['MYNETS-DEFAULT'],
    warnbadhsender => 1,
    # warnbadhrecip => 0,
};


Finally tell amavis what recipient domains you have in @local_domains_acl.
amavis will ONLY tell repicients in @local_domains_acl what a messages spam
score is.

p at rick

-- 
[*] sys4 AG
 
http://sys4.de, +49 (89) 30 90 46 64
Franziskanerstraße 15, 81669 München
 
Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer
Aufsichtsratsvorsitzender: Joerg Heidrich
 


More information about the amavis-users mailing list