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 |
+----+-------------+-------------+------------+-----------------+--------------------+------------------+---------------------+--------------------+----------------------+----------------------+---------------------+--------------------+----------------------+-------------------------+--------------------------+---------------------+-----------------------+----------------+-----------------+-----------------+-----------------+-----------------------+------------------------------+----------------------+---------------------+-----------------------+---------------------------+----------------+-----------------+---------------+----------------+-------------+--------------+------------------+------------+------------------+-------------------+-------------------+--------------------+------------------+--------------------+----------------+-------------+-------------+