1

Topic: Spamassassin not working? General documentation missing...

First, a big thank you to Zhang, and everyone else working on this.  This is a great project!

I just installed on Debian without a glitch, however, I do have one suggestion.  Please provide some quick howto to activate some functionality that is built in, but "hidden" in some configuration files.  It took me a good half hour to figure out where and how to get the disclaimer text to work...

Also, and more serious, The spam/virus scanner does not appear to work as it should.  I do get a "X-Virus-Scanned" header on mail that leaves the network (good), but not on incoming (very bad), or internal emails (would be nice as well).  And any spam headers are completely missing.  I fear that spamassassin is completely bypassed or ignored somehow....  Where do I enable those?

Thanks, and please keep up this awesome project!

Peter

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Spamassassin not working? General documentation missing...

hmm, currently it's lack of admin doc, maybe i should setup a mediawiki/dokuwiki for users who like to contribute.

I will reply more details after i tested your questions later.

3

Re: Spamassassin not working? General documentation missing...

Caliban wrote:

It took me a good half hour to figure out where and how to get the disclaimer text to work...

You can find below lines in /etc/amavisd.conf (RHEL/CentOS) or /etc/amavis/conf.d/50-user (Debian/Ubuntu):

# ------------ Disclaimer Setting ---------------
# Uncomment this line to enable singing disclaimer in outgoing mails.
#$defang_maps_by_ccat{+CC_CATCHALL} = [ 'disclaimer' ];

As it said, uncomment the line and restart amavis/amavisd service, then you get it.

Don't forget to read '@disclaimer_options_bysender_maps' in /etc/amavisd.conf or /etc/amavis/conf.d/50-user for disclaimer content settings.

The spam/virus scanner does not appear to work as it should.  I do get a "X-Virus-Scanned" header on mail that leaves the network (good), but not on incoming (very bad), or internal emails (would be nice as well).  And any spam headers are completely missing.  I fear that spamassassin is completely bypassed or ignored somehow....  Where do I enable those?

I believe it works as expected.

Try to confirm it's working as expected like this:
- Decrease  sa_tag_level_deflt, so that amavisd will insert mail headers in almost all mails which 'X-Spam-Score' larger than it:

$sa_tag_level_deflt  = -100;  # add spam info headers if at, or above that level

- Restart amavis/amavisd service and send mail to test it. You will find the headers like this:

X-Virus-Scanned: amavisd-new at r6.iredmail.org
X-Spam-Flag: NO
X-Spam-Score: -1.795
X-Spam-Level: 
X-Spam-Status: No, score=-1.795 tagged_above=-100 required=6.2
    tests=[ALL_TRUSTED=-10, DATE_IN_FUTURE_96_XX=3.899,
    NO_DNS_FOR_FROM=1.407, TVD_SPACE_RATIO=2.899] autolearn=no

4

Re: Spamassassin not working? General documentation missing...

I am almost ashamed to admit it, but you are correct. It works like a dream with that extra setting.  I knew it had to be something simple!

And thank you for setting up the wiki!  That's an excellent way to get admin docs out there.  Maybe worthy of a link in the main menu, right next to "Documents"?

Not only is this a great project, but you also provide superb support!

Thanks again!

5

Re: Spamassassin not working? General documentation missing...

Hello. I tried iRedOS and IRedMail (5.0 with the small update 5.01). LDAP installation.

I can't see disclaimer and spamassassin result why ?

I can see spamassassin response in quarantined emails only.

Like this:
Return-Path: <>
Delivered-To: bad-header-quarantine
X-Envelope-From: <hemorrhagenow173@dxxxxx.com>
X-Envelope-To: <yyyy@xxxx.com>
X-Envelope-To-Blocked: <yyyy@xxxx.com>
X-Quarantine-ID: <90FdbuaIhzAV>
X-Amavis-Alert: BAD HEADER SECTION MIME error: error: part did not end with
    expected boundary
X-Spam-Flag: YES
X-Spam-Score: 6.301
X-Spam-Level: ******
X-Spam-Status: Yes, score=6.301 tag=2 tag2=6.2 kill=6.9
    tests=[RCVD_IN_BL_SPAMCOP_NET=2.188, RCVD_IN_SORBS_WEB=1.117,
    RCVD_IN_XBL=2.896, RDNS_NONE=0.1] autolearn=no

