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 22 Dec 2018, 01:14 PM   #1
xyzzy
Essential Contributor
 
Join Date: May 2018
Posts: 474
Question about fileinto vs. keep

Based on some condition I want to file a incoming email into the INBOX and mailbox X. So I can write,

Code:
if ...test condition... {
  fileinto "INBOX";
  keep;
}
and later on, based on the way I am grouping things in the code in the script I do the following (otherwise I supposed I could do both these operations under the single test condition but this second one is generated by the UI organize rules):

Code:
if ...test condition... {
  fileinto "INBOX.X";
}
Now I discovered that I can leave the fileinto "INBOX"; in and remove the keep or remove the fileinto "INBOX"; and keep the, 'er, keep. Either way I get two copies of the message as desired; one in the INBOX and one in X. I believe doing an explicit fileinto disables the automatic default fileinto INBOX but a keep overrides that so that why deleting either of these commands produces the desired result.

Fine, that's what I want. However if I open one of these copies, doesn't matter which, it gets marked as read in both mailboxes! Not what I was expecting. On the other hand deleting one does not delete the other.

Is this the way these are supposed to behave? I'm not saying it's wrong necessarily. It's just a bit confusing about how the single message filed into two distinct mailboxes are not entirely treated as two distinct copies. It could be I just don't fully understand fileinto's relationship with keep.

Last edited by xyzzy : 22 Dec 2018 at 01:25 PM.
xyzzy is offline   Reply With Quote

Old 23 Dec 2018, 08:02 AM   #2
n5bb
Intergalactic Postmaster
 
Join Date: May 2004
Location: Irving, Texas
Posts: 8,917
Arrow Folder targeting

The sieve language provides an implicit “keep” which by default saves a message into the initial target folder. Fastmail allows the target folder when sieve execution starts to be set in three ways:
  1. Plus+addressing: Instead of an incoming message being addressed to user@example.org, the sender addresses it to user+foldername@example.org. If you need to file into a subfolder you must separate the main folder name and subfolder name by a full stop (period) character “.”. So an incoming message might be addressed to user+friends.bookclub.jane@example.org and it will target the Inbox.friends.bookclub.jane folder at your account.
  2. Subdomain addressing: The subdomain portion of the address specifies the Fastmail user account and the portion of the address before @ specifies an automatically created plus+address. So friends.bookclub.jane@user.example.org creates a delivery address of user+friends.bookclub.jane@example.org which targets delivery to the Inbox.friends.bookclub.jane folder at your account.
  3. Alias targeting: Messages sent to your main account (login) address target your Inbox unless subdomain or plus+addressing is used. But in the Aliases setup screen you can specify a plus+address as the target for an alias. So you could create the alias jane@example.org with the target user+friends.bookclub@example.org and messages sent to the alias jane@example.org will be targeted for delivery to the Inbox.friends.bookclub.jane folder using subdomain addressing as described above. If the alias target includes a wildcard * such as user+*@example.org, the portion of the address left of the @ is used in the plus+address, so a message to jane@example.org will be resolved to user+jane@example.org to the Inbox.jane folder.
The X-Resolved-To header is determined as described above, and this determines the target folder when your sieve scripts starts.
  • If there is no discard, fileinto, or redirect command actually executed by the time the sieve script ends, the message is delivered into the target folder.
  • If a discard command is executed, the message is permanently discarded. It will not be in your Trash folder.
  • If a fileinto command (without a :copy tag) is executed before the sieve script ends, the final fileinto target replaces the default target folder described above. The implicit “keep” is ignored.
  • If a redirect (without :copy tag) command is executed before the sieve script ends, the message is redirected and sent to the address in that command. The implicit “keep” is ignored.
  • If a fileinto or redirect command is executed with a :copy tag, the implicit “keep” is not ignored. The message will be filed into the target folder described above and the message will be filed or redirected.
The “:copy” tag described above is part of the following addendum to the sieve standard:
Copying without side effects
https://tools.ietf.org/html/rfc3894

Your first sieve fragment is not needed in most cases if you are not using subdomain or plus+addressing. The default action is to “keep” without any action on your part. The sieve fragment will have two effects:
  • Any folder target set by plus+addressing, subdomain addressing, or alias targeting will be ignored. The message is forced to be saved in your Inbox folder.
  • Discard commands in the script are ignored. As long as the statement which includes the explicit “keep” is executed before the sieve script terminates, the message will be saved in your Inbox folder and discards will be ignored.
Your second sieve fragment will cause the implicit “keep” action to be ignored (unless there is an explicit “keep” commend or fileinto or redirect with “:copy” tag executed), and the message will not be saved by default into the target folder as described above.

