|
FastMail Forum All posts relating to FastMail.FM should go here: suggestions, comments, requests for help, complaints, technical issues etc. |
|
Thread Tools |
7 Nov 2006, 05:09 AM | #1 |
Senior Member
Join Date: Jul 2006
Posts: 179
|
Rules help
For every mailing list I'm on, I give out a different alias in order to discourage spam. American Airlines gets "americanair@XXX.mail-page.com", and so on. (XXX standing in for my real username, obviously).
I'd like to set up my filters so that messages to certain addresses get filed in certain folders, so I set up a filing filter in the normal (not "advanced") Define rules screen which said: Code:
Message with any header that contains "quad@XXX.mail-page.com","filmlinc@XXX.mail-page.com", "filmforum@XXX.mail-page.com","Pioneer-Theater@googlegroups.com", "gkids@XXX.mail-page.com" if this is more helpful, I went into the advanced screen and copied out some of the code. (Please note I'd like to set this up in the normal interface, NOT the advanced screen. I'm pasting this in for reference only.) Code:
if header :contains ["Sender", "X-Sender", "Mailing-List", "X-Apparently-From", "X-Version", "X-Sender-IP", "Received", "Return-Path", "Delivered-To", "List- Post", "Date", "Subject", "To", "Cc", "From", "Reply-to", "X-AntiAbuse", " Content-Type", "Received", "X-LinkName", "X-Resolved-to", "X-Delivered-to", "X- Mail-from", "X-Spam-hits"] "\"quad@XXX.mail-page.com\",\"filmlinc@XXX.mail-page .com\",\"filmforum@XXX.mail-page.com\",\"Pioneer-Theater@googlegroups.com\",\" gkids@XXX.mail-page.com\"" { fileinto "INBOX.lists.film"; |
7 Nov 2006, 05:24 AM | #2 |
Cornerstone of the Community
Join Date: Apr 2002
Location: UK
Posts: 590
|
The advanced screen seems to be escaping the " characters with \ characters.
Try taking the " characters out of the normal screen but leave the commas in. |
7 Nov 2006, 05:29 AM | #3 |
Senior Member
Join Date: Jul 2006
Posts: 179
|
OK, I've changed it so each e-mail address is just separated by a comma.
Next time someone responds to this thread, I'll see if it's working (when the notification e-mail, which is supposed to be filtered, comes in). |
7 Nov 2006, 05:33 AM | #4 |
Cornerstone of the Community
Join Date: Apr 2002
Location: UK
Posts: 590
|
OK, this post should give you a notification to test with.
|
7 Nov 2006, 05:44 AM | #5 |
Senior Member
Join Date: Jul 2006
Posts: 179
|
Thanks -- still no dice.
Why is this so damned complicated? It shouldn't take a computer science degree to file e-mail into folders. It really shouldn't. Anyway, here's the relevant code, if anyone has any ideas thanks Code:
} } if header :contains ["Sender", "X-Sender", "Mailing-List", "X-Apparently-From", "X-Version", "X-Sender-IP", "Received", "Return-Path", "Delivered-To", "List-Post", "Date", "Subject", "To", "Cc", "From", "Reply-to", "X-AntiAbuse", "Content-Type", "Received", "X-LinkName", "X-Resolved-to", "X-Delivered-to", "X-Mail-from", "X-Spam-hits"] "quad@XXX.mail-page.com,filmlinc@XXX.mail-page.com, filmforum@XXX.mail-page.com,Pioneer-Theater@googlegroups.com, gkids@XXX.mail-page.com" { fileinto "INBOX.lists.film"; |
7 Nov 2006, 05:53 AM | #6 |
Cornerstone of the Community
Join Date: Apr 2002
Location: UK
Posts: 590
|
It looks like the normal screen is only geared-up for one address per rule.
That would explain the escaping of the " characters. If you want to use the advanced screen the code should look like this: if header :contains ["from", "to", "whatever"] ["john@example.com", "jane@example.com"] { fileinto "INBOX.my-sub-folder"; stop; } |
7 Nov 2006, 06:08 AM | #7 |
Senior Member
Join Date: Jul 2006
Posts: 179
|
There's really no way to say:
"look for 'this address' OR 'this address' " in one rule? |
8 Nov 2006, 08:48 AM | #8 |
Intergalactic Postmaster
Join Date: Oct 2001
Location: Melbourne, Australia
Posts: 6,102
Representative of:
Fastmail.FM |
It's not the "advanced" screen that's escaping things there.
You've created a rule 'any header' that 'contains' the text '"quad@XXX.mail-page.com","filmlinc@XXX.mail-page.com", "filmforum@XXX.mail-page.com","Pioneer-Theater@googlegroups.com", "gkids@XXX.mail-page.com"'. In this case, it's using the literal text: "quad@XXX.mail-page.com","filmlinc@XXX.mail-page.com", "filmforum@XXX.mail-page.com","Pioneer-Theater@googlegroups.com", "gkids@XXX.mail-page.com" As the thing to look for. So when it generates the code, it escapes the "'s by putting \ in front of them. You're then obviously looking at the Advanced script which shows you the actual code generated Since you want to OR some things, you need to use an advanced rule, which directly inserts some script code without escaping. So what you should do is create an 'Advanced' rule, ignore the "that" part, and for the text put: header :contains [ "X-Delivered-to" ] [ "quad@XXX.mail-page.com","filmlinc@XXX.mail-page.com", "filmforum@XXX.mail-page.com","Pioneer-Theater@googlegroups.com", "gkids@XXX.mail-page.com" ] If you add that, then Done to leave the screen to rebuild the rules, then look at the actual code generated, you should find: if header :contains [ "X-Delivered-to" ] [ "quad@XXX.mail-page.com","filmlinc@XXX.mail-page .com","filmforum@XXX.mail-page.com","Pioneer-Theater@googlegroups.com\",\" gkids@XXX.mail-page.com" ] { fileinto "INBOX.lists.film"; Which is what you want. Rob |