Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mail filter antivirus ignores size and action settings #6527

Closed
filippocarletti opened this issue Jun 18, 2021 · 6 comments
Closed

mail filter antivirus ignores size and action settings #6527

filippocarletti opened this issue Jun 18, 2021 · 6 comments
Labels
bug A defect of the software verified All test cases were verified successfully

Comments

@filippocarletti
Copy link
Member

We have options to reject (or mark as spam) mails containing a virus and to avoid scanning big files, setting a limit on the attachment size to send to the antivirus engine.
These options are ignored.

Steps to reproduce

  • config setprop rspamd VirusScanSize 99999
  • signal-event nethserver-mail-filter-update
  • grep max_size /etc/rspamd/local.d/antivirus.conf

Expected behavior

max_size = 99999;

Actual behavior

max_size = 20000000;

Components

nethserver-mail-filter-2.30.0-1.ns7.noarch

@filippocarletti filippocarletti added the bug A defect of the software label Jun 18, 2021
@filippocarletti
Copy link
Member Author

Both props are speeled incorrectly in the template:

my $action = $rspamd{'antivirusAction'} || 'reject';
my $scanSize = $rspamd{'antivirusScanSize'} || '20000000';

~]# config show rspamd | grep Virus
    VirusAction=reject
    VirusCheckStatus=enabled
    VirusScanOnlyAttachment=false
    VirusScanSize=2000000

@stephdl
Copy link

stephdl commented Jun 18, 2021

indeed

[root@prometheus ~]# grep -srni 'VirusScanSize' /etc/e-smith/templates
/etc/e-smith/templates/etc/rspamd/local.d/antivirus.conf/10base:3:my $scanSize = $rspamd{'antivirusScanSize'} || '20000000';
/etc/e-smith/templates/etc/rspamd/local.d/external_services.conf/10base:26:  max_size = $rspamd{'VirusScanSize'};\n";
[root@prometheus ~]# grep -srni 'VirusScanSize' /usr/libexec/nethserver/api/
/usr/libexec/nethserver/api/nethserver-mail/filter/validate:39:    $v->declareParameter('VirusScanSize', Validate::POSITIVE_INTEGER);

and

[root@prometheus ~]# grep -srni 'virusAction' /etc/e-smith/templates
/etc/e-smith/templates/etc/rspamd/local.d/antivirus.conf/10base:2:my $action = $rspamd{'antivirusAction'} || 'reject';

gsanchietti added a commit to NethServer/nethserver-mail that referenced this issue Jun 18, 2021
Fix bad esmith property for clamav (rspamd key)

NethServer/dev#6527
@nethbot
Copy link
Member

nethbot commented Jun 18, 2021

in 7.9.2009/testing:

@gsanchietti
Copy link
Member

Test case
Check the issue is not reproducible

@gsanchietti gsanchietti added the testing Packages are available from testing repositories label Jun 21, 2021
@lucagasparini lucagasparini self-assigned this Jun 22, 2021
@lucagasparini
Copy link

Before updating:

rpm -qa|grep nethserver-mail

nethserver-mail-filter-2.30.0-1.ns7.noarch
nethserver-mail-common-2.30.0-1.ns7.noarch
nethserver-mail-smarthost-2.30.0-1.ns7.noarch
nethserver-mail-server-2.30.0-1.ns7.noarch
~]#  config getprop rspamd VirusScanSize
20000000

config setprop rspamd VirusScanSize 99999
signal-event nethserver-mail-filter-update

grep max_size /etc/rspamd/local.d/antivirus.conf

  # If `max_size` is set, messages > n bytes in size are not scanned
  max_size = 20000000;

Updated with testing packages:

rpm -qa|grep nethserver-mail

nethserver-mail-filter-2.30.0-1.2.g354f910.ns7.noarch
nethserver-mail-common-2.30.0-1.2.g354f910.ns7.noarch
nethserver-mail-smarthost-2.30.0-1.2.g354f910.ns7.noarch
nethserver-mail-server-2.30.0-1.2.g354f910.ns7.noarch
~]#  config getprop rspamd VirusScanSize
99999

grep max_size /etc/rspamd/local.d/antivirus.conf

  # If `max_size` is set, messages > n bytes in size are not scanned
  max_size = 99999;

The bug is not reproducible

@lucagasparini lucagasparini removed their assignment Jun 22, 2021
@lucagasparini lucagasparini added verified All test cases were verified successfully and removed testing Packages are available from testing repositories labels Jun 22, 2021
@nethbot
Copy link
Member

nethbot commented Jun 23, 2021

in 7.9.2009/updates:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A defect of the software verified All test cases were verified successfully
Projects
None yet
Development

No branches or pull requests

5 participants