1 (edited by rafaelr 2015-12-09 01:39:59)

Topic: Issues with spam_subject_tag3 [SPAM]

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.2
- Linux/BSD distribution name and version: Ubuntu 14.04 LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  MySQL
- Web server (Apache or Nginx): Both
- Manage mail accounts with iRedAdmin-Pro? Yes
- Related log if you're reporting an issue:
====

Hello,

I can't figure out how to disable the [SPAM] tag for spam marked messages. I look at amavis policy database and while spam_subject_tag2 changes accordingly when setting per user setting in iRedAdmin-Pro (Prefix text [SPAM] to the subject of spam) the spam_subject_tag3 never changes and the value remains [SPAM].

I tried manually editing   spam_subject_tag2 and spam_subject_tag3 for a user (both set to NULL) and that did the trick but when I use iRedAdmin-Pro this is what happens:

Enable (Prefix text [SPAM] to the subject of spam) for user in iRedAdmin-Pro

database:
spam_subject_tag2 [SPAM]
spam_subject_tag3 [SPAM]

Disable (Prefix text [SPAM] to the subject of spam) for user in iRedAdmin-Pro

database:
spam_subject_tag2 NULL (blank)
spam_subject_tag3 [SPAM]  <= Value does not get updated.

This is causing all spam flagged emails subject to include the [SPAM] tag and I need to remove it.

Amavis sa_spam_subject_tag is properly set in my configuration:

$sa_spam_subject_tag = undef; 

----

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

2

Re: Issues with spam_subject_tag3 [SPAM]

Dear rafealr,

Sorry about this trouble. Could you please patch below? Tested with my local testing machine, works for me. Let me know whether or not it works for you.

diff -r 8a83612fbca1 libs/amavisd/spampolicy.py
--- a/libs/amavisd/spampolicy.py    Wed Dec 09 00:42:40 2015 +0800
+++ b/libs/amavisd/spampolicy.py    Wed Dec 09 09:09:25 2015 +0800
@@ -113,7 +113,8 @@
         if updates['spam_lover'] == 'N' \
            and updates['bad_header_lover'] is None \
            and updates['spam_quarantine_to'] == 'spam-quarantine' \
-           and updates['spam_tag2_level'] is None:
+           and updates['spam_tag2_level'] is None \
+           and updates['spam_subject_tag2'] is None:
             if session.get('is_global_admin') or session.get('is_normal_admin'):
                 if updates['spam_tag_level'] is None and updates['message_size_limit'] is None:
                     use_default_setting = True
@@ -139,7 +140,7 @@
                 # separately, these two columns don't exist in Amavisd-new-2.6.x.
                 try:
                     extra_updates = {'spam_tag3_level': updates['spam_tag2_level'],
-                                     'spam_subject_tag3': settings.AMAVISD_SPAM_SUBJECT_PREFIX}
+                                     'spam_subject_tag3': updates['spam_subject_tag2']}
 
                     self.lookup_db.update('policy',
                                           vars={'id': policy_id},

3

Re: Issues with spam_subject_tag3 [SPAM]

Zhang, it doesn't work for me.

I stopped iredapd and manually edited /usr/share/apache2/iRedAdmin-Pro-SQL-2.1.3/libs/amavisd/spampolicy.py
(I also edited /usr/share/apache2/iRedAdmin-Pro-MySQL-1.9.2/libs/amavisd/spampolicy.py)

After testing, the spam_subject_tag3 is not removed in database.

4

Re: Issues with spam_subject_tag3 [SPAM]

After modified iRedAdmin-Pro file, you should restart Apache or uwsgi (if you're running Nginx) service to reload changed file.

Not "iredapd". it's a separated software.

5

Re: Issues with spam_subject_tag3 [SPAM]

You're absolutely right. I forgot to restart uwsgi. Looked at the database and spam_subject_tag3 is now getting updated.

Cheers!

6

Re: Issues with spam_subject_tag3 [SPAM]

Thanks for the report and feedback. smile