1 (edited by zshanthi 2017-11-09 11:37:06)

Topic: [SOLVED] Regarding disabling anti virus clamav

I had disabled anti virus scanning using the steps mentioned under

Stop virus/spam scanning, keep DKIM signing/verification and Disclaimer

If you want to disable virus and spam scanning, but keep DKIM signing and disclaimer, please try this:

    Keep content_filter = smtp-amavis:[127.0.0.1]:10024 in Postfix config file /etc/postfix/main.cf.

    Find below lines in /etc/amavisd/amavisd.conf:

# @bypass_virus_checks_maps = (1);  # controls running of anti-virus code
# @bypass_spam_checks_maps  = (1);  # controls running of anti-spam code

but I still see the following header attached to ALL my incoming emails

X-Virus-Scanned: Debian amavisd-new at mymxhost

so I want to know whether anti virus is disabled or still enabled in my server?

Thanks
Shanthi

2

Re: [SOLVED] Regarding disabling anti virus clamav

 --------------------- Amavisd-new Begin ------------------------

        5   Total messages scanned ------------------  100.00%
  954.542K  Total bytes scanned                        977,451
 ========   ==================================================
 
        5   Passed ----------------------------------  100.00%
        5     Clean passed                             100.00%
 ========   ==================================================
 
        5   Ham -------------------------------------  100.00%
        5     Clean passed                             100.00%
 ========   ==================================================
 
        5   SpamAssassin bypassed

Referring to my earlier thread https://forum.iredmail.org/topic13583-s … dmail.html
so I have managed to disable and bypass only the spam assassin but still the anti virus scan is not disabled. Am I right ? If so can anyone please tell me how to disable anti virus also ?

Thanks

3

Re: [SOLVED] Regarding disabling anti virus clamav

zshanthi wrote:

# @bypass_virus_checks_maps = (1);  # controls running of anti-virus code
# @bypass_spam_checks_maps  = (1);  # controls running of anti-spam code

You should remove the comment marks to DISABLE spam/virus scanning. Like this:

@bypass_virus_checks_maps = (1);
@bypass_spam_checks_maps  = (1);

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

4

Re: [SOLVED] Regarding disabling anti virus clamav

ZhangHuangbin wrote:
zshanthi wrote:

# @bypass_virus_checks_maps = (1);  # controls running of anti-virus code
# @bypass_spam_checks_maps  = (1);  # controls running of anti-spam code

You should remove the comment marks to DISABLE spam/virus scanning. Like this:

@bypass_virus_checks_maps = (1);
@bypass_spam_checks_maps  = (1);

Yes I have already removed those marks and restarted the server already.

But still I get the header in each incoming email

X-Virus-Scanned: Debian amavisd-new at mymxhost

5

Re: [SOLVED] Regarding disabling anti virus clamav

Check another place in same Amavisd config file:

$policy_bank{'ORIGINATING'} = {
    ...
    # Bypass checks
    #bypass_spam_checks_maps => [1],    # don't check spam
    #bypass_virus_checks_maps => [1],   # don't check virus
    #bypass_banned_checks_maps => [1],  # don't check banned file names and types
    #bypass_header_checks_maps => [1],  # don't check bad header
};

Also remove the '#' to DISABLE spam/virus scanning.

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

6

Re: [SOLVED] Regarding disabling anti virus clamav

    # force MTA conversion to 7-bit (e.g. before DKIM signing)
    #smtpd_discard_ehlo_keywords => ['8BITMIME'],

    # don't remove NOTIFY=SUCCESS option
    terminate_dsn_on_notify_success => 0,

    # don't perform spam/virus/header check.
    bypass_spam_checks_maps => [1],    # ORIGINATING spam
    bypass_header_checks_maps => [1],  # ORIGINATING bad-header
    bypass_virus_checks_maps => [1],   # ORIGINATING virus
    bypass_banned_checks_maps => [1],  # ORIGINATING banned file types

I removed the # and

/etc/init.d/amavis restart

and

service postfix restart


but when I receive a mail I still see the header

X-Virus-Scanned: Debian amavisd-new at mymxhost

and also there are more entries like

