SA Bugzilla – Bug 478
TO: header modification
Last modified: 2003-12-30 08:31:16 UTC
Don't worry, no new headers... but... Changing the Subject line can be bad when (on the very rare message) SA gets a false positive... if the user hits REPLY, they have to clean up the subject line, or pass along the new subject line back to the sender. I think the least obtrusive place to mark a header that the cripple-ware MS Outlook Express could even filter on would be to TO header. There could be a config variable of what to mark, and that could be appended to the end with () around it, making it a legal and ignored address comment. Something like: rewrite_to 1 to_tag **SPAM** and if a message is spam, the header would change from: To: <baduser@spamsucks.com> into To: <baduser@spamsucks.com> (**SPAM**) This mark would not carry over in a REPLY, but could still be found during OE so-called filtering... I know, trival and if I find time, perhaps I will *attempt* a patch and send it in, we'll see who gets to it first ;) Thanks for an awesome product!
I really like that I idea , so here's a patch (against the current CVS) to implement a function like this. It replaces the options 'rewrite_subject' and 'subject_tag' with 'tag_header' and 'tag_header_string'. You can set 'tag_header' to a space separated list cotaining some of 'Subject' (= 'rewrite_subject 1'), 'From' and 'To' vs. 'none' (= 'rewrite_subject 0'). The To and From headers'll get the string attached as a comment. This might produce some not-so-RFC-compliant headers if there's already a comment present but that shouldn't break anything.
Created attachment 204 [details] Patch against the libs to replace the 'rewrite_subject' opject with a more general 'tag_header'
I just noticed a bug in my patch: $self->{tag_header} must be initialized with 'Subject' (first character uppercase): -$self->{tag_header} = ['subject']; +$self->{tag_header} = ['Subject'];
Hmf. There's another possible gotcha. I'll attach a revised patch.
Created attachment 205 [details] Revised patch; successor of patch 204
I don't really like this idea. I think the DEFAULT behavior should be as least obtrusive as possible -- just add headers that will normally be invisible. Anything settings that will be obtrusive should be left to the local admin who can wisely choose what will work best at his site and hopefully explain his choice (as our mail admin did at my work, actually). That patch I would be quite happy to accept. :-)
I don't like the default tagging of the subject, too. But it _is_ the current default, so I kept it (but I'd be very happy to change it to no-tagging- per-default :-). The optional tagging of From and/or To is something less intrusive than doing this to the Subject because these comments will go away if you reply to a message.
*argh* what happened to my wrapping?
Unfortunately, it's not true that the SPAM tag will go away if it's located in the From: header. My mailer retains those tags and I have to edit them just the same as if it was tagged as SPAM the other way. I think the best solution is to turn off obtrusive tags (like Subject: tagging) by default, provide options for site administrators to turn them on, and also provide a message encapsulation option (so the original can be extracted bit- for-bit). Speaking of message encapsulation, did that patch go into SA already?
I don't think *anyone* likes the default subject tagging. will I change the default behaviour while we're making a release with big UI changes anyway?
*meekly raises hand at back of room* I like subject tagging.... ...but I think I'd like To: tagging even better. I also don't mind it being off by default.
I am new to development and patches and such, but how come this patch isn't part of the 2.41 release or the 2.50 cvs?? Does it need time to be tested and blessed first, or am I missing something... I know there has been a little discussion about the default settings - is that what the wait is?? Just wonderin...
Dan was proposing to rewrite the whole tagging system, so I left this until that happened.
I'm taking this one. I plan on making a rewrite_header { from | to | subject } STRING option that paralels add_header to a certain extent. I will allow backwards compat, of course.
I've fixed this in SVN. Changelog: Adds rewrite_header option to allow tagging of Subject, To and From headers. For To and From headers, markup will be in the form of an RFC 2822 Comment (in parentheses separated by a tab from the address). (Closes bug 478) As mentioned earlier, syntax is: rewrite_header { from | to | subject } STRING where STRING can contain TAGS. Minor regression: removing markup of subject tagging with report_safe 0 only works when the rewrite_header subject STRING option is given, rather than automatically searching for the default *****SPAM***** if no subject_tag option is given. It probably wouldn't be too hard to add support for appending the subject tag. Thanks to Malte for a few of the regexps which I stole from his patches.
Duncan, you're my hero :)
Subject: Re: TO: header modification > Duncan, you're my hero :) Aww... Thanks! But I did steal a lot of stuff from your patches :-)