How to filter out Spam based on "X-Spam-Flag: YES" or "X-Spam-Status: Yes"

325 views
Skip to first unread message

systemun...@gmail.com

unread,
Mar 7, 2017, 3:59:27 AM3/7/17
to MailArchiva
Hello,

how to create an archive rule that matches the the header line "X-Spam-Flag: YES" or "X-Spam-Status: Yes"?

I tried "Flag" -> "contains" -> "X-Spam-Flag: YES", but it didn't work.

Thanks.

jamie

unread,
Mar 7, 2017, 3:41:14 PM3/7/17
to MailArchiva
To do this, you would typically create a custom field as defined at http://help.mailarchiva.com/fielddefinition.

<Field name="spam" type="string" resource="field_label_spam">
        <Use usage="property" param="name="X-Spam-Flag" />
        <Use usage="export" />
        <Use usage="archiverule" />
        <Use usage="contentfilter" />
        <Use usage="stubrule" />
        <Use usage="searchquery" />
        <Use usage="retention" />
        <Use usage="index_tokenized_and_stored" param="name=spam" />
        <Use usage="retention" />
        <Use usage="advancedheaderview" />
        <Use usage="basicheaderview" />
    </Field>

systemun...@gmail.com

unread,
Mar 8, 2017, 3:32:46 AM3/8/17
to MailArchiva
Yes, this is exactly what I found in the documentation and did, but I thought that there is a better way because it must be a very common case to filter out spam based on such flags.
Making a copy of config_category_email.xml with all the original field definitions may be incompatible with further updates.
On each update, we would need to compare and merge the previous and updated config_category_email.xml, right?
Reply all
Reply to author
Forward
0 new messages