Discussion:
Deleting emails with viruses
Philip
2018-04-21 04:31:09 UTC
Permalink
Hi there,

Do I have to enable clamav to delete emails that are found to have
viruses in them?  Since the last update to 0.10 it's not scanning
incoming emails.  I figured clamav is being triggered by AMAVIS.

Suggestions, Comments...

Phil
Benny Pedersen
2018-04-21 12:47:11 UTC
Permalink
Post by Philip
Do I have to enable clamav to delete emails that are found to have
viruses in them?  Since the last update to 0.10 it's not scanning
incoming emails.  I figured clamav is being triggered by AMAVIS.
Suggestions, Comments...
1: amavisd-milter
2: amavisd-prequeue
3: amavisd-afterqueue

how is your setup ?

i do use clamav-milter to reject virus, eq i do not accept and kill
Computer Bob
2018-04-26 21:30:59 UTC
Permalink
Greetings,
I have an Ubuntu 16.04 server running Postfix, Dovecot, Clamav,
Amavis-new, Spamassassin.
Mails are passing spam checks and the headers do not show Razor and
other settings that are in the spamassassin configs and used by
spamassassin.
If I run the mail through spamassassin as user amavis, spamd, recipient,
or the virtual mail folder owner, I get the following all the same:

X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on (Redacted)
X-Spam-Flag: YES
X-Spam-Level: ********************
X-Spam-Status: Yes, score=20.1 required=4.0 tests=KAM_ASCII_DIVIDERS,
MISSING_DATE,MISSING_FROM,MISSING_HEADERS,MISSING_MID,MISSING_SUBJECT,
NO_HEADERS_MESSAGE,NO_RECEIVED,NO_RELAYS,RAZOR2_CF_RANGE_51_100,RAZOR2_CHECK,
        SHARK_TANK_BODY,URIBL_DBL_SPAM,URIBL_RED,URIBL_SBL_A autolearn=spam
        autolearn_force=no version=3.4.1

Content analysis details:   (20.1 points, 4.0 required)

 pts rule name              description
---- ----------------------
--------------------------------------------------
 2.5 URIBL_DBL_SPAM         Contains a spam URL listed in the Spamhaus DBL
                            blocklist
                            [URIs: nourishingmomsnaturally.com]
 0.0 URIBL_RED              Contains an URL listed in the URIBL redlist
                            [URIs: nourishingmomsnaturally.com]
 1.2 MISSING_HEADERS        Missing To: header
