using spam-bar instead of spam-stars

IEM

Well-Known Member
Sep 4, 2018
69
10
48
48
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
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!