6

Re: Spamassassin not working? General documentation missing...

Sabbiolina wrote:

I can't see disclaimer and spamassassin result why ?

What did you do?

7

Re: Spamassassin not working? General documentation missing...

ZhangHuangbin wrote:
Sabbiolina wrote:

I can't see disclaimer and spamassassin result why ?

What did you do?

I followed the instructions of previous posts.

But in clear mail I can't see spamassasins headers

8

Re: Spamassassin not working? General documentation missing...

i wrote a new FAQ about how to enable signning disclaimer, please visit:
http://www.iredmail.org/faq.html

9

Re: Spamassassin not working? General documentation missing...

ZhangHuangbin wrote:

i wrote a new FAQ about how to enable signning disclaimer, please visit:
http://www.iredmail.org/faq.html

I make changes:

$sa_tag_level_deflt  = -1000; # test
$defang_maps_by_ccat{+CC_CATCHALL} = [ 'disclaimer' ];

altermime --> installed

>Aug 31 15:01:53 iredos amavis[3091]: Found $altermime       at /usr/bin/altermime

debug for a message:
Aug 31 15:02:43 iredos amavis[3094]: (03094-01) spam_scan: score=1.62 autolearn=no tests=[AWL=0.148,DCC_CHECK=1.37,HTML_MESSAGE=0.001,MIME_HTML_MOSTLY=0.001,RDNS_NONE=0.1]

