View Single Post
Old 9 Sep 2019, 12:56 PM   #20
xyzzy
Essential Contributor
 
Join Date: May 2018
Posts: 478
The setting of the known_sender to true and the way it's tested is mainly to get it past the FM generated spam test (but I also use it in other places as well). So once beyond there you're own your own to filter any way you want.

I also have an organize rule for emails sent to myself. I filter them not as spam but place them in a folder named "Unexpected". No one knows my actual FM email address. Only my forwarding service's address is known. So any email sent with an explicit To of my FM address I put in a folder of their own called "unexpected". The only legitimate time the To should be my actual FM address is when I am doing it for testing purposes or FM is sending me something directly. So part of the test is to let those emails reach my inbox (with one exception mentioned later). Below is the sieve code (albeit generated with an actual organize rule - sieve code "reads" so much better and is more concise than the organize rule UI page which defined them).

Code:
if 
  allof(
  address :is "To" "xxxxx@fastmail.com",
  not address :matches "From" "*@fastmail.com"
  )
{
  fileinto "INBOX.Unexpected@fastmail^com";
}
This happens to be my first organize rule in the list hence the if test and not elsif. If no other organize rule picks these off it will end up in the inbox by default.

But there is as case I do want to pick off and I can't do it with an organize rule (or if I can it's not worth the effort since it's easier in sieve). That's the case fastmail.com directly sends me email. Obviously they do know my actual FM email address too!

I have it grouped in a special block of code following section 8 where do some other similar operations (alias address filtering but that's off topic). Without going into the actual context of what I do there since that complicates the description I include a test that basically looks like:

Code:
if allof(address :is "From" "support@fastmail.com",
                header :matches "Subject" "*.* * Mail fetch retrieval error") {
    fileinto "${1}^${2}";
  }
If this test matches I then filter those messages into the folder named as the email address since I name top level folders by their email address (that's my convention - any subfolders would be special cases of that email address which is why I have it grouped with my alias address handling - actual code is more complicated to handle subfolder name extraction and the conversion of dots to ^'s).

The reason for this test is I have (had) a mail fetch account where about 30% of the time resulted in "Mail fetch retrieval error" being reported from fastmail.com. In the "old days" when mail fetch was using POP it was a timeout error and I could test for this and just ignore it since eventually a future fetch would succeed. Now with IMAP it's just a general "Mail fetch retrieval error" so I sort them into the email address 's folder. If I didn't they would end up in my inbox or if I didn't exclude fastmail.com from my "unexpected" test they would go into "unexpected". I want these error reports to go into the mail fetch identity's folder not elsewhere.

I have 4 other mail fetch identities set up. This problem only happens with one of the (the yahoo servers). While the above test is a general filtering rule to handle these errors, I've since changed one offending email account to forward from there and disabled my mail fetch. Screw 'em!

Last edited by xyzzy : 9 Sep 2019 at 01:09 PM.
xyzzy is offline   Reply With Quote