1

Topic: Cluebringer and Amavisd/Spamassassin

==== Required information ====
- iRedMail version: 0.8.5
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): PGSQL
- Linux/BSD distribution name and version: Debian 7
- Related log if you're reporting an issue:
====

I have been experimenting with the Cluebringer administration interface (the one at https://<server>/cluebringer). I'm not a big fan of greylisting, and when I changed "Disable" to "Yes," greylisting stopped. So that part works.

I'm now creating policies for Amavisd. I've made no changes to the included rule that links to the Default policy. I created a new rule linked to the Default Inbound policy. In this rule I placed my preferred values for Tag2 Level, Tag3 Level, Tag2 Subject, and Tag3 Subject. I set "Disabled" to "No."

However, my changes appear to have no effect. Even after restarting the Cluebringer and Postfix services, spam is still getting tagged and labeled as per the defaults contained in /etc/amavisd/conf.d/20-debian_defaults. Is there some other configuration step that I've missed?

----

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

2

Re: Cluebringer and Amavisd/Spamassassin

Cluebringer ships a patch for this optional Amavisd support, that means you have to patch your Amavisd first.
Reference: http://devlabs.linuxassist.net/projects … ry/INSTALL (Search "amavisd" in this file)

3

Re: Cluebringer and Amavisd/Spamassassin

ZhangHuangbin wrote:

Cluebringer ships a patch for this optional Amavisd support, that means you have to patch your Amavisd first.
Reference: http://devlabs.linuxassist.net/projects … ry/INSTALL (Search "amavisd" in this file)

I have been fighting with spam ever since the introduction of cluebringer in debian. You're saying that even though it's presented as being properly deployed, the cluebringer admin UI is totally useless unless I perform this patch?

4

Re: Cluebringer and Amavisd/Spamassassin

brandon wrote:

the cluebringer admin UI is totally useless unless I perform this patch?

This patch is required if you want to use Amavisd integration support in Cluebringer, other features don't require this patch.

5

Re: Cluebringer and Amavisd/Spamassassin

The version of amavisd-new included in Debian 7.1 is 2.7.1. As there was no specific patch file for that version, I manually made the changes in /usr/sbin/amavisd-new, then restarted services. Now I just have to wait for some spam to see whether the patch works.

6

Re: Cluebringer and Amavisd/Spamassassin

steveriley wrote:

Now I just have to wait for some spam to see whether the patch works.

You can test with sample spam shipped by SpamAssassin:

# dpkg -L spamassassin | grep -i sample-spam
/usr/share/doc/spamassassin/examples/sample-spam.txt

Now compose a new mail and paste the file content as mail body, send to your mail account. It will be marked as spam.

7

Re: Cluebringer and Amavisd/Spamassassin

Well, I don't think it's working. I emailed myself the spam, and the result was a message that still had the default ***SPAM*** subject addition and the Debian "required=6.31" in the X-Spam-Status header. What else should I check?

8

Re: Cluebringer and Amavisd/Spamassassin

Can we return to this, please? There's still something not right. Here are the instructions from Policyd to make this work:

* Optional Amavisd Supprt ***

8. Copy your amavisd from /usr/sbin/amavisd and patch it with contrib/amavisd-new-2.5.3_policyd-200802070918.patch like this...

$ patch < contrib/amavisd-new-2.5.3_policyd-200802070918.patch

After this change your initscripts to start the patched amavisd.

9. Copy amavisd-policyd.pm where you see fit, and add this configuration line to your amavisd.conf file...

include_config_files('/path/to/amavisd-policyd.pm');

10. Edit the top of amavisd-policyd.pm and change ...

use lib('/root/cluebringer-trunk');  # to point to the directory which contains cbp/

my $DB_dsn = "DBI:mysql:database=policyd;host=localhost";  # to point to your MySQL DB

Originally, I thought I only needed to do step 8, which I did as I described in my earlier post #5. Later, I realized that I needed to do steps 9 and 10 as well.

Step 9 left me a little confused at first -- where is this amavisd-policyd.pm file, I wondered? Then I realized that I needed to download it from http://devlabs.linuxassist.net/projects … olicyd.pm.

Not really being sure what "where you see fit" ought to be, I searched for the locations of other .pm files related to Cluebringer. On Debian 7, these are located in /usr/lib/postfix-cluebringer/cbp/. So I placed the file here.

However, step 9 is still confusing -- on Debian, there is no single amavisd.conf file. Instead, there are several files located in /usr/amavis/conf.d. It would appear that iRedMail creates the file 50-user. However, there's a warning at the top that says "Do not modify anything below this line."

How do I finish step 9 properly?

The first requirement in step 10 is reasonably self-explanatory. Because the only cbp/ on the system is /usr/lib/postfix-cluebringer/cbp/, the line I added is:

use lib('/usr/lib/postfix-cluebringer/');

The second requirement in step 10 assumes the system is running MySQL. I'm using PostgreSQL. Therefore, I added the following line:

my $DB_dsn = "DBI:Pg:host=127.0.0.1;database=cluebringer;user=cluebringer;password=...";

I am still not seeing my custom spam rules in effect. It's probably because I can't figure out how to complete step 9 properly, and because I'm uncertain whether my DB_dsn in step 10 is correct (I have included the password; is that necessary?).

Some additional advice would be much appreciated. Thanks.

9

Re: Cluebringer and Amavisd/Spamassassin

About step 9: you can add it 50-user.
About step 10: You're right.

If you're still confused, it's better to ask author in Policyd mailing list.

10

Re: Cluebringer and Amavisd/Spamassassin

I think this amavisd-policyd integration is brittle.

After properly completing steps 9 and 10, restarting amavisd-new results in the following error:

Starting amavisd: Error in config file "/etc/amavis/conf.d/50-user": Error in config file "/usr/lib/postfix-cluebringer/cbp/amavisd-policyd.pm": Can't locate awitpt/db/dblayer.pm in @INC (@INC contains: /usr/lib/postfix-cluebringer /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl) at /usr/lib/postfix-cluebringer/cbp/amavisd-policyd.pm line 101.
BEGIN failed--compilation aborted at /usr/lib/postfix-cluebringer/cbp/amavisd-policyd.pm line 101.
(failed).

Policyd 2.1 has changed its Perl libraries for database handling to something called awit-perl-toolkit. Debian is still using the 2.0 branch of Policyd. I switched to an older version of amavisd-policyd.pm that looked for dblayer.pm in the cbp subdirectory, because that's where it is on my system. Now the Amavisd service started without error.

Then when I sent the test spam file to myself, Amavis barfed the follwing in the syslog:

(!!)policyd/process_policyd: Failed to query amavis: cbp::dblayer::DBSelect(107): Error executing select: execute called with an unbound placeholder

Grrrr. I don't know jack about how to debug broken SQL. So I guess I'll just give up on this.

11

Re: Cluebringer and Amavisd/Spamassassin

It's better to report this issue in Policyd mailing list, so that developers can fix it in next release.

12

Re: Cluebringer and Amavisd/Spamassassin

You're right... I have one other thing to try. It's possible to pull the awit-perl-toolkit stuff from Policyd's Git repo for the branch included in Debian. It's worth a shot doing that first.