EmailDiscussions.com  

Go Back   EmailDiscussions.com > Email Service Provider-specific Forums > FastMail Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
Stay in touch wirelessly

FastMail Forum All posts relating to FastMail.FM should go here: suggestions, comments, requests for help, complaints, technical issues etc.

Reply
 
Thread Tools
Old 5 Oct 2019, 06:31 AM   #31
Terry
The "e" in e-mail
 
Join Date: Jul 2002
Location: VK4
Posts: 2,840
Quote:
Originally Posted by xyzzy View Post
For those of you who lost the Add Spam Spam Protection setting (and me who got it back but in anticipation of probably losing it again someday)
You were lucky they would not do mine, I have only been with them since 2002...

Last edited by Terry : 5 Oct 2019 at 07:17 PM.
Terry is offline   Reply With Quote
Old 8 Oct 2019, 11:13 PM   #32
JeremyNicoll
Senior Member
 
Join Date: Dec 2017
Location: Scotland
Posts: 184
Quote:
Originally Posted by xyzzy View Post
For those of you who lost the Add Spam Spam Protection setting ...
As a side issue, if one has one's own code in a Sieve script, what's the risk that something FM do will obliterate your code?

Do you have to steer clear of clicking anything on their Rules screen? Or is their system cunning enough to parse the current script, isolate your bits, and when a new script is generated slot your parts back in around their generated bits?

Do you (I think I would) keep your own copy of your parts, or the whole generated script and your parts, elsewhere in case they manage to screw-up the whole thing?

Is there only one script? That is, can you write subscripts and keep them somewhere and then %include them in the master script (which might make preserving your bits slightly easier to manage)?
JeremyNicoll is offline   Reply With Quote
Old 9 Oct 2019, 02:13 AM   #33
SideshowBob
Senior Member
 
Join Date: Jan 2017
Posts: 145
Quote:
Originally Posted by JeremyNicoll View Post
Or is their system cunning enough to parse the current script, isolate your bits, and when a new script is generated slot your parts back in around their generated bits?
The script is divided into different parts, four custom sections are interleaved with four generated sections.
SideshowBob is offline   Reply With Quote
Old 9 Oct 2019, 05:37 AM   #34
xyzzy
Essential Contributor
 
Join Date: May 2018
Posts: 296
Quote:
Originally Posted by JeremyNicoll View Post
Do you (I think I would) keep your own copy of your parts, or the whole generated script and your parts, elsewhere in case they manage to screw-up the whole thing?
I actually do keep a backup text file of the whole script. That's one of the uses for the "Copy to clipboard" button at the top of the script page. Another being to paste into Sieve Tester.

Quote:
Is there only one script? That is, can you write subscripts and keep them somewhere and then %include them in the master script (which might make preserving your bits slightly easier to manage)?
As noted in the previous post, if you take a look at the script you have (click "Edit custom Sieve code" at the top or bottom of the Rules settings) you will see blank areas where you can add your own code. Which of those areas you use is dependent on what you want to do and when you want to do it. In my Add Spam snippet of code I suggested before section 1 (the FM generated stuff in numbered which I refer to as "sections") which would be the very start of the script after the require command.
xyzzy is offline   Reply With Quote
Old 9 Oct 2019, 07:10 PM   #35
JeremyNicoll
Senior Member
 
Join Date: Dec 2017
Location: Scotland
Posts: 184
Quote:
Originally Posted by SideshowBob View Post
The script is divided into different parts, four custom sections are interleaved with four generated sections.
Thank-you!
JeremyNicoll is offline   Reply With Quote
Old 23 Aug 2020, 06:15 AM   #36
xyzzy
Essential Contributor
 
Join Date: May 2018
Posts: 296
I thought I would resurrect this old thread to tell you that I just noticed that Spam Protection removed the Add Score option...again!

Of course this time around I really don't care since I've long had (since around the time of this old thread) Sieve code to handle adding it in if it wasn't there. If anyone wants that chunk of code let me know.

I was wondering how long "they" would take to getting around to removing that option after they switched to the new UI. It was still in there (for me at least) after the new UI but I don't really need to visit the Spam Protection settings very often so I really don't know when they took the Add Score option back out since my Sieve code would have just taken over.

Last edited by xyzzy : 23 Aug 2020 at 07:12 AM.
xyzzy is offline   Reply With Quote
Old 23 Aug 2020, 03:36 PM   #37
n5bb
Intergalactic Postmaster
 
