Bug 7449 - Promotional mail tagging
Summary: Promotional mail tagging
Status: RESOLVED WONTFIX
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Plugins (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 enhancement
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-29 10:40 UTC by Deepen Dhulla
Modified: 2018-08-28 04:34 UTC (History)
1 user (show)



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description Deepen Dhulla 2017-07-29 10:40:49 UTC
Hello,

Theses Days we receive many Promotional mail , be in form of advertisement, newsletter, mailing list, some bulk marketing mails...etc. 
which irritated many specially in work mailbox. Google's Gmail has got a better algorithm to filter and put it under tab. but to have 
similar feature we need to keep on adding filter on our local email clients. 
To have server side filter with global tagging is now possible with spamassassin with dovecot sieve as filter on server side.

I have created the custom plugin 
https://github.com/deependhulla/promotionsmailtagging
Which I would like to post on https://wiki.apache.org/spamassassin/CustomPlugins
for others to use. (did not find where to submit , so on bug/mailling list)

Also this code & is suggested for default spamassassin plugin.
do let me know how to help.

Deepen Dhulla.
Comment 1 Kevin A. McGrail 2017-07-29 14:27:14 UTC
Hi Dhulla,

Unfortunately, before I can really look at the technical portion of this ticket, we have licensing issues.

You have licensed it under GPL for an Apache project.  Also, we should have an ICLA on file for you to consider the code.

So 1st, change the license to ASF for consideration and 2nd, fill out an ICLA https://www.apache.org/licenses/icla.pdf

Beyond that, if you just want to post on the wiki and not change the license, send a blurb and I will add it.  We certainly promote OSS and your willingness to share code.

Best,
KAM
Comment 2 Karsten Bräckelmann 2017-07-29 17:51:57 UTC
Thanks Deepen for your contribution, much appreciated.

I've had a look at your SA plugin, so here's some quick first comments:

While your documentation is perfectly fine advising to add the configuration to the SA local.cf file, it generally makes sense to keep custom plugin configuration in its own file. That is, just rename add_to_local.cf for example promotional.cf and keep that file in the same directory as local.cf.

Also, loadplugin directives should better be placed in .pre files, which are guaranteed to be processed before any .cf files. (Since you keep all your custom plugin configuration after the loadplugin line, this also works in cf files.)

The most important advice is this:

Your check_for_promotions() eval rule is called for each message, and should never read custom files for configuration. Any per-plugin configuration should be read once only at initialization. Also it is better to use custom SA configuration instead of some ini file.

Looking at your ini file it appears instead of the custom plugin, you could have accomplished the task using a couple non-scoring double underscore sub-rules and a meta rule combining them. The sieve script then should check the X-Spam-Status header for that meta rule's name to identify matching mail.


Regarding editing the wiki: You can do that, but first need to send a brief request to the dev@ list so we can grant edit permissions (see the wiki's frontpage). We've had to restrict self-signup to prevent wiki spam and vandalism, unfortunately.

For now though, my advise would be to first polish up the custom plugin before posting / linking it from the SA wiki.
Comment 3 Kevin A. McGrail 2018-08-28 04:34:13 UTC
Code on GH is licensed GPLv3 and no response from Author to either comment