If you want to file a copy of a message in a certain folder and also let it be automatically filed into the target folder (by default Inbox), all you need to do is include the “:copy” tag as described in RFC3894. For example, this code will file a message which matches he test condition into both the Inbox and X folders:
Code:
If ...test condition... {
   fileinto :copy “INBOX.X”;
}
Bill
n5bb is offline   Reply With Quote
Old 23 Dec 2018, 09:03 AM   #3
n5bb
Intergalactic Postmaster
 
Join Date: May 2004
Location: Irving, Texas
Posts: 8,917
Arrow Conversation mode

Quote:
Originally Posted by xyzzy View Post
...However if I open one of these copies, doesn't matter which, it gets marked as read in both mailboxes! Not what I was expecting. On the other hand deleting one does not delete the other...
The default Conversation view mode can be enabled or disabled. You can also choose whether you wants to delete grouped messages in all folders. So I think you have your settings set so that conversation mode is enabled but deletion of grouped messages in all folders is disabled. See:
https://www.fastmail.com/help/receiv...ersations.html

In Conversation view mode the idea is that once you read a conversation thread all copies of messages are marked as read (until a new message arrives, marking the conversation unread until you read any message in that conversation).

Fastmail is in the process of changing their user interface to JMAP. See:
https://www.fastmail.com/help/guides...date-2018.html
At this time, I see a different user interface on my PC (using a browser), my iPad (using a browser), and my iPad (using the Fastmail app). I see some differences on how conversations are being shown with these different user interfaces.

Bill
n5bb is offline   Reply With Quote
Old 23 Dec 2018, 02:01 PM   #4
xyzzy
Essential Contributor
 
Join Date: May 2018
Posts: 474
Quote:
Originally Posted by n5bb View Post
The default Conversation view mode can be enabled or disabled. You can also choose whether you wants to delete grouped messages in all folders. So I think you have your settings set so that conversation mode is enabled but deletion of grouped messages in all folders is disabled. See:
https://www.fastmail.com/help/receiv...ersations.html

In Conversation view mode the idea is that once you read a conversation thread all copies of messages are marked as read (until a new message arrives, marking the conversation unread until you read any message in that conversation).
I already have the Conversations setting set to "Show every message separately". I would think that should be the option to disable what I am seeing, i.e., marking one copy as read doesn't affect the other. But obviously it doesn't.

Another strange thing. In that Conversations document it states:
Quote:
In the Reading section, toggle the Delete grouped messages from all folders setting. When set to off, deleting will only delete messages in the current folder, not the whole conversation.
I see no such settings in Preferences/Reading (including its advanced preferences). So if it has been removed I guess it's always set off since deletion in one folder doesn't affect the other which is what I want.

Quote:
Fastmail is in the process of changing their user interface to JMAP. See:
https://www.fastmail.com/help/guides...date-2018.html
At this time, I see a different user interface on my PC (using a browser), my iPad (using a browser), and my iPad (using the Fastmail app). I see some differences on how conversations are being shown with these different user interfaces.
I think I still have the old interface.

Thanks for the other post too. I forgot about the fileinto :copy. I'll have to experiment to see if that causes any different behavior. I just want to keep both copies entirely independent.
xyzzy is offline   Reply With Quote
Old 23 Dec 2018, 03:38 PM   #5
n5bb
Intergalactic Postmaster
 
Join Date: May 2004
Location: Irving, Texas
Posts: 8,917
Quote:
Originally Posted by xyzzy View Post
...Another strange thing. In that Conversations document it states:
In the Reading section, toggle the Delete grouped messages from all folders setting. When set to off, deleting will only delete messages in the current folder, not the whole conversation.
I see no such settings in Preferences/Reading (including its advanced preferences.
I see exactly what Help describes when you have Conversations set to Group messages with their replies. Of course, when you select Show every message separately this choice is not there, since there are no grouped messages!
http://emdforum.sent.com/Mail_Prefer...references.PNG

I can see some differences in how this works on my PC, iOS browser, and iOS app. And after some testing I think there are bugs. I will file a report with Fastmail.

Bill
n5bb is offline   Reply With Quote
Old 23 Dec 2018, 06:38 PM   #6
xyzzy
Essential Contributor
 
Join Date: May 2018
Posts: 474
Quote:
Originally Posted by n5bb View Post
I see exactly what Help describes when you have Conversations set to Group messages with their replies. Of course, when you select Show every message separately this choice is not there, since there are no grouped messages!
http://emdforum.sent.com/Mail_Prefer...references.PNG
Oh, it doesn't appear until you select the group messages radio button. Well that's embarrassing since I forgot to click it to check for that! But I still want conversations grouping off. At least now I know the documentation is correct.

Quote:
I can see some differences in how this works on my PC, iOS browser, and iOS app. And after some testing I think there are bugs. I will file a report with Fastmail.
I haven't gotten around to more testing as yet. It's late. I need to test if fileinto :copy has any different effect on the read/no read status of the two instances of the same message in their different folders. The read state after all is why I started this thread. I might end up filing a ticket on this myself.
xyzzy 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 01:58 PM.

 

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