Join Date: May 2004
Location: Irving, Texas
Posts: 8,610
Messages in the Spam folder (and only that folder) include a label showing the spam score. To the best of my memory, it's been like that for quite a while.
n5bb is offline   Reply With Quote
Old 23 Aug 2020, 05:21 PM   #38
Terry
The "e" in e-mail
 
Join Date: Jul 2002
Location: VK4
Posts: 2,840
Quote:
Originally Posted by xyzzy View Post
I thought I would resurrect this old thread to tell you that I just noticed that Spam Protection removed the Add Score option...again!.
I have given up on them now....
Terry is offline   Reply With Quote
Old 23 Aug 2020, 05:47 PM   #39
xyzzy
Essential Contributor
 
Join Date: May 2018
Posts: 296
Quote:
Originally Posted by n5bb View Post
Messages in the Spam folder (and only that folder) include a label showing the spam score. To the best of my memory, it's been like that for quite a while.
But I don't sort everything into the Spam folder. I have other categories of spam some stuff gets sorted into.

Quote:
Originally Posted by Terry View Post
I have given up on them now...
As I said so have I which is why I had added the Sieve code to add the spam score back when this last happen.

Last edited by xyzzy : 23 Aug 2020 at 06:02 PM.
xyzzy is offline   Reply With Quote
Old 23 Aug 2020, 06:05 PM   #40
JamesHenderson
Cornerstone of the Community
 
Join Date: Jan 2003
Location: Oxfordshire, UK
Posts: 572
Quote:
Originally Posted by xyzzy View Post
But I don't sort everything into the Spam folder. I have other categories of spam some stuff gets sorted into.
Curious as to why do you do this. Care to elaborate?
JamesHenderson is offline   Reply With Quote
Old 23 Aug 2020, 07:03 PM   #41
xyzzy
Essential Contributor
 
Join Date: May 2018
Posts: 296
Quote:
Originally Posted by JamesHenderson View Post
Curious as to why do you do this. Care to elaborate?
This is a bit off topic, but...

There's some spam I class as those to be discarded so I place them in a "discard" folder (I don't have the guts to actually discard them) with a short auto-delete time (7 days). At the moment those that I think contain embedded scripts (<script>) or reference storage.googleapis.com in the raw body are in that category. I just don't trust such emails but I still have a chance to check them further.

I'm also saving all spam in it's own folder for "research" purposes to see if certain spammers deserve to be promoted to the "discard" category and for reference. Initially this folder was this one prompted me to always want the explicit spam score displayed. I was initially trying to determine an appropriate spam threshold score. I was also looking for repeat offenders that were just plain annoying. That doesn't seem to be the case anymore (except for one that I've "promoted" to the "discard" category). Indeed I get very little spam these days (except for that one idiot - ever hear about "adidanos.xyz"?).

In addition I have an "investigate" folder for spam tests I've added to my Sieve code that aren't quite "ready for prime time" (still fiddling around with checking for foreign languages since, for me, anything foreign I expect to be spam and sometimes these do slip under the spam detection radar).

Bottom line I have these different classes of spam I keep in their respective folders so I want to see the spam score in the title because these folders don't have the spam badge that only shows in the Spam folder. I want to be able to see the spam score at a glance just by looking at the mail list subject lines and not having to open each one to see it's X-Spam-score header which I also include in the "Extra headers" display. Also all these additional folders have spam learning on so I am not losing anything by not keeping them in the Spam folder where I have to delete them to "learn".

It's just the way I am currently doing things.

Last edited by xyzzy : 23 Aug 2020 at 07:37 PM.
xyzzy is offline   Reply With Quote
Old 23 Aug 2020, 08:02 PM   #42
JamesHenderson
Cornerstone of the Community
 
Join Date: Jan 2003
Location: Oxfordshire, UK
Posts: 572
thanks for the explanation :-)
JamesHenderson is offline   Reply With Quote
Old 24 Aug 2020, 09:10 AM   #43
Grhm
Essential Contributor
 
Join Date: Mar 2007
Location: UK
Posts: 202
Quote:
Originally Posted by xyzzy View Post
If anyone wants that chunk of code let me know.
Thank you for this. Is the code different from what you posted here?:
https://www.emaildiscussions.com/sho...1&postcount=30
Grhm is offline   Reply With Quote
Old 24 Aug 2020, 12:45 PM   #44
xyzzy
Essential Contributor
 
