Tag spam only for recipients from a domain [SOLVED]

Scappatura Rocco Rocco.Scappatura at infracom.it
Wed Jun 7 17:09:51 CEST 2017


Hello!

Finally I succeed to get amavisd-new to work as I aspect.. :-)

I put domain example.com in @local_domains_acl so the messages where tagged with "[Spam] " in subject:

@local_domains_acl = (
  ".$mydomain" ,
  '.example.com',
);

Then I put example.com in @spam_lovers_maps array:

@spam_lovers_maps = ({
  '.example.com'     => 1,
});

Finally I redefine $sa_kill_level_deflt for domain example.com:

@spam_kill_level_maps = ({
  '.example.com'     => 9999,
},
\$sa_kill_level_deflt,
);

All messages for recipient *@example.com with score above 6.31 will be tagged with "[Spam] " and delivered.

Regards

From: Simon B [mailto:simon.buongiorno at gmail.com] 
Sent: Wednesday 7 June 2017 12:35
To: Scappatura Rocco
Cc: amavis-users at amavis.org
Subject: RE: Tag spam only for recipients from a domain

On 7 Jun 2017 12:12, "Scappatura Rocco" <Rocco.Scappatura at infracom.it> wrote:
>
> Hello Dino.
>
> > First of all, for spam the following directive applies:
> >
> > $final_spam_destiny = D_DISCARD;
> >
> > Not
> >
> > $final_banned_destiny     = D_DISCARD;
> >
> > $final_banned_destiny is for banned files not spam.
>
> You are quite right. I have mistyped 'final_banned_destiny' instead of 'final_spam_destiny'.
>
> > In order to accomplish what you want, you should probably set up
> >
> > $final_spam_destiny = D_DISCARD;
> >
> > That would probably take care of all the rest of the users and then for
> > the example.com domain, create a policy for that has a really high
> > spam_kill_level and assign the users you want to it. So,
> > spam_kill_level of 999 would probably work.
> >
> > You are going to have to use a database to accomplish all this.
>
> It is possible to use a map so to assign the value 999 to $sa_kill_level_deflt (and $sa_dsn_cutoff_level) on 'per domain' basis?
>
> P.S.: in order to tag spam messages for *@example.com, should I also list 'example.com' in the array @local_domains_acl?
You need a policy bank.  I don't use one, but there should be well documented instructions on the web and in the mailing list archives.
Simon



More information about the amavis-users mailing list