using spam-bar instead of spam-stars

IEM

Well-Known Member
Sep 4, 2018
71
11
48
49
Austria
traditionally, our (pre-PMG) exim4-mailserver has used spamassassin's `$spam_bar` to indicate the spam-level with `+` signs, e.g.
Code:
X-Spam-Score: +++++++

now PMG uses `__SPAM_STARS__` instead, which is similar in concept, but uses a different characters (`*` instead of `+`), e.g.
Code:
X-Spam-Score: ********
.

In order to not break any filte-rules of my users, I would like to report the score in my old format (with `+`).

How would I do that?

Can I tell PMG to report the spam-score with `+/-` characters, or do I have to do a header-rewrite on my mail-server's side?
 
traditionally, our (pre-PMG) exim4-mailserver has used spamassassin's `$spam_bar` to indicate the spam-level with `+` signs, e.g.
Code:
X-Spam-Score: +++++++

now PMG uses `__SPAM_STARS__` instead, which is similar in concept, but uses a different characters (`*` instead of `+`), e.g.
Code:
X-Spam-Score: ********
.

In order to not break any filte-rules of my users, I would like to report the score in my old format (with `+`).

How would I do that?

Can I tell PMG to report the spam-score with `+/-` characters, or do I have to do a header-rewrite on my mail-server's side?

Add a custom action object that modifies the header and or spam score.

You could also create a global sieve rule that overwrites all customer spam rules.

Search and replace (sed) might also do it.
 
You could also create a global sieve rule that overwrites all customer spam rules.

Search and replace (sed) might also do it.

users can do whatever they want with the spam-bars (some move mails into a spam folder, some drop; at varying levels; others don't do anything) so the global rule isn't really an option.
search-and-replace would only work if we can modified the *source* of the filter-string (which is mostly horde/ingo db, but not necessarily)


Add a custom action object that modifies the header and or spam score.
that sounds promising.
how would i do that? (hopefully pointers to the documentation are enough :))
 
I ended up with rewriting the header-field in the receiving (final) mailserver, replacing * with +.
Something like the following:

- In PMG, add a rule that adds __SPAMSTARS__ to the X-proxmox-Spam-Level header-field.

- in exim, add a data-ACL (acl_check_data, or via CHECK_DATA_LOCAL_ACL_FILE) that looks like:

Code:
accept
    hosts = +gateway_from_hosts
    add_header = X-Spam-Level: ${tr{$header_X-proxmox-Spam-Level:}{*}{+}}
    remove_header = X-proxmox-Spam-Level