# Enable virus check.
@bypass_virus_checks_maps = (
   \%bypass_virus_checks,
   \@bypass_virus_checks_acl,
   $bypass_virus_checks_re,
   );

# Enable spam check.
@bypass_spam_checks_maps = (
    \%bypass_spam_checks,
    \@bypass_spam_checks_acl,
    $bypass_spam_checks_re,
    );

at the top, should I do anything about this ?

7

Re: [SOLVED] Regarding disabling anti virus clamav

During my testing, i just removed '#' for those "bypass_XX_checks_maps", restart Amavisd, then the X-Virus-Scanned header is gone.

Do you have these "bypass_XX_checks_maps" in "$policy_bank{'MYNETS'}"? Try to disable them in MYNETS too.

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

8

Re: [SOLVED] Regarding disabling anti virus clamav

Here is my entire file

use strict;

#
# Place your configuration directives here.  They will override those in
# earlier files.
#
# See /usr/share/doc/amavisd-new/ for documentation and examples of
# the directives you can use in this file
#


#------------ Do not modify anything below this line -------------
#{1}


chomp($mydomain = "m1.mymxhost.com");
@local_domains_maps = 1;
@mynetworks = qw( 127.0.0.0/8 [::1] );

# listen on multiple TCP ports. 9998 is used for releasing quarantined mails.
$inet_socket_port = [10024, 10026, 9998];

# Enable virus check.
@bypass_virus_checks_maps = (
   \%bypass_virus_checks,
   \@bypass_virus_checks_acl,
   $bypass_virus_checks_re,
   );

# Enable spam check.
@bypass_spam_checks_maps = (
    \%bypass_spam_checks,
    \@bypass_spam_checks_acl,
    $bypass_spam_checks_re,
    );

$mailfrom_notify_admin = "root\@$mydomain";
$mailfrom_notify_recip = "root\@$mydomain";
$mailfrom_notify_spamadmin = "root\@$mydomain";

# Mail notify.
$mailfrom_notify_admin     = "root\@$mydomain";  # notifications sender
$mailfrom_notify_recip     = "root\@$mydomain";  # notifications sender
$mailfrom_notify_spamadmin = "root\@$mydomain"; # notifications sender
$mailfrom_to_quarantine = ''; # null return path; uses original sender if undef

# Disable defang banned mail.
$defang_banned = 0;  # MIME-wrap passed mail containing banned name

$policy_bank{'MYNETS'} = {   # mail originating from @mynetworks
    originating => 1,  # is true in MYNETS by default, but let's make it explicit
    os_fingerprint_method => undef,  # don't query p0f for internal clients
    allow_disclaimers => 1,  # enables disclaimer insertion if available
    enable_dkim_signing => 1,
};

# it is up to MTA to re-route mail from authenticated roaming users or
# from internal hosts to a dedicated TCP port (such as 10026) for filtering
$interface_policy{'10026'} = 'ORIGINATING';

$policy_bank{'ORIGINATING'} = {  # mail supposedly originating from our users
    #inet_acl => [qw(127.0.0.1 [::1])],   # ORIGINATING: restrict access to these IP addresses
    originating => 1,  # declare that mail was submitted by our smtp client
    allow_disclaimers => 1,  # enables disclaimer insertion if available
    enable_dkim_signing => 1,

    # notify administrator of locally originating malware
    virus_admin_maps => ["root\@$mydomain"],
    spam_admin_maps  => [],
    bad_header_admin_maps => [],
    banned_admin_maps => ["root\@$mydomain"],
    warnbadhsender   => 1,
    warnbannedsender => 1,

    # force MTA conversion to 7-bit (e.g. before DKIM signing)
    #smtpd_discard_ehlo_keywords => ['8BITMIME'],

    # don't remove NOTIFY=SUCCESS option
    terminate_dsn_on_notify_success => 0,

    # don't perform spam/virus/header check.
    bypass_spam_checks_maps => [1],    # ORIGINATING spam
    bypass_header_checks_maps => [1],  # ORIGINATING bad-header
    bypass_virus_checks_maps => [1],   # ORIGINATING virus
    bypass_banned_checks_maps => [1],  # ORIGINATING banned file types
};


