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 18 Oct 2020, 05:58 AM   #1
m46ah_30
Essential Contributor
 
Join Date: Sep 2002
Posts: 302
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.) "[email protected]_XXXX.com", I want them all to always be moved on arrival to the folder created to receive mail from "[email protected]_XXXX.com". They usually are!

If messages arrive addressed to a fastmail alias (i.e.) "So_&[email protected]", 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 "[email protected]" and are addressed to "So_&[email protected]". I want messages from "[email protected]" that are sent only to "So_&[email protected]" 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.
m46ah_30 is offline   Reply With Quote

Old 18 Oct 2020, 06:27 AM   #2
JeremyNicoll
Senior Member
 
Join Date: Dec 2017
Location: Scotland
Posts: 188
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.
JeremyNicoll is offline   Reply With Quote
Old 18 Oct 2020, 11:46 AM   #3
BritTim
The "e" in e-mail
 
Join Date: May 2003
Location: mostly in Thailand
Posts: 2,853
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_&[email protected]".

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"
The approach I would use is move all messages sent to the relevant alias with more than one recipient to the "service" folder. Next I would provide the appropriate rules to move messages sent to the relevant alias (now known not to have other recipients) to the appropriate folders. I would have a last rule that handles remaining messages from "[email protected]_XXXX.com".

I do not have time to create and test the solution, but hopefully the above will help get you started.
BritTim is offline   Reply With Quote
Old 19 Oct 2020, 12:50 AM   #4
m46ah_30
Essential Contributor
 
Join Date: Sep 2002
Posts: 302
Quote:
Originally Posted by BritTim View Post
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_&[email protected]"
The relationship between these FROM and TO addresses is exclusive; mail from this FROM address will only be sent to this TO address. Mail from other senders will also be sent to this TO recipient but never for the same purpose as from this specific sender. There will be no CC recipients involved. I was unaware that the order of the rules in the list of rules had any effect on the way they were applied. I'll try changing the order of the rules in the list and see how that works.

Thanks for your replies, gentlemen!

Last edited by m46ah_30 : 19 Oct 2020 at 07:02 PM.
m46ah_30 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 10:48 AM.

 

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