-0.0 NO_RELAYS              Informational: message was not relayed via SMTP
 7.0 SHARK_TANK_BODY        BODY: No description available.
 2.4 RAZOR2_CF_RANGE_51_100 Razor2 gives confidence level above 50%
                            [cf: 100]
 1.7 RAZOR2_CHECK           Listed in Razor2 (http://razor.sf.net/)
 0.1 URIBL_SBL_A            Contains URL's A record listed in the
Spamhaus SBL
                            blocklist
                            [URIs: candybars.nourishingmomsnaturally.com]
-0.0 NO_RECEIVED            Informational: message has no Received headers
 0.1 MISSING_MID            Missing Message-Id: header
 1.8 MISSING_SUBJECT        Missing Subject: header
 0.8 KAM_ASCII_DIVIDERS     Spam that uses ascii formatting tricks
 1.0 MISSING_FROM           Missing From: header
 1.4 MISSING_DATE           Missing Date: header
 0.0 NO_HEADERS_MESSAGE     Message appears to be missing most RFC-822
headers

Yet the mail headers as received are all showing as similar to this:

X-Virus-Scanned: Debian amavisd-new at (Redacted)
X-Spam-Flag: NO
X-Spam-Score: 0.01
X-Spam-Level:
X-Spam-Status: No, score=0.01 required=4 tests=[HTML_MESSAGE=0.001,
        SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_REMOTE_IMAGE=0.01,
        URIBL_RED=0.001] autolearn=unavailable autolearn_force=no

It does not appear that the same checks are being run, for instance no
Razor.

Could someone explain in detail how spamd or spamassassin is being
called vi amavis and the associated configs so I can troubleshoot ?
Dino Edwards
2018-04-27 08:07:23 UTC
Permalink
Amavisd-new does not use spamd. It calls SA directly through perl.

Does your /etc/postfix/master.cf contain an extra smtp listener for amavis to re-inject email back to postfix?:

127.0.0.1:10025 inet n - y - - smtpd
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o mynetworks=127.0.0.0/8
-o strict_rfc821_envelopes=yes

amavis unix - - - - 2 smtp
-o smtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes


Does /etc/postfix/main.cf have a content filter line in order for postfix to inject email to amavis (assuming amavis is listening on port 10026):


content_filter = smtp-amavis:[127.0.0.1]:10026






From: amavis-users [mailto:amavis-users-bounces+dino.edwards=***@amavis.org] On Behalf Of Computer Bob
Sent: Thursday, April 26, 2018 5:31 PM
To: amavis-***@amavis.org
Subject: amavis-new X-Spam-Status question

Greetings,
I have an Ubuntu 16.04 server running Postfix, Dovecot, Clamav, Amavis-new, Spamassassin.
Mails are passing spam checks and the headers do not show Razor and other settings that are in the spamassassin configs and used by spamassassin.
If I run the mail through spamassassin as user amavis, spamd, recipient, or the virtual mail folder owner, I get the following all the same:

X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on (Redacted)
X-Spam-Flag: YES
X-Spam-Level: ********************
X-Spam-Status: Yes, score=20.1 required=4.0 tests=KAM_ASCII_DIVIDERS,
MISSING_DATE,MISSING_FROM,MISSING_HEADERS,MISSING_MID,MISSING_SUBJECT,
NO_HEADERS_MESSAGE,NO_RECEIVED,NO_RELAYS,RAZOR2_CF_RANGE_51_100,RAZOR2_CHECK,
SHARK_TANK_BODY,URIBL_DBL_SPAM,URIBL_RED,URIBL_SBL_A autolearn=spam
autolearn_force=no version=3.4.1

Content analysis details: (20.1 points, 4.0 required)

pts rule name description
---- ---------------------- --------------------------------------------------
2.5 URIBL_DBL_SPAM Contains a spam URL listed in the Spamhaus DBL
blocklist
[URIs: nourishingmomsnaturally.com]
0.0 URIBL_RED Contains an URL listed in the URIBL redlist
[URIs: nourishingmomsnaturally.com]
1.2 MISSING_HEADERS Missing To: header
-0.0 NO_RELAYS Informational: message was not relayed via SMTP
7.0 SHARK_TANK_BODY BODY: No description available.
2.4 RAZOR2_CF_RANGE_51_100 Razor2 gives confidence level above 50%
[cf: 100]
1.7 RAZOR2_CHECK Listed in Razor2 (http://razor.sf.net/)
0.1 URIBL_SBL_A Contains URL's A record listed in the Spamhaus SBL
blocklist
[URIs: candybars.nourishingmomsnaturally.com]
-0.0 NO_RECEIVED Informational: message has no Received headers
0.1 MISSING_MID Missing Message-Id: header
1.8 MISSING_SUBJECT Missing Subject: header
0.8 KAM_ASCII_DIVIDERS Spam that uses ascii formatting tricks
1.0 MISSING_FROM Missing From: header
1.4 MISSING_DATE Missing Date: header
0.0 NO_HEADERS_MESSAGE Message appears to be missing most RFC-822 headers

Yet the mail headers as received are all showing as similar to this:

X-Virus-Scanned: Debian amavisd-new at (Redacted)
X-Spam-Flag: NO
X-Spam-Score: 0.01
X-Spam-Level:
X-Spam-Status: No, score=0.01 required=4 tests=[HTML_MESSAGE=0.001,
SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_REMOTE_IMAGE=0.01,
URIBL_RED=0.001] autolearn=unavailable autolearn_force=no

It does not appear that the same checks are being run, for instance no Razor.

Could someone explain in detail how spamd or spamassassin is being called vi amavis and the associated configs so I can troubleshoot ?
Hugo Manuel Ojendiz Lemus
2018-04-27 12:50:27 UTC
Permalink
Hello computer Bob



You can try for basic troubleshooting with SpamAssassin
<https://www.ijs.si/software/amavisd/#faq-spam>
https://www.ijs.si/software/amavisd/#faq-spam



Also, Amavis doesn't put all the headers in the mail, some you have to
explicitly configure amavis to include them





HugoOjendiz



From: amavis-users
[mailto:amavis-users-bounces+ojendizhm=***@amavis.org] On Behalf Of
Dino Edwards
Sent: viernes, 27 de abril de 2018 03:07 a.m.
To: ***@inter-control.com; amavis-***@amavis.org
Subject: RE: amavis-new X-Spam-Status question



Amavisd-new does not use spamd. It calls SA directly through perl.



Does your /etc/postfix/master.cf contain an extra smtp listener for amavis to
re-inject email back to postfix?:



127.0.0.1:10025 inet n - y - - smtpd

-o content_filter=

-o local_recipient_maps=

-o relay_recipient_maps=

-o smtpd_restriction_classes=

-o smtpd_helo_restrictions=

-o smtpd_sender_restrictions=

-o smtpd_recipient_restrictions=permit_mynetworks,reject

-o mynetworks=127.0.0.0/8

-o strict_rfc821_envelopes=yes



amavis unix - - - - 2 smtp

-o smtp_data_done_timeout=1200

-o smtp_send_xforward_command=yes





Does /etc/postfix/main.cf have a content filter line in order for postfix to
inject email to amavis (assuming amavis is listening on port 10026):



content_filter = smtp-amavis:[127.0.0.1]:10026













From: amavis-users
[mailto:amavis-users-bounces+dino.edwards=***@amavis.org] On
Behalf Of Computer Bob
Sent: Thursday, April 26, 2018 5:31 PM
To: amavis-***@amavis.org <mailto:amavis-***@amavis.org>
Subject: amavis-new X-Spam-Status question



Greetings,
I have an Ubuntu 16.04 server running Postfix, Dovecot, Clamav, Amavis-new,
Spamassassin.
Mails are passing spam checks and the headers do not show Razor and other
settings that are in the spamassassin configs and used by spamassassin.
If I run the mail through spamassassin as user amavis, spamd, recipient, or
the virtual mail folder owner, I get the following all the same:

X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on (Redacted)
X-Spam-Flag: YES
X-Spam-Level: ********************
X-Spam-Status: Yes, score=20.1 required=4.0 tests=KAM_ASCII_DIVIDERS,
MISSING_DATE,MISSING_FROM,MISSING_HEADERS,MISSING_MID,MISSING_SUBJECT,
NO_HEADERS_MESSAGE,NO_RECEIVED,NO_RELAYS,RAZOR2_CF_RANGE_51_100,RAZOR2_CHECK,
SHARK_TANK_BODY,URIBL_DBL_SPAM,URIBL_RED,URIBL_SBL_A autolearn=spam
autolearn_force=no version=3.4.1

Content analysis details: (20.1 points, 4.0 required)

pts rule name description
---- ---------------------- --------------------------------------------------
2.5 URIBL_DBL_SPAM Contains a spam URL listed in the Spamhaus DBL
blocklist
[URIs: nourishingmomsnaturally.com]
0.0 URIBL_RED Contains an URL listed in the URIBL redlist
[URIs: nourishingmomsnaturally.com]
1.2 MISSING_HEADERS Missing To: header
-0.0 NO_RELAYS Informational: message was not relayed via SMTP
7.0 SHARK_TANK_BODY BODY: No description available.
2.4 RAZOR2_CF_RANGE_51_100 Razor2 gives confidence level above 50%
[cf: 100]
1.7 RAZOR2_CHECK Listed in Razor2 (http://razor.sf.net/)
0.1 URIBL_SBL_A Contains URL's A record listed in the Spamhaus SBL
blocklist
[URIs: candybars.nourishingmomsnaturally.com]
-0.0 NO_RECEIVED Informational: message has no Received headers
0.1 MISSING_MID Missing Message-Id: header
1.8 MISSING_SUBJECT Missing Subject: header
0.8 KAM_ASCII_DIVIDERS Spam that uses ascii formatting tricks
1.0 MISSING_FROM Missing From: header
1.4 MISSING_DATE Missing Date: header
0.0 NO_HEADERS_MESSAGE Message appears to be missing most RFC-822 headers

Yet the mail headers as received are all showing as similar to this:

X-Virus-Scanned: Debian amavisd-new at (Redacted)
X-Spam-Flag: NO
X-Spam-Score: 0.01
X-Spam-Level:
X-Spam-Status: No, score=0.01 required=4 tests=[HTML_MESSAGE=0.001,
SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_REMOTE_IMAGE=0.01,
URIBL_RED=0.001] autolearn=unavailable autolearn_force=no

It does not appear that the same checks are being run, for instance no Razor.

Could someone explain in detail how spamd or spamassassin is being called vi
amavis and the associated configs so I can troubleshoot ?
Philip
2018-04-29 07:14:22 UTC
Permalink
Debian 7, Postfix, Dovecot, Amavis-New, SpamAssassan with ClamAV and it
all works nicely.

Outbound emails are virus scanned it's just working out how to get the
inbound emails to be virus scanned.  I've been looking at the
clamav-milter... just need to find a good tutorial that can explain how
it works.  I've figured to run the amavis-milter for incoming emails but
it's not scanning for viruses like it does the outbound email.

Thoughts?
Post by Benny Pedersen
Post by Philip
Do I have to enable clamav to delete emails that are found to have
viruses in them?  Since the last update to 0.10 it's not scanning
incoming emails.  I figured clamav is being triggered by AMAVIS.
Suggestions, Comments...
1: amavisd-milter
2: amavisd-prequeue
3: amavisd-afterqueue
how is your setup ?
i do use clamav-milter to reject virus,  eq i do not accept and kill
André Rodier
2018-04-30 14:27:38 UTC
Permalink
Post by Philip
Debian 7, Postfix, Dovecot, Amavis-New, SpamAssassan with ClamAV and
it all works nicely.
Outbound emails are virus scanned it's just working out how to get the
inbound emails to be virus scanned.  I've been looking at the
clamav-milter... just need to find a good tutorial that can explain
how it works.  I've figured to run the amavis-milter for incoming
emails but it's not scanning for viruses like it does the outbound
email.
Thoughts?
Post by Benny Pedersen
Post by Philip
Do I have to enable clamav to delete emails that are found to have
viruses in them?  Since the last update to 0.10 it's not scanning
incoming emails.  I figured clamav is being triggered by AMAVIS.
Suggestions, Comments...
1: amavisd-milter
2: amavisd-prequeue
3: amavisd-afterqueue
how is your setup ?
i do use clamav-milter to reject virus,  eq i do not accept and kill
Hello Phillip,

I use Debian 9, but clamsmtp. the package is also available on Debian 7.

I was using the milter before, but there is a huge advantage using
clamsmtp: it does not block the SMTP session, mails are filtered after
the accept queue.

You can then drop or bounce them, and put the file in quarantine.

Kind regards,
André

PS: I suggest you to use an up to date distribution.
--
https://github.com/progmaticltd/homebox
Benny Pedersen
2018-04-30 18:19:15 UTC
Permalink
Post by André Rodier
You can then drop or bounce them, and put the file in quarantine.
clamsmtp cant reject, so it cant bounce to real sender, it would be
possible it would go to forged sender, dont do that unless clamsmtp use
used in prequeue mta stage, but since clamsmtp cant reject it would not
work anyway

so all clamsmtp can do is to tag only in prequeue stage, and in mta
stage reject based on results in eq postfix header test

but i think this is more complicated then use clamav-milter where it can
reject or quarantine virus
André Rodier
2018-04-30 19:47:54 UTC
Permalink
Post by Benny Pedersen
Post by André Rodier
You can then drop or bounce them, and put the file in quarantine.
clamsmtp cant reject, so it cant bounce to real sender, it would be
possible it would go to forged sender, dont do that unless clamsmtp
use used in prequeue mta stage, but since clamsmtp cant reject it
would not work anyway
so all clamsmtp can do is to tag only in prequeue stage, and in mta
stage reject based on results in eq postfix header test
but i think this is more complicated then use clamav-milter where it
can reject or quarantine virus
Yes, by default, the clamsmtp documentation recommend to not reject the
messages, and to drop them. I set it up like this.
Post by Benny Pedersen
Postfix supports filtering mail through a filter that acts like an SMTP
server. This is how clamsmtp was designed. Postfix supports
before-queue and after-queue filters. Before-queue filters make a poor
choice for anti-virus scanners so this document will describe the
latter. For more details on why and how this all works, read the above
links on the Postfix site.
Source: http://thewalter.net/stef/software/clamsmtp/postfix.html

Loading...