1

Topic: all received mail marked with [SPAM] after iRedMail EE v1.7.0 upgrade

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): EE v1.7.0 (latest)
- Deployed with iRedMail Easy or the downloadable installer? installer
- Linux/BSD distribution name and version: Ubuntu 22.04.5 LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL (MariaDB)
- Web server (Apache or Nginx): nginx
- Manage mail accounts with iRedAdmin-Pro? No (using iRedMail EE)
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

After upgrading to iRedMail EE v1.7.0, *all* received mail is marked with prefix text [SPAM] in subject.

Changing "Mark mail as spam" score *AND* toggling off "Prefix text [SPAM] to the subject of spam", removes the [SPAM] prefix.

Toggling on "Prefix text [SPAM] to the subject of spam" marks again *all* received iswith [SPAM] prefix.

----

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

2

Re: all received mail marked with [SPAM] after iRedMail EE v1.7.0 upgrade

example:

...
X-Virus-Scanned: Debian amavisd-new at ...
X-Spam-Flag: NO
X-Spam-Score: -2.092
X-Spam-Level:
X-Spam-Status: No, score=-2.092 tagged_above=-100 required=3.05
    tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
    DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
    HTML_MESSAGE=0.001, RCVD_IN_DNSWL_BLOCKED=0.001,
    RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001,
    RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001,
    RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
    RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001,
    SPF_PASS=-0.001] autolearn=ham autolearn_force=no
...
Subject: [SPAM] PROVA4
...

3

Re: all received mail marked with [SPAM] after iRedMail EE v1.7.0 upgrade

Glad I'm not the only one... Same issue here.

4

Re: all received mail marked with [SPAM] after iRedMail EE v1.7.0 upgrade

Please run shell command as root user to fix it:

mysql amavisd -e "UPDATE policy SET spam_subject_tag=NULL,spam_subject_tag2=NULL,spam_subject_tag3=NULL;"

5

Re: all received mail marked with [SPAM] after iRedMail EE v1.7.0 upgrade

Thanks, that seems to have fixed it.

6

Re: all received mail marked with [SPAM] after iRedMail EE v1.7.0 upgrade

Sorry, but the shell command is not fixing the issue for me.

Toggling on:

Prefix text [SPAM] to the subject of spam

writes back "[SPAM]" string in the fields spam_subject_tag, spam_subject_tag2 and spam_subject_tag3

running the script sets the fields to NULL, but also disables the functionality that marks mails as SPAM when score is between Mark value and Block/Quarantine value.

Here is contents of policy table after I toggle "Prefix etc..":

MariaDB [amavisd]> select * from policy;
+----+-------------+-------------+------------+-----------------+--------------------+------------------+---------------------+--------------------+----------------------+----------------------+---------------------+--------------------+----------------------+-------------------------+--------------------------+---------------------+-----------------------+----------------+-----------------+-----------------+-----------------+-----------------------+------------------------------+----------------------+---------------------+-----------------------+---------------------------+----------------+-----------------+---------------+----------------+-------------+--------------+------------------+------------+------------------+-------------------+-------------------+--------------------+------------------+--------------------+----------------+-------------+-------------+
| id | policy_name | virus_lover | spam_lover | unchecked_lover | banned_files_lover | bad_header_lover | bypass_virus_checks | bypass_spam_checks | bypass_banned_checks | bypass_header_checks | virus_quarantine_to | spam_quarantine_to | banned_quarantine_to | unchecked_quarantine_to | bad_header_quarantine_to | clean_quarantine_to | archive_quarantine_to | spam_tag_level | spam_tag2_level | spam_tag3_level | spam_kill_level | spam_dsn_cutoff_level | spam_quarantine_cutoff_level | addr_extension_virus | addr_extension_spam | addr_extension_banned | addr_extension_bad_header | warnvirusrecip | warnbannedrecip | warnbadhrecip | newvirus_admin | virus_admin | banned_admin | bad_header_admin | spam_admin | spam_subject_tag | spam_subject_tag2 | spam_subject_tag3 | message_size_limit | banned_rulenames | disclaimer_options | forward_method | sa_userconf | sa_username |
+----+-------------+-------------+------------+-----------------+--------------------+------------------+---------------------+--------------------+----------------------+----------------------+---------------------+--------------------+----------------------+-------------------------+--------------------------+---------------------+-----------------------+----------------+-----------------+-----------------+-----------------+-----------------------+------------------------------+----------------------+---------------------+-----------------------+---------------------------+----------------+-----------------+---------------+----------------+-------------+--------------+------------------+------------+------------------+-------------------+-------------------+--------------------+------------------+--------------------+----------------+-------------+-------------+
|  1 | @.          | N           | N          | NULL            | N                  | N                | N                   | N                  | N                    | N                    | virus-quarantine    | spam-quarantine    | banned-quarantine    | NULL                    | bad-header-quarantine    | NULL                | NULL                  |           -100 |               3 |               3 |               6 |                  NULL |                         NULL | NULL                 | NULL                | NULL                  | NULL                      | NULL           | NULL            | NULL          | NULL           | NULL        | NULL         | NULL             | NULL       | [SPAM]           | [SPAM]            | [SPAM]            |               NULL |                  | NULL               | NULL           | NULL        | NULL        |
+----+-------------+-------------+------------+-----------------+--------------------+------------------+---------------------+--------------------+----------------------+----------------------+---------------------+--------------------+----------------------+-------------------------+--------------------------+---------------------+-----------------------+----------------+-----------------+-----------------+-----------------+-----------------------+------------------------------+----------------------+---------------------+-----------------------+---------------------------+----------------+-----------------+---------------+----------------+-------------+--------------+------------------+------------+------------------+-------------------+-------------------+--------------------+------------------+--------------------+----------------+-------------+-------------+

7

Re: all received mail marked with [SPAM] after iRedMail EE v1.7.0 upgrade

- Please set value of `spam_tag_level` column to NULL for all records in `amavisd.policy`, so that only spams get the `[SPAM]` prefix in subject.
- Or, disable the `Always insert X-Spam-* headers` option in `Server Settings` -> `Spam Policy`, disable same options in domain and user profile pages.