Join Date: May 2018
Posts: 296
Quote:
Originally Posted by Grhm View Post
Thank you for this. Is the code different from what you posted here?:
https://www.emaildiscussions.com/sho...1&postcount=30
Forgot I posted that. It's more or less the general idea but the strict testing for the spam threshold is wrong. My actual code is shown at the end of this post (complete with its comments - my style is to comment a lot in code of any language).

A little explanation about this code.
  1. I never allow emails from known senders to be considered as spam (my own personal preference).
  2. In my case a known sender (reflected in the known_sender switch) can be set from X-Spam-Known-Sender or from a contact list (defined earlier in my Sieve code) containing of subdomain email addresses (email addresses with globbing that isn't allowed in the FM Contact List UI, for example *@*.domain.tld). Those email addresses could possibly still be considered as spam by the back end.
  3. A message from a known sender that was considered as spam has {SPAM x.xx) removed from it's Subject line if it is there.
  4. The SPAM_THRESHOLD, x.yy, is converted to two variables; ST1 is "x" and ST2 is "yy-9" in my earlier initialization section.
  5. All this code is enabled/disabled by a master switch, ADD_SCORE, also set during initialization.
Code:
#
# Remove "{SPAM xx.x}" (if it's there) from the Subject line of any known sender somehow scored as spam.
# Conversely prefix the Subject line with "{SPAM xx.x}" (except a known sender) if it is NOT already
# there and it's scored as spam.  This is all controlled by the ADD_SCORE switch.
#
# Basically this is almost the same as (and can co-exist with) the Spam Protection "Add score" setting but
# with the addition of stripping off the "{SPAM xx.x}" from known senders because they are never treated
# as spam.  If "Add score" is enabled then all this code does is strip "{SPAM xx.x}" from the Subject in
# the rare case it's on a known sender.  If not this code is a substitute for the "Add score" option (but
# still not adding "{SPAM xx.x}" to known senders).  Since FM has a history of removing the Spam
# Protection's "Add score" setting this code will always be a substitute for that should that setting ever
# disappear again in the future! [update 8/22/20 - IT DID!]
#
if allof(string :is "${ADD_SCORE}" "true",
         anyof(header :value "gt" :comparator "i;ascii-numeric" "X-Spam-score" "${ST1}",
               header :regex "X-Spam-score" "^${ST1}\.[${ST2}]$")) { # X-Spam-score >= SPAM_THRESHOLD
  if header :matches "Subject" "{SPAM*} *" {                  # "Add score" is working
    if string :is "${known_sender}" "true" {                  # if known sender...
      deleteheader "Subject";                                 # ...strip "{SPAM xx.x}" from Subject line
      addheader "Subject" "${2}";                             # X-Spam-score still shows the spam score
    }
  } elsif allof(string :is "${known_sender}" "false",         # FM's "Add score" is not working or is off
                header :matches "Subject" "*") {              # don't have to worry about known senders
    set "Subject" "${1}";
    if header :matches "X-Spam-score" "*" {
      set "spam_score" "${1}";
      if header :value "lt" :comparator "i;ascii-numeric" "X-Spam-score" "10" {
        set "spam_score" "0${1}";                             # add leading 0 for spam scores < 10
      }
    }
    deleteheader "Subject";                                   # prefix Subject with "{SPAM xx.x}"
    addheader "Subject" "{SPAM ${spam_score}} ${subject}";
  } else {                                                    # known sender && spam && no {SPAM*} prefix
    # as in the 1st case X-Spam-score still shows the actual spam score
  }
} # ADD_SCORE && spam
So the "guts" of this code is basically the same as what I previously posted but here the test for spam score is proper.
xyzzy is offline   Reply With Quote
Old 24 Aug 2020, 01:19 PM   #45
Grhm
Essential Contributor
 
Join Date: Mar 2007
Location: UK
Posts: 202
Quote:
Originally Posted by xyzzy View Post
my style is to comment a lot in code of any language
And your comments are in proper, comprehensible English, too! Bravo!
Many thanks for this.
Grhm is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +9. The time now is 04:05 PM.

 

Copyright EmailDiscussions.com 1998-2013. All Rights Reserved. Privacy Policy