# Custom Amavisd log template to always log SpamAssassin testing results,
# useful for troubleshooting. if you want more verbose log, replace it by:
#
#   $log_templ = $log_verbose_templ;
#
# WARNING: $log_verbose_templ will log mail subject, this may be illegal
#          according to the laws in some countries.
#
# Note: You can find the original log template at the bottom of
#       /usr/sbin/amavisd-new.
$log_templ = '
[?%#D|#|Passed #
[? [:ccat|major] |#
OTHER|CLEAN|MTA-BLOCKED|OVERSIZED|BAD-HEADER-[:ccat|minor]|SPAMMY|SPAM|\
UNCHECKED[?[:ccat|minor]||-ENCRYPTED|]|BANNED (%F)|INFECTED (%V)]#
 {[:actions_performed]}#
,[?%p|| %p][?%a||[?%l|| LOCAL] [:client_addr_port]][?%e|| \[%e\]] %s -> [%D|,]#
[? %q ||, quarantine: %q]#
[? %Q ||, Queue-ID: %Q]#
[? %m ||, Message-ID: [:mail_addr_decode_octets|%m]]#
[? %r ||, Resent-Message-ID: [:mail_addr_decode_octets|%r]]#
[? %i ||, mail_id: %i]#
, Hits: [:SCORE]#
, size: %z#
[? [:partition_tag] ||, pt: [:partition_tag]]#
[~[:remote_mta_smtp_response]|["^$"]||[", queued_as: "]]\
[remote_mta_smtp_response|[~%x|["queued as ([0-9A-Za-z]+)$"]|["%1"]|["%0"]]|/]#
#, Subject: [:dquote|[:mime2utf8|[:header_field_octets|Subject]|100|1]]#
#, From: [:uquote|[:mail_addr_decode_octets|[:rfc2822_from]]]#
[? [:dkim|sig_sd]    ||, dkim_sd=[:dkim|sig_sd]]#
[? [:dkim|newsig_sd] ||, dkim_new=[:dkim|newsig_sd]]#
, %y ms#
[? %#T ||, Tests: \[[%T|,]\]]#
]
[?%#O|#|Blocked #
[? [:ccat|major|blocking] |#
OTHER|CLEAN|MTA-BLOCKED|OVERSIZED|BAD-HEADER-[:ccat|minor]|SPAMMY|SPAM|\
UNCHECKED[?[:ccat|minor]||-ENCRYPTED|]|BANNED (%F)|INFECTED (%V)]#
 {[:actions_performed]}#
,[?%p|| %p][?%a||[?%l|| LOCAL] [:client_addr_port]][?%e|| \[%e\]] %s -> [%D|,]#
[? %q ||, quarantine: %q]#
[? %Q ||, Queue-ID: %Q]#
[? %m ||, Message-ID: [:mail_addr_decode_octets|%m]]#
[? %r ||, Resent-Message-ID: [:mail_addr_decode_octets|%r]]#
[? %i ||, mail_id: %i]#
, Hits: [:SCORE]#
, size: %z#
[? [:partition_tag] ||, pt: [:partition_tag]]#
#, Subject: [:dquote|[:mime2utf8|[:header_field_octets|Subject]|100|1]]#
#, From: [:uquote|[:mail_addr_decode_octets|[:rfc2822_from]]]#
[? [:dkim|sig_sd]    ||, dkim_sd=[:dkim|sig_sd]]#
[? [:dkim|newsig_sd] ||, dkim_new=[:dkim|newsig_sd]]#
, %y ms#
[? %#T ||, Tests: \[[%T|,]\]]#
]';

# Set hostname.
$myhostname = "m1.mymxhost.com";
$mydomain = $myhostname;
$localhost_name = $myhostname;

# Set listen IP/PORT.
$notify_method  = 'smtp:[127.0.0.1]:10025';
$forward_method = 'smtp:[127.0.0.1]:10025';

@av_scanners = (
    #### http://www.clamav.net/
    ['ClamAV-clamd',
    \&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd.ctl"],
    qr/\bOK$/, qr/\bFOUND$/,
    qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
);

@av_scanners_backup = (
    ### http://www.clamav.net/   - backs up clamd or Mail::ClamAV
    ['ClamAV-clamscan', 'clamscan',
    "--stdout --disable-summary -r --tempdir=$TEMPBASE {}", [0], [1],
    qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
);

#
# Port used to release quarantined mails.
#
$interface_policy{'9998'} = 'AM.PDP-INET';
$policy_bank{'AM.PDP-INET'} = {
    protocol => 'AM.PDP',       # select Amavis policy delegation protocol
    #inet_acl => [qw(127.0.0.1 [::1])],   # QUARANTINE: restrict access to these IP addresses
    auth_required_release => 1,    # 0 - don't require secret_id for amavisd-release
    #log_level => 4,
    #always_bcc_by_ccat => {CC_CLEAN, 'admin@example.com'},
};

#########################
# Default action applied to detected spam/virus/banned/bad-header, and how to
# quarantine them
#
# Available actions:
#   - D_PASS: Mail will pass to recipients, regardless of bad contents.
#             If a quarantine is configured, a copy of the mail will go there.
#             Note that including a recipient in a @*_lovers_maps is
#             functionally equivalent to setting '*_destiny = D_PASS;'
#             for that recipient.
#
#   - D_BOUNCE: Mail will not be delivered to its recipients. A non-delivery
#               notification (bounce) will be created and sent to the sender.
#
#   - D_REJECT: Mail will not be delivered to its recipients. Amavisd will
#               send the typical 55x reject response to the upstream MTA and
#               that MTA may create a reject notice (bounce) and return it to
#               the sender.
#               This notice is not as informative as the one created using
#               D_BOUNCE, so usually D_BOUNCE is preferred over D_REJECT.
#               If a quarantine is configured, a copy of the mail will go
#               there, if not mail message will be lost, but the sender should
#               be notified their message was rejected.
#
#   - D_DISCARD: Mail will not be delivered to its recipients and the sender
#                normally will NOT be notified.
#                If a quarantine is configured, a copy of the mail will go
#                there, if not mail message will be lost. Note that there are
#                additional settings available that can send notifications to
#                persons that normally may not be notified when an undesirable
#                message is found, so it is possible to notify the sender even
#                when using D_DISCARD.
#
# Where to store quarantined mail message:
#
#   - 'local:spam-%i-%m', quarantine mail on local file system.
#   - 'sql:', quarantine mail in SQL server specified in @storage_sql_dsn.
#   - undef, do not quarantine mail.

# SPAM.
$final_spam_destiny = D_DISCARD;
$spam_quarantine_method = 'sql:';
$spam_quarantine_to = 'spam-quarantine';

# Virus
$final_virus_destiny = D_DISCARD;
$virus_quarantine_method = 'sql:';
$virus_quarantine_to     = 'virus-quarantine';

# Banned
$final_banned_destiny = D_DISCARD;
$banned_files_quarantine_method = 'sql:';
$banned_quarantine_to = 'banned-quarantine';

# Bad header.
$final_bad_header_destiny = D_DISCARD;
$bad_header_quarantine_method = 'sql:';
$bad_header_quarantine_to = 'bad-header-quarantine';

#########################
# Quarantine CLEAN mails.
# Don't forget to enable clean quarantine in policy bank 'MYUSERS'.
#
#$clean_quarantine_method = 'sql:';
#$clean_quarantine_to = 'clean-quarantine';

$sql_allow_8bit_address = 1;
$timestamp_fmt_mysql = 1;

# a string to prepend to Subject (for local recipients only) if mail could
# not be decoded or checked entirely, e.g. due to password-protected archives
#$undecipherable_subject_tag = '***UNCHECKED*** ';  # undef disables it
$undecipherable_subject_tag = undef;
# Hope to fix 'nested MAIL command' issue on high load server.
$smtp_connection_cache_enable = 0;

# The default set of header fields to be signed can be controlled
# by setting %signed_header_fields elements to true (to sign) or
# to false (not to sign). Keys must be in lowercase, e.g.:
# 0 -> off
# 1 -> on
$signed_header_fields{'received'} = 0;
$signed_header_fields{'to'} = 1;

# Add dkim_key here.
dkim_key("mymxhost.com", "dkim", "/var/lib/dkim/mymxhost.com.pem");

# Note that signing mail for subdomains with a key of a parent
# domain is treated by recipients as a third-party key, which
# may 'hold less merit' in their eyes. If one has a choice,
# it is better to publish a key for each domain (e.g. host1.a.cn)
# if mail is really coming from it. Sharing a pem file
# for multiple domains may be acceptable, so you don't need
# to generate a different key for each subdomain, but you
# do need to publish it in each subdomain. It is probably
# easier to avoid sending addresses like host1.a.cn and
# always use a parent domain (a.cn) in 'From:', thus
# avoiding the issue altogether.
#dkim_key("host1.mymxhost.com", "dkim", "/var/lib/dkim/mymxhost.com.pem");
#dkim_key("host3.mymxhost.com", "dkim", "/var/lib/dkim/mymxhost.com.pem");

# Add new dkim_key for other domain.
#dkim_key('Your_New_Domain_Name', 'dkim', 'Your_New_Pem_File');

@dkim_signature_options_bysender_maps = ( {
    # ------------------------------------
    # For domain: mymxhost.com.
    # ------------------------------------
    # 'd' defaults to a domain of an author/sender address,
    # 's' defaults to whatever selector is offered by a matching key

    #'postmaster@mymxhost.com'    => { d => "mymxhost.com", a => 'rsa-sha256', ttl =>  7*24*3600 },
    #"spam-reporter@mymxhost.com"    => { d => "mymxhost.com", a => 'rsa-sha256', ttl =>  7*24*3600 },

    # explicit 'd' forces a third-party signature on foreign (hosted) domains
    "mymxhost.com"  => { d => "mymxhost.com", a => 'rsa-sha256', ttl => 10*24*3600 },
    #"host1.mymxhost.com"  => { d => "host1.mymxhost.com", a => 'rsa-sha256', ttl => 10*24*3600 },
    #"host2.mymxhost.com"  => { d => "host2.mymxhost.com", a => 'rsa-sha256', ttl => 10*24*3600 },
    # ---- End domain: mymxhost.com ----

    # catchall defaults
    '.' => { a => 'rsa-sha256', c => 'relaxed/simple', ttl => 30*24*3600 },
} );
# ------------ Disclaimer Setting ---------------
# Uncomment this line to enable singing disclaimer in outgoing mails.
#$defang_maps_by_ccat{+CC_CATCHALL} = [ 'disclaimer' ];

# Program used to signing disclaimer in outgoing mails.
$altermime = '/usr/bin/altermime';

# Disclaimer in plain text formart.
@altermime_args_disclaimer = qw(--disclaimer=/etc/postfix/disclaimer/_OPTION_.txt --disclaimer-html=/etc/postfix/disclaimer/_OPTION_.txt --force-for-bad-html);

@disclaimer_options_bysender_maps = ({
    # Per-domain disclaimer setting: /etc/postfix/disclaimer/host1.iredmail.org.txt
    #'host1.iredmail.org' => 'host1.iredmail.org',

    # Sub-domain disclaimer setting: /etc/postfix/disclaimer/iredmail.org.txt
    #'.iredmail.org'      => 'iredmail.org',

    # Per-user disclaimer setting: /etc/postfix/disclaimer/boss.iredmail.org.txt
    #'boss@iredmail.org'  => 'boss.iredmail.org',

    # Catch-all disclaimer setting: /etc/postfix/disclaimer/default.txt
    '.' => 'default',
},);
# ------------ End Disclaimer Setting ---------------
# Reporting and quarantining.
@storage_sql_dsn = (['DBI:mysql:database=XXXXXXX;host=127.0.0.1;port=XXXXX', ****REMOVED*****]);

# Lookup for per-recipient, per-domain and global policy.
@lookup_sql_dsn = @storage_sql_dsn;
# Don't send email with subject "UNCHECKED contents in mail FROM xxx".
delete $admin_maps_by_ccat{&CC_UNCHECKED};

# Do not notify administrator about SPAM/VIRUS from remote servers.
$virus_admin = undef;
$spam_admin = undef;
$banned_admin = undef;
$bad_header_admin = undef;

# Num of pre-forked children.
# WARNING: it must match (equal to or larger than) the number set in
# /etc/postfix/master.cf "maxproc" column for the 'smtp-amavis' service.
$max_servers = 1;

# Enable DKIM signing/verification
$enable_dkim_verification = 1;
#$enable_dkim_signing = 1;     # we have dkim signing enabled in policy banks.

# Amavisd log level. Verbosity: 0, 1, 2, 3, 4, 5, -d.
$log_level = 0;
# SpamAssassin debugging (require $log_level). Default if off (0).
$sa_debug = 0;

# Amavisd on some Linux/BSD distribution use $banned_namepath_re instead of
# $banned_filename_re, so we define some blocked file types here.
#
# Sample input for $banned_namepath_re:
#
#   P=p003\tL=1\tM=multipart/mixed\nP=p002\tL=1/2\tM=application/octet-stream\tT=dat\tN=my_docum.zip
#   P=p003,L=1,M=multipart/mixed | P=p002,L=1/2,M=application/zip,T=zip,N=FedEx_00628727.zip | P=p005,L=1/2/2,T=asc,N=FedEx_00628727.doc.wsf
#
# What it means:
#   - T: type. e.g. zip archive.
#   - M: MIME type. e.g. application/octet-stream.
#   - N: suggested (MIME) name. e.g. my_docum.zip.

$banned_namepath_re = new_RE(
    #[qr'T=(rar|arc|arj|zoo|gz|bz2)(,|\t)'xmi => 'DISCARD'],     # Compressed file types
    [qr'T=x-(msdownload|msdos-program|msmetafile)(,|\t)'xmi => 'DISCARD'],
    [qr'T=(hta)(,|\t)'xmi => 'DISCARD'],

    # Dangerous mime types
    [qr'T=(9|386|LeChiffre|aaa|abc|aepl|ani|aru|atm|aut|b64|bat|bhx|bin|bkd|blf|bll|bmw|boo|bps|bqf|breaking_bad|buk|bup|bxz|cc|ccc|ce0|ceo|cfxxe|chm|cih|cla|class|cmd|com|cpl|crinf|crjoker|crypt|cryptolocker|cryptowall|ctbl|cxq|cyw|dbd|delf|dev|dlb|dli|dll|dllx|dom|drv|dx|dxz|dyv|dyz|ecc|exe|exe-ms|exe1|exe_renamed|exx|ezt|ezz|fag|fjl|fnr|fuj|good|gzquar|hlp|hlw|hqx|hsq|hts|iva|iws|jar|js|kcd|keybtc@inbox_com|let|lik|lkh|lnk|locky|lok|lol!|lpaq5|magic|mfu|micro|mim|mjg|mjz|nls|oar|ocx|osa|ozd|pcx|pgm|php2|php3|pid|pif|plc|pr|pzdc|qit|qrn|r5a|rhk|rna|rsc_tmp|s7p|scr|shs|ska|smm|smtmp|sop|spam|ssy|swf|sys|tko|tps|tsa|tti|ttt|txs|upa|uu|uue|uzy|vb|vba|vbe|vbs|vbx|vexe|vxd|vzr|wlpginstall|ws|wsc|wsf|wsh|wss|xdu|xir|xlm|xlv|xnt|xnxx|xtbl|xxe|xxx|xyz|zix|zvz|zzz)(,|\t)'xmi => 'DISCARD'],

    # Dangerous file name extensions
    [qr'N=.*\.(9|386|LeChiffre|aaa|abc|aepl|ani|aru|atm|aut|b64|bat|bhx|bin|bkd|blf|bll|bmw|boo|bps|bqf|breaking_bad|buk|bup|bxz|cc|ccc|ce0|ceo|cfxxe|chm|cih|cla|class|cmd|com|cpl|crinf|crjoker|crypt|cryptolocker|cryptowall|ctbl|cxq|cyw|dbd|delf|dev|dlb|dli|dll|dllx|dom|drv|dx|dxz|dyv|dyz|ecc|exe|exe-ms|exe1|exe_renamed|exx|ezt|ezz|fag|fjl|fnr|fuj|good|gzquar|hlp|hlw|hqx|hsq|hts|iva|iws|jar|js|kcd|keybtc@inbox_com|let|lik|lkh|lnk|locky|lok|lol!|lpaq5|magic|mfu|micro|mim|mjg|mjz|nls|oar|ocx|osa|ozd|pcx|pgm|php2|php3|pid|pif|plc|pr|pzdc|qit|qrn|r5a|rhk|rna|rsc_tmp|s7p|scr|shs|ska|smm|smtmp|sop|spam|ssy|swf|sys|tko|tps|tsa|tti|ttt|txs|upa|uu|uue|uzy|vb|vba|vbe|vbs|vbx|vexe|vxd|vzr|wlpginstall|ws|wsc|wsf|wsh|wss|xdu|xir|xlm|xlv|xnt|xnxx|xtbl|xxe|xxx|xyz|zix|zvz|zzz)$'xmi => 'DISCARD'],
);
# $bounce_killer_score defaults to 100, it will cause quota exceed notification
# email sent by Dovecot quarantined by Amavisd.
$penpals_bonus_score = undef;
$bounce_killer_score = 0;

# Selectively disable some of the header checks
#
# Duplicate or multiple occurrence of a header field
$allowed_header_tests{'multiple'} = 0;

# Missing some headers. e.g. 'Date:'
$allowed_header_tests{'missing'} = 0;

# Listen on specified addresses.
$inet_socket_bind = ['127.0.0.1'];

# Set ACL
@inet_acl = qw(127.0.0.1 [::1]);

1;  # insure a defined return

9

Re: [SOLVED] Regarding disabling anti virus clamav

ZhangHuangbin wrote:

During my testing, i just removed '#' for those "bypass_XX_checks_maps", restart Amavisd, then the X-Virus-Scanned header is gone.

Do you have these "bypass_XX_checks_maps" in "$policy_bank{'MYNETS'}"? Try to disable them in MYNETS too.

I have posted the entire file and I have removed the # in all appropriate locations but still the anti virus header appears in all incoming emails.

10

Re: [SOLVED] Regarding disabling anti virus clamav

Try to add lines below inside the "$policy_bank{'MYNETS'} = {}" block:

    # don't perform spam/virus/header check.
    bypass_spam_checks_maps => [1],    # ORIGINATING spam
    bypass_header_checks_maps => [1],  # ORIGINATING bad-header
    bypass_virus_checks_maps => [1],   # ORIGINATING virus
    bypass_banned_checks_maps => [1],  # ORIGINATING banned file types

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

11

Re: [SOLVED] Regarding disabling anti virus clamav

ZhangHuangbin wrote:

Try to add lines below inside the "$policy_bank{'MYNETS'} = {}" block:

    # don't perform spam/virus/header check.
    bypass_spam_checks_maps => [1],    # ORIGINATING spam
    bypass_header_checks_maps => [1],  # ORIGINATING bad-header
    bypass_virus_checks_maps => [1],   # ORIGINATING virus
    bypass_banned_checks_maps => [1],  # ORIGINATING banned file types

I added the lines and restarted the services but I see no changes and in fact I see more headers now

X-Virus-Scanned: Debian amavisd-new at mymxhost
X-Spam-Flag: NO
X-Spam-Score: 2.181
X-Spam-Level: **
X-Spam-Status: No, score=2.181 tagged_above=2 required=6.31
    tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
    HTML_IMAGE_RATIO_04=0.61, HTML_MESSAGE=0.001, LONG_HEX_URI=2.29,
    LONG_IMG_URI=0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01,
    RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001]
    autolearn=no autolearn_force=no

12

Re: [SOLVED] Regarding disabling anti virus clamav

Check SQL table "amavisd.policy", you should have one record for global spam policy with column "policy_name='@.'". Try to update column "bypass_spam_checks", "bypass_virus_checks" to 'Y'.

Note: with "lookup_sql_dsn" setting enabled in amavisd config file, settings stored in SQL db will be used instead of config file.

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

13

Re: [SOLVED] Regarding disabling anti virus clamav

ZhangHuangbin wrote:

Check SQL table "amavisd.policy", you should have one record for global spam policy with column "policy_name='@.'". Try to update column "bypass_spam_checks", "bypass_virus_checks" to 'Y'.

Note: with "lookup_sql_dsn" setting enabled in amavisd config file, settings stored in SQL db will be used instead of config file.

Works fantastically. Thanks for your help. I really appreciate it.