How to don't spam-check for email recipient in amavis

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
siuntung
Posts: 7
Joined: Tue Jul 11, 2023 1:22 am

How to don't spam-check for email recipient in amavis

Post by siuntung »

Hi Administrator Zimbra,

One of our users wants every email from the sender to be able to go into her inbox, without going through a spam check.
I don't know how to make it like that.
Please help me from Zimbra experts on this forum

Thank You

Regards,
Untung
User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 861
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: 8.8.15_P44 RHEL8 NETWORK Edition

Re: How to don't spam-check for email recipient in amavis

Post by JDunphy »

siuntung
Posts: 7
Joined: Tue Jul 11, 2023 1:22 am

Re: How to don't spam-check for email recipient in amavis

Post by siuntung »

Hi JDunphy,

Thanks for your reply, I have already execute like below

zmprov ma user@example.com amavisBypassSpamChecks TRUE amavisSpamLover TRUE

So how can I know whether the command was successful or not?

Regards
Untung
jsojitra
Zimbra Employee
Zimbra Employee
Posts: 20
Joined: Wed Aug 10, 2022 5:45 pm

Re: How to don't spam-check for email recipient in amavis

Post by jsojitra »

Can you try below commands after setting the value?

Code: Select all

zmprov ga <email-address> | grep amavisBypassSpamChecks
zmprov ga <email-address> | grep amavisSpamLover
siuntung
Posts: 7
Joined: Tue Jul 11, 2023 1:22 am

Re: How to don't spam-check for email recipient in amavis

Post by siuntung »

sure like below:

zimbra@test:~/conf$ zmprov ga blabla.lay@blabla.com | grep amavisBypassSpamChecks
amavisBypassSpamChecks: TRUE
zimbra@test:~/conf$ zmprov ga blabla.lay@blabla.com | grep amavisSpamLover
amavisSpamLover: TRUE

Maybe can I find this effectiveness else where? log file?

Regards,
Untung
jsojitra
Zimbra Employee
Zimbra Employee
Posts: 20
Joined: Wed Aug 10, 2022 5:45 pm

Re: How to don't spam-check for email recipient in amavis

Post by jsojitra »

Returning value as TRUE means those attributes are obeying in the system. Please post if you face any issue or if more config needed for the respective query.
siuntung
Posts: 7
Joined: Tue Jul 11, 2023 1:22 am

Re: How to don't spam-check for email recipient in amavis

Post by siuntung »

Hi JDunphy,

Excluding spam check is working well now.
She does not receive email spam in junk folder but receive email in inbox and also not SPAM tagging in subject anymore

Thank you for your help

Regards,
Untung
User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 861
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: 8.8.15_P44 RHEL8 NETWORK Edition

Re: How to don't spam-check for email recipient in amavis

Post by JDunphy »

Hi Untung,

You are welcome.

BTW, It's possible to look in /var/log/zimbra.log and see the SA headers so you know score and what rules fired.

I wrote something to parse this years ago that might help in the future.

Ref: https://raw.githubusercontent.com/JimDu ... ed_spam.pl

Usage is this (run from any user that has read permission of /var/log/zimbra.log):

Code: Select all

% check_rejected_spam.pl 
user is @ rules[0] ham[0] spam[0] discard[0]
usage: % check_spam.pl 
      [--user=<username>]
      [--ham|h ]
      [--spam|s ]
      [--discard|d ]
      [--rules|r ]
      [--option|o ]
    requires one of
       --ham | --spam | --discard
    where
       --ham will display only ham
       --spam will display only spam
       --discard will display not delivered email due to scoring
       --rules DO NOT display SA rules that fired
       --user will display only email destined for that user
 
Example of output looking for spam classified only without listing the individual rules that SA fires on

Code: Select all

% check_spam.pl --spam --rules
...
...
Score [14.206] To: b.lastname@example.com From: cloudmail@servermail.com
Score [ 6.204] To: j@example.com From: bouncebacks@ceotoday-magazine.com
Score [ 5.356] To: d.lastname@example.com From: grayrentaldisplays92@gmail.com
or discard would be

Code: Select all

% check_spam.pl --discard --rules
...
...
Score [38.188] To: j@example.com From: D2Wdv35nwY0cChwXgD@boiling.catenaliggette.xyz
Score [34.186] To: b.lastname@example.com From: 2zDDGyCSJ4riGneFHx@jump.catenaliggette.xyz
Score [34.186] To: b.lastname@example.com From: 4ySyUjJX1CSA2o2IJu@jump.catenaliggette.xyz
Score [47.419] To: b.lastname@example.com From: 25645-446682-200990-7089-b=example.com@mail.flexapain.world
Where your zimbra thresholds determine what goes into spam and discard. ie) Anything scored over 15 is generally discarded. I can't remember Zimbra defaults but I think 5 is the score required before it is put in the junk folder. I use a slightly lower score here.

Jim
siuntung
Posts: 7
Joined: Tue Jul 11, 2023 1:22 am

Re: How to don't spam-check for email recipient in amavis

Post by siuntung »

Hi Jim,

I have already copas your script check_rejected_spam.pl and run it, the output like below:

Code: Select all

# ./check_rejected_spam.pl --spam --rules
user is @ rules[1] ham[0] spam[1] discard[0]

Total counts: 0 Spam Email: 0

# ./check_rejected_spam.pl --discard --rules
user is @ rules[1] ham[0] spam[0] discard[1]

Total counts: 0 Discarded Email: 0
It looks like there is no response, and actually there is content in the zimbra.log file
or is this due to zimbraAmavisLogLevel: 2 ?

Regards,
Untung
User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 861
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: 8.8.15_P44 RHEL8 NETWORK Edition

Re: How to don't spam-check for email recipient in amavis

Post by JDunphy »

siuntung wrote: Fri Sep 15, 2023 7:09 am It looks like there is no response, and actually there is content in the zimbra.log file
or is this due to zimbraAmavisLogLevel: 2 ?
Hi Untung,

Probably. You would need to bump up the level or update the parser for the information at level 2 in your logs. At the top of the program, I have this:

Code: Select all

# Zimbra Assumptions:
# Amavis at level 3 logging to see spam_scan lines in /var/log/zimbra.log to parse:
#   % zmprov ms `zmhostname` zimbraAmavisLogLevel 3
#   % zmantispamctl restart
I run log level 3 and it works here. If you have spam-tag, spam_scan, etc in the log, it is probably just an adjustment of the RE to parse it correctly for level 2 logging which probably lacks a field or 2 would be my guess at level 2. My comments say that spam_scan is available for level 3 so you could be missing a complete line in the logs too. Searching for '(spam_scan|spam-tag)' would probably alert you to what is available at level 2.

Jim
Post Reply