[...]
Aug 31 15:02:43 iredos amavis[3094]: (03094-01) headers CLUSTERING: NEW CLUSTER <info@yyyyyy.com>: score=1.62, tag=1, tag2=0, local=0, bl=, s=, mangle=
Aug 31 15:02:43 iredos amavis[3094]: (03094-01) header: X-Virus-Scanned: amavisd-new at mail.yyyyyy.com\n
Aug 31 15:02:43 iredos amavis[3094]: (03094-01) header: Received: from localhost.localdomain ([127.0.0.1])\n\tby localhost (iredos.iredmail.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 4tfRz4deTGLj for <info@yyyyyy.com>;\n\tMon, 31 Aug 2009 15:02:42 -0100 (GMT+1)\n
Aug 31 15:02:43 iredos amavis[3094]: (03094-01) headers CLUSTERING: done all 1 recips in one go


resulting header:
Return-Path: <io@zzzzzzz.com>
Delivered-To: info@yyyyyy.com
Received: from localhost (localhost.localdomain [127.0.0.1])
    by localhost.localdomain (iRedMail) with ESMTP id 7B488B0502
    for <info@yyyyyy.com>; Mon, 31 Aug 2009 15:08:18 -0100 (GMT+1)
X-Virus-Scanned: amavisd-new at mail.yyyyyy.com
Received: from localhost.localdomain ([127.0.0.1])
    by localhost (iredos.iredmail.org [127.0.0.1]) (amavisd-new, port 10024)
    with ESMTP id xAs8ytZ1XcRH for <info@yyyyyy.com>;
    Mon, 31 Aug 2009 15:08:17 -0100 (GMT+1)
X-Original-Helo: smtpi3.ngi.it (iRedMail: http://code.google.com/p/iredmail/)
Received: from smtpi3.xxxx.xx (unknown [...])
    by localhost.localdomain (iRedMail) with ESMTP id 67DCBB0500
    for <info@yyyyyy.com>; Mon, 31 Aug 2009 15:08:17 -0100 (GMT+1)
Received: from xxx003 (...)
    by smtpi3.ngi.it (Postfix) with ESMTP id B9B49318284
    for <info@yyyyyy.com>; Mon, 31 Aug 2009 15:07:20 +0200 (CEST)
From:  <io@zzzzzzz.com>
To: "'Info account'" <info@yyyyyy.com>
Subject: ciao 4
Date: Mon, 31 Aug 2009 15:07:32 +0200
Message-ID: <004101ca2a3c$007da8c0$0178fa40$@com>
MIME-Version: 1.0
Content-Type: multipart/alternative;    boundary="----=_NextPart_000_0042_01CA2A4C.C40678C0"
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: AcoqOsGruvi2wLTcRoWnR/suGOatCA==
Content-Language: it

10

Re: Spamassassin not working? General documentation missing...

you only posted mail header, right? But disclaimer text is displayed as part of mail body.

11

Re: Spamassassin not working? General documentation missing...

No disclaimer (less important)
No tag of spamassassin in header.

12

Re: Spamassassin not working? General documentation missing...

What's the value of '@local_domains_maps' in /etc/amavisd.conf (RHEL/CentOS) or /etc/amavis/conf.d/50-user (Debian/Ubuntu)?

13 (edited by Sabbiolina 2009-08-31 23:37:45)

Re: Spamassassin not working? General documentation missing...

$mydomain = "mail.xxx.com";
@local_domains_maps = ( [".$mydomain","iredmail.org"] );

the same result is obtained for both the internal and external mail.

14

Re: Spamassassin not working? General documentation missing...

Don't use 'iredmail.org' for testing...

Amavisd inserts mail header when:
- domain name is listed in @local_domains_maps.
- spam score is higher than $sa_tag_level_deflt

15

Re: Spamassassin not working? General documentation missing...

ZhangHuangbin wrote:

Don't use 'iredmail.org' for testing...

Amavisd inserts mail header when:
- domain name is listed in @local_domains_maps.
- spam score is higher than $sa_tag_level_deflt

OKKKKKKKKKKKKK

Works, but in a multidomain configuration I must add all domain manually ?

16

Re: Spamassassin not working? General documentation missing...

Sabbiolina wrote:

Works, but in a multidomain configuration I must add all domain manually ?

YES.

17

Re: Spamassassin not working? General documentation missing...

I know - old thread, but:

Is there any way to get around that? I mean what's the idea behind having iRedAdmin or postfixAdmin for adding new domains, if I still need to edit config files and restart services?

Are there any other files I need to update when I add new domains?

18

Re: Spamassassin not working? General documentation missing...

Ok, so after googling a little bit, seems like I found a solution for this problem.
There is a possibility to make amavis check the database for the list of local domains.
This works by adding $sql_select_policy and @lookup_sql_dsn with the DB connection info.

Possibly this would be a good change for 0.6.0.
The following changes have been done by myself:

@local_domains_maps commented out, select added.
Please be aware, that my current query assumes all of my domains beeing local. It would be an option to extend the SQL schema to have a real "local" flag per domain.

#@local_domains_maps = ( [".$mydomain","mail.mydomain.de"] );  # list of all local domains
$sql_select_policy = 'SELECT "Y" AS local FROM domain WHERE CONCAT("@", domain) IN (%k)';

Second required change was to add DSN information for DB to amavis

@lookup_sql_dsn = ( ['DBI:mysql:database=vmail;host=127.0.0.1;port=3306', 'vmail', 'your password comes here'] );
# @lookup_sql_dsn =
#   ( ['DBI:mysql:database=mail;host=127.0.0.1;port=3306', 'user1', 'passwd1'],
#     ['DBI:mysql:database=mail;host=host2', 'username2', 'password2'],
#     ["DBI:SQLite:dbname=$MYHOME/sql/mail_prefs.sqlite", '', ''] );

Hopefully this helps others.
This was very critical to myself, as I have other ppl having access to postfixAdmin but not to the physical machine.
This way they are able to add new domains with spam filtering activated.

Regards,
Phil

19

Re: Spamassassin not working? General documentation missing...

Already implemented this in LDAP, with 'amavisLocal=True'.

20

Re: Spamassassin not working? General documentation missing...

@ White :

THANK YOU,
this is an improvement I was looking for too (and banging my head bcoz customers were getting SPAM emails on hosted virtual domains).

It seems It's working (headers in emails now have X-SPAM flags), I just need to let Spamassassin learn new spam tags as time goes by (and hopefully block the sh-t out) ...

21 (edited by maltamirano 2011-09-07 11:49:27)

Re: Spamassassin not working? General documentation missing...

ZhangHuangbin wrote:

Already implemented this in LDAP, with 'amavisLocal=True'.

Hi!
Is this feature available in MySQL?

Regards.

22

Re: Spamassassin not working? General documentation missing...

maltamirano wrote:
ZhangHuangbin wrote:

Already implemented this in LDAP, with 'amavisLocal=True'.

Hi!
Is this feature available in MySQL?

No, sorry.