Trouble adding custom header X-Spam-Flag:

SpecialK

New Member
Jul 21, 2009
1
0
1
Hello,

I am evaluating Proxmox Mail Gateway and need to be able to add a custom header to all emails before I can use it and purchase a subscription.
I am trying to customize the SPAM headers and not having any luck.
I have searched the forums and tried what I found but I can not get it to work.

I need to have the header X-Spam-Flag: added to all emails.
ie X-Spam-Flag: Yes or X-Spam-Flag: No

I have tried modifying the modify header under Mail Filter->Action Objects
I have also tried adding custom lines to Spamassassin custom.cf file:
add_header all Flag _YESNOCAPS_
add_header all Status _YESNO_, score=_SCORE__ required=_REQD_ tests=_TESTS_ autolearn=_AUTOLEARN_ version=_VERSION_
add_header all Level _STARS(*)_
add_header all Checker-Version SpamAssassin _VERSION_ (_SUBVERSION_) on _HOSTNAME_


Any help would be appreciated.
 
Last edited:
I need to have the header X-Spam-Flag: added to all emails.
ie X-Spam-Flag: Yes or X-Spam-Flag: No
You could try the following:
* Create a new Action Object which adds/modifies the header:
* GUI -> Mail Filter -> Action Objects -> Add -> Header Attribute
* use :'X-Spam-Flag' as Field and 'Yes' as Value
* Create a new rule in the Mail Filter
* Select a What Object with 'Spam (Level X)' (where X is the level (SpamAssassin score) from which on you want to add that header (e.g. Spam (Level 5) would add the header to all mails with a score > 5.0))
* Select the created new Action Object as Action.
* Select the appropriate other action (probably Accept) as second action.

This is the first part (adding X-Spam-Info: yes to all spam mails)
The second part (adding X-Spam-Info: no to all other mails) can be done by adding another Action Object (same field, but No as value) and creating a rule without What Object and the new Action, and placing it at a lower priority

I hope this helps!
 
Enjoying the topic.

I want to create an action to add "-2" to the domains I trust.

The idea is before accepting / blocking that he assigns a score of -2 to certain domains listed in a "Who Objects" list I created.

And only after he passes the scan and virus, spam ...

I did it that way, but it's not working.

Field: X-SPAM-LEVEL
Value: -2

What is the correct way to put in Field and Value?
 
Enjoying the topic.

I want to create an action to add "-2" to the domains I trust.

The idea is before accepting / blocking that he assigns a score of -2 to certain domains listed in a "Who Objects" list I created.

And only after he passes the scan and virus, spam ...

I did it that way, but it's not working.



What is the correct way to put in Field and Value?

Use spamassassin custom rules.

https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#_custom_spamassassin_configuration
https://cwiki.apache.org/confluence/display/spamassassin/WritingRules
https://forums.cpanel.net/threads/spamassassin-custom-rule-cpanel-68.622787/
http://spamassassin.1065346.n5.nabble.com/Weighting-a-particular-domain-td58034.html
 
I have seen and read these sites.



But I want to do this directly from the GUI, I don't want to manually configure via shell ...



I tried X-SPAM-SCORE, X-SPAM-LEVEL, but it doesn't seem to read ....
 
Last edited:
But being possible to change the header of the message when it arrives. Couldn't he also change the Score?
 
You can try create a spam filter rules with a what object (change header attribute) and who object (domains name/list).
Test it out yourself.
If you require the new function in PMG, you can request the function/enhancement in the proxmox bugzilla.
 
Thanks for the answer, but that's exactly what I'm trying to, but PMG can't identify the header to give a negative score, or I'm using the wrong string.
 

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!