Bug 4058 - [review] Feature Request: whitelist_subject and blacklist_subject
Summary: [review] Feature Request: whitelist_subject and blacklist_subject
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamassassin (show other bugs)
Version: 3.0.0
Hardware: Other other
: P5 normal
Target Milestone: 3.1.0
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-01 09:33 UTC by Walter Jeffries
Modified: 2005-06-05 14:17 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 Walter Jeffries 2005-01-01 09:33:53 UTC
whitelist_subject and blacklist_subject would be very handy.
I would envision them working like the whitelist_from and such but operating on the subject line.
In fact, it would be handy to have this operate on all header lines and the body. It would be a simple 
and easy way to make custom rules which is difficult or impossible for many users who don't have 
sufficient access privilages. Using whitelist_subject one could have a subject line password that would 
let in mail. For example:

whitelist_subject *ABCDEF*

would give any incoming mail containing ABCDEF in the subject -100 points making it very likely to get 
through the SpamAssassin not marked as spam. This way one could give out ABCDEF as a password to 
put in the header. This is unlikely to get abused by spammers. I've been doing this for a decade. Adding 
whitelist_subject to SpamAssassin would make this easier.
Comment 1 Michael Parker 2005-01-15 00:19:37 UTC
This is the perfect thing for a plugin to handle and since it seemed like an
interesting problem, I wrote one:

http://wiki.apache.org/spamassassin/WhiteListSubjectPlugin

I suppose we could discuss folding it into the SA source proper, but I don't
know how useful it would be for the masses.
Comment 2 Daryl C. W. O'Shea 2005-01-15 11:47:07 UTC
Just an FYI: the plugin will only work with the current trunk version since
'register_commands' (in Mail::SpamAssassin::Conf::Parser) isn't in 3.0.
Comment 3 Michael Parker 2005-01-15 14:18:16 UTC
Subject: Re:  Feature Request: whitelist_subject and blacklist_subject

Opps, I'll see if I can find some time to fix it so it works with
3.0.2
Comment 4 Walter Jeffries 2005-01-15 16:44:56 UTC
A plugin is great for those who can install them.
Unfortunately I can't due to limits at my sever.
I do think this would be useful for the masses
if they understood they could use it to provide
an email password that a sender could use to
get through the spam filter without having to
add every sender to the whitelist.
Comment 5 Michael Parker 2005-01-15 19:33:24 UTC
I suppose I could put it up for review.

Here are the options:

[ ] Do not include this plugin in the standard dist
[ ] Include this plugin as is in standard dist (possibly backport to 3.0)
[ ] Include this plugin, but also move all of the whitelist/blacklist_* stuff
into the plugin.

Any other thoughts?
Comment 6 Daniel Quinlan 2005-01-15 19:37:42 UTC
Subject: Re:  [review] Feature Request: whitelist_subject and blacklist_subject

Not needed on HEAD since it's C-T-R, but since you ask...
 
> [X] Include this plugin, but also move all of the whitelist/blacklist_* stuff
> into the plugin.

++1

Comment 7 Walter Jeffries 2005-01-15 20:23:35 UTC
[X] Include this plugin as is in standard dist (possibly backport to 3.0)
Comment 8 Theo Van Dinter 2005-01-15 20:40:20 UTC
Subject: Re:  [review] Feature Request: whitelist_subject and blacklist_subject

On Sat, Jan 15, 2005 at 08:23:36PM -0800, bugzilla-daemon@bugzilla.spamassassin.org wrote:
> [X] Include this plugin as is in standard dist (possibly backport to 3.0)

I don't really want to have 17 bajillion plugins in the standard dist.
My POV is something along the lines of:

If it's really useful, put it in the main code.  If it's useful, but
possibly/likely to be disabled by a decent number of people, make it a
standard plugin.  If it's useful for some, but not most/all, just put
it up on the wiki as a plugin people can install themselved.

Comment 9 Daniel Quinlan 2005-01-15 21:04:17 UTC
Subject: Re:  [review] Feature Request: whitelist_subject and blacklist_subject

> If it's really useful, put it in the main code.  If it's useful, but
> possibly/likely to be disabled by a decent number of people, make it a
> standard plugin.  If it's useful for some, but not most/all, just put
> it up on the wiki as a plugin people can install themselved.

Michael mentioned on IRC that the code is very similar to the current
whitelisting code, so it seems like there's a good opportunity to
generalize the code and get it all together.

Also, given that whitelisting rules already have options that form the
core of the rule (like other plugins, but not like your standard header,
body, etc. rules), I think a plugin makes great sense for *this* code.

Daniel

Comment 10 Loren Wilton 2005-01-15 22:31:14 UTC
Subject: Re:  [review] Feature Request: whitelist_subject and blacklist_subject

> I don't really want to have 17 bajillion plugins in the standard dist.
>
> If it's really useful, put it in the main code.  If it's useful, but
> possibly/likely to be disabled by a decent number of people, make it a
> standard plugin.  If it's useful for some, but not most/all, just put
> it up on the wiki as a plugin people can install themselved.

Let me suggest a differrent viewpoint, based on the concept of sites where
there is a central administration (who are the only ones that can install
plugins and enable them, currently) and users that might be able to write
their own overrides and possibly rules (if allow_user_rules is set).  While
this isn't a popular configuration with the developers, there seem to be a
fair number of sites that do work this way.

Even with allow_user_rules, a user can't use plugin functionality if the
plugin isn't there.  In fact, they can't even use the plugin if it is there
and wasn't enabled site-wide, currently.  As more stuff moves to plugins (as
it likely will), this degrades the concept of allow_user_rules, and possibly
even individual user config options, if the plugins haven't been installed
or enabled by the central site administration.

It appears that currently plugins, along with their register_xxx functions,
can do almost anything internal code can do, and possibly do it just about
as efficiently.  It therefore strikes me as likely that a lot if internal
code will probably start getting factored out into plugins just to simplify
the code and make it more readable.  Thus, per-user rules and options are
likely to become less capable with time as more stuff migrates to plugins,
especially if all of the plugins are optional and/or not enabled by default.

Based on that, I would be inclined to include the widest possible number of
plugins in the base release, so that the widest possible number of rules are
potentially available, even on a decentralized site with centralized
infopriests in charge of enabling options.

I would also look at the idea of either having all found plugins enabled by
default, or possibly enabled unless a central disable option was present, or
optionally enable-able by jive users in individual user configs.  (There
might be a central option to allow users to enable plugins.  In fact,
allow_user_rules is already a central option that would fit that purpose.)

So I would be strongly in favor of including the maximum number of
known-working plugins with the base and patch releases.  If the plugin isn't
enabled, nothing is lost but a tiny amount of disk space.

Comment 11 Justin Mason 2005-01-16 17:24:10 UTC
> [X] Include this plugin, but also move all of the whitelist/blacklist_* stuff
> into the plugin.

+1 for me too.  and enable it by default ;)


Loren -- IMO, if any code is moved from the existing code into a plugin, that by
definition needs to be one of the default-enabled plugins for future releases
(unless there's a very good reason otherwise).
Comment 12 Justin Mason 2005-01-16 17:24:33 UTC
> [X] Include this plugin, but also move all of the whitelist/blacklist_* stuff
> into the plugin.

+1 for me too.  and enable it by default ;)


Loren -- IMO, if any code is moved from the existing code into a plugin, that by
definition needs to be one of the default-enabled plugins for future releases
(unless there's a very good reason otherwise).
Comment 13 Daniel Quinlan 2005-04-07 23:28:08 UTC
Setting 3.1.0 milestone -- I'm *NOT* saying we want to do this for 3.1.0, but
I don't want to forget about it before 3.1.0, thanks Bob for pointing out this
bug.

My inclination is to actually defer to 3.2.0 given the late timing.
Comment 14 Michael Parker 2005-04-11 12:14:11 UTC
Well, with my +1 that is three for pulling all of the whitelist code into a plugin.

Theo, would you veto such a change?

Comment 15 Theo Van Dinter 2005-04-11 12:24:58 UTC
Subject: Re:  [review] Feature Request: whitelist_subject and blacklist_subject

On Mon, Apr 11, 2005 at 12:14:12PM -0700, bugzilla-daemon@bugzilla.spamassassin.org wrote:
> Well, with my +1 that is three for pulling all of the whitelist code into a plugin.
> Theo, would you veto such a change?

I think I'm -0.5 or so at the moment.  I don't really see a benefit to moving
the code to a plugin, but if others want to do it I'm not going to stop you.

Comment 16 Matt Kettler 2005-05-03 15:42:18 UTC
Suggestion to improve things.

Really, this bug occurs mostly because there are two algorithms for inferring
trust when private/reserved IPs exist.

1) Trust all reserved IPs, plus first non-reserved. 

2) Trust all reserved IPs, first non-reserved untrusted.


Algorithm 1) works if your outer-most MX has a non-reserved IP, and fails with
over-trust if your outer-most MX is using some kind of static-mapped NAT or
other mechanism that gives it a reserved IP.

Algorithm 2) works if you have a NATed MX, but fails with under-trust if your MX
is not NATed.

Why not add a config option that will control if SA assumes the MX is NATed or
not?  

i.e. trusted_networks_nated_mx  (default disabled)

This would at least make it easy for people to fix, and obvious in the manpage
they might want to consider it. 
Comment 17 Matt Kettler 2005-05-03 15:45:40 UTC
Misdirected comment, Belonged on 4055, not sure how bugzilla put it here.
Comment 18 Michael Parker 2005-06-05 22:17:52 UTC
Added WhiteListSubject plugin in r180222, decided that moving all of the
whitelist stuff was too large a change, it's a possible future improvement, but
not for now.