|
FastMail Forum All posts relating to FastMail.FM should go here: suggestions, comments, requests for help, complaints, technical issues etc. |
|
Thread Tools |
18 Oct 2020, 05:58 AM | #1 |
Essential Contributor
Join Date: Sep 2002
Posts: 315
|
Can't write a rule to serve 2 conditions
This posting took considerable time to write because even though it is easy for me to understand what I want to accomplish it is difficult for me to explain it...
I need to write a organization rule that must deal with 2 conditions from 1 header in different ways: If messages come from (i.e.) "service@XXX_XXXX.com", I want them all to always be moved on arrival to the folder created to receive mail from "service@XXX_XXXX.com". They usually are! If messages arrive addressed to a fastmail alias (i.e.) "So_&_So@fastmail.whatever", I want all the messages addressed in that way (and there are many of them) to be moved to the folder for that alias. They almost always are except when the messages are from "service@..." and are addressed to "So_&_So@...". I want messages from "service@..." that are sent only to "So_&_So@..." to be moved to the folder created for the sender instead of the recipient; then they are NOT. I want messages from this specific sender's address to ALWAYS receive priority in their destination, regardless of recipient. When from is this particular sender and to is this particular recipient, recipient is now being given priority and I can't figure out how to write a rule to make it otherwise. I'm hoping that someone else may be able to. |
18 Oct 2020, 06:27 AM | #2 |
Essential Contributor
Join Date: Dec 2017
Location: Scotland
Posts: 490
|
This requires you to write two rules.
The rule that's most important to you needs to be higher in the list of rules than the other rules, so that emails that satisfy that condition are handled first, and only those that didn't match that condition are looked at by later rules. Rules can be dragged up and down in the list of rules. It sounds to me as if you need to reverse the order of the two rules you already have. Also, in general I would suggest you filter on "A Header called" X-Delivered-to Contains a relevant email address, as that's the alias the mail is to be delivered to (routed to) whereas what's in the "To:" field may be irrelevant (eg if the mail is CCed or BCCed to your recipient). Of course if you really do want to use "To:" stay with that. I'm not sure about testing that a mail is /only/ to a single address. Using X-Delivered-To will make it irrelevant if the incoming mail was addressed To many people, only one of which is your user, as the copy that's being processed for your user will be being delivered to them. If you can ever receive mails addressed to more than one of your aliases I'm not sure if FM delivers several copies or just one. Last edited by JeremyNicoll : 18 Oct 2020 at 06:42 AM. |
18 Oct 2020, 11:46 AM | #3 |
The "e" in e-mail
Join Date: May 2003
Location: mostly in Thailand
Posts: 3,095
|
Your requirement is a tricky one, especially as you presumably want to consider CC recipients as well as TO recipients. The challenge is writing a condition that allows you to identify recipients that are not sent to "So_&_So@...".
The trick I think is to count the number of recipients. Using standard sieve, code of the following form is supported: Code:
address :count "gt" :comparator "i;ascii-numeric" ["to", "cc"] "1" I do not have time to create and test the solution, but hopefully the above will help get you started. |
19 Oct 2020, 12:50 AM | #4 | |
Essential Contributor
Join Date: Sep 2002
Posts: 315
|
Quote:
Thanks for your replies, gentlemen! Last edited by m46ah_30 : 19 Oct 2020 at 07:02 PM. |
|