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 Aug 2017, 06:15 PM   #1
dgittings
Junior Member
 
Join Date: Mar 2003
Location: Hong Kong
Posts: 23
How to direct copies of the same incoming email into multiple folders?

Is there some way of writing a rule so that copies of an incoming email are filtered into multiple folders? Perhaps in sieve? (although I'm not really very familiar with sieve) I've spent ages puzzling over this, but haven't figured out a way of doing this so far?

My wife and kids share the same (enhanced) account with me. We all have our own aliases, with rules directing emails addressed to those aliases into different folders which serve as Inboxes for each of us.

The problem comes when someone sends the same email to more than one of us (e.g. both my wife and me), as it only ends up in one folder and so the other person misses it (of course, we could check each other inboxes but rarely have the time to do so).

I know I could sign up for a family account. But that's much more expensive now, and I don't need the extra functionality. Just some way of directing incoming emails that are addressed to more than one of us into more than one folder/inbox?

Any suggestions gratefully appreciated.
dgittings is offline   Reply With Quote

Old 18 Aug 2017, 07:11 PM   #2
misc
Essential Contributor
 
Join Date: Jul 2013
Location: Germany
Posts: 251
Hi dgittings!

An easy approach would be a simple forwarding rule. As FastMail supports plus addressing and folder matching, you could forward your mails to [username]+[foldername]@fastmail.com.

Here you can find out more about this here: www.fastmail.com/help/receive/addressing.html

Cheers,
Michael
misc is offline   Reply With Quote
Old 18 Aug 2017, 07:35 PM   #3
dgittings
Junior Member
 
Join Date: Mar 2003
Location: Hong Kong
Posts: 23
Many thanks, I will give that a go
dgittings is offline   Reply With Quote
Old 19 Aug 2017, 07:15 AM   #4
SideshowBob
Essential Contributor
 
Join Date: Jan 2017
Posts: 278
If you are going to do this you may want to turn-off conversations.

I turned it off years ago because if it's turned-on and you delete an email from webmail all of the copies of that email are deleted.
SideshowBob is offline   Reply With Quote
Old 20 Aug 2017, 02:03 AM   #5
dsemf
Member
 
Join Date: Mar 2014
Posts: 33
Quote:
Originally Posted by SideshowBob View Post
If you are going to do this you may want to turn-off conversations.

I turned it off years ago because if it's turned-on and you delete an email from webmail all of the copies of that email are deleted.
On the web interface, you can delete individual copies using the More button.

On one email list I get a copy of what I posted. I select the Sent version and delete it. This way the conversation does not have duplicate emails.

DS
dsemf is offline   Reply With Quote
Old 21 Aug 2017, 11:58 PM   #6
jhollington
Essential Contributor
 
Join Date: Apr 2008
Posts: 371
Quote:
Originally Posted by dgittings View Post
Is there some way of writing a rule so that copies of an incoming email are filtered into multiple folders? Perhaps in sieve? (although I'm not really very familiar with sieve) I've spent ages puzzling over this, but haven't figured out a way of doing this so far?
The forwarding method that misc describes should work fine, and it's kind of a clever workaround without having to delve into Sieve, although it's perhaps not as "clean" of a setting under the hood, as you won't be getting an exact copy of the message in terms of headers — the second one will be a message that you sent back to yourself, and could end up getting processed by other rules or possibly even identified as spam in some cases.

It is possible to do this via Sieve, but you have to do it at least semi-manually. The key is that the "fileinto" directive in Sieve can have a ":copy" parameter added after it to copy the message to a folder, preserving the original. Sieve code to do this would look something like this:

Code:
if address :is "From" "somewhere@somedomain.com" {
  fileinto :copy "INBOX.FirstFolder";
  fileinto "INBOX.Final-Destination";
}
You can have as many "fileinto" directives as you like to copy the message to multiple folders, just using ":copy" on all of them except for the last one, since you'll likely want the last operation to move the message rather than copying it (on the other hand, if you want the message left in your inbox, simply leave any final non-copy line off).

If you're not comfortable crafting Sieve by hand, you can also build the basic rule from the standard "Rules" settings and then just copy and paste it into your own section — all standard rules that you create are displayed in the advanced Sieve editing screen, in the greyed-out blocks between those sections you can edit yourself.

So in that case, you would create a normal rule to move a message to another folder. You'd then go into the "Edit Custom Sieve" code section and find that rule, which should be under "7. Sieve generated for organise rules". You can then just copy and paste it to the editable section below that, add the ":copy" parameter after the "fileinto" and add any other "fileinto" directives you want for copying it to additional folders. Just be sure to go and delete the original "move" rule once you've done this, otherwise that will still take precedence.
jhollington is offline   Reply With Quote
Old 22 Aug 2017, 06:59 AM   #7
joe_devore
Essential Contributor
 
Join Date: Dec 2003
Location: Dover, NH, USA
Posts: 315
Quote:
Originally Posted by misc View Post
Hi dgittings!

An easy approach would be a simple forwarding rule. As FastMail supports plus addressing and folder matching, you could forward your mails to [username]+[foldername]@fastmail.com.

Here you can find out more about this here: www.fastmail.com/help/receive/addressing.html

Cheers,
Michael
WOW it actually works...
joe_devore is offline   Reply With Quote
Old 23 Aug 2017, 12:52 PM   #8
SideshowBob
Essential Contributor
 
Join Date: Jan 2017
Posts: 278
Quote:
Originally Posted by jhollington View Post
Code:
if address :is "From" "somewhere@somedomain.com" {
  fileinto :copy "INBOX.FirstFolder";
  fileinto "INBOX.Final-Destination";
}
You can have as many "fileinto" directives as you like to copy the message to multiple folders, just using ":copy" on all of them except for the last one, since you'll likely want the last operation to move the message rather than copying it (on the other hand, if you want the message left in your inbox, simply leave any final non-copy line off).
The point of :copy is that it prevents fileinto turning-off the "implicit keep". It doesn't do anything in the above example because the second fileinto doesn't have :copy.

"Implicit keep" means that an email goes to the Inbox (or alternate default folder) if no other action is defined.
SideshowBob is offline   Reply With Quote
Old 23 Aug 2017, 11:17 PM   #9
jhollington
Essential Contributor
 
Join Date: Apr 2008
Posts: 371
Quote:
Originally Posted by SideshowBob View Post
The point of :copy is that it prevents fileinto turning-off the "implicit keep". It doesn't do anything in the above example because the second fileinto doesn't have :copy.

"Implicit keep" means that an email goes to the Inbox (or alternate default folder) if no other action is defined.
Well, it works fine for all practical purposes, and in this case you do want the implicit "Keep" to be turned off in the second case unless you want the e-mail to be left in the inbox.

That said, now that I think about it, you're right that the ":copy" is redundant in this particular case — the two "fileinto" directives would have the same effect without ":copy" so there's technically no need to include it. That said, it does help make the logic of the Sieve construct more clear visually, however, since most people expect "fileinto" to be a move rather than a copy (as evidenced by the fact that, despite a decade of experience with Sieve, I automatically assumed it was necessary until your response actually made me take a step back and think it through again and have a "lightbulb" moment ).
jhollington is offline   Reply With Quote
Old 24 Aug 2017, 12:03 AM   #10
SideshowBob
Essential Contributor
 
Join Date: Jan 2017
Posts: 278
If anything I think it confuses things because neither fileinto nor keep are moving or copying, they are both deliveries.

The implicit keep addresses a problem that existed in procmail where mail gets lost if you don't specify what to do with it, sieve avoids this by keeping by default. The copy extension was added because sometimes you want to do something like redirecting everthing to another account which would have the side-effect of removing that safety-net.

From RFC 3894:

"Adding ":copy" to an action suppresses cancellation of the default "inbox" save. It
allows users to add commands to an existing script without changing
the meaning of the rest of the script."
SideshowBob is offline   Reply With Quote
Old 24 Aug 2017, 12:17 AM   #11
jhollington
Essential Contributor
 
Join Date: Apr 2008
Posts: 371
Quote:
Originally Posted by SideshowBob View Post
If anything I think it confuses things because neither fileinto nor keep are moving or copying, they are both deliveries.
Sure, and I understand that under-the-hood aspect (once I thought about it), but I think the perception of the "fileinto" directive by the non-technical user is that it's a move operation. That's even the way I've always thought about it by default (hence my superfluous use of ":copy" above), since unless you're crafting complex Sieve rules, the disabling of implicit "keep" effectively does make it a "move" operation for all intents and purposes — it's just that the final "move" doesn't occur until the Sieve script actually ends (hence the use of "stop;" in most Sieve code blocks).

Let's face it, most users are probably just using very simple constructs with a single "fileinto" directive, and ergo, it's going to be perceived as a "move" in those cases. This is only emphasized further by the fact that FastMail (and other ManageSieve type extensions) often display these as "move" rules in their user interface as well (although ironically, it's only because FastMail constructs if/elsif blocks for multiple "organize" rules that they run in isolation of each other ).

So again, it's really an issue of perception, but I'll definitely agree that if somebody is writing Sieve scripts by hand, they should understand the ramifications of what they're doing when using directives like "fileinto" — I've seen more than a few people hurt themselves (myself included back in the day ), by failing to put a "stop" at the end of a "fileinto" block
jhollington is offline   Reply With Quote
Old 25 Aug 2017, 11:41 PM   #12
SideshowBob
Essential Contributor
 
Join Date: Jan 2017
Posts: 278
:copy is something that's very useful and deserves to be properly understood. Using it gratuitously as bogus syntactic sugar benefits no-one.

I say bogus because it falls apart even in trivial examples, e.g. what do you do with this:

Code:
if <test1>{
  fileinto <folder1>
} 
if <test2>{
  fileinto <folder2>
}
Move and copy is not a good metaphor for how sieve actions work, and even to the limited extent it works it's dynamic, not static.
SideshowBob is offline   Reply With Quote
Old 25 Aug 2017, 11:53 PM   #13
jhollington
Essential Contributor
 
Join Date: Apr 2008
Posts: 371
Exactly, and that's a classic example of a situation where somebody might hurt themselves by incorrectly assuming that "fileinto" equals a "move" and therefore not putting a "stop" in the appropriate place.

Semantically, it really doesn't help that the word "copy" is used, either, which just adds to the confusion.

To be clear, I agree with you completely — please don't think I was trying to defend my approach as correct so much as I was trying to explain why I made the mistake in the first place, and why it may (incorrectly) seem like a more logical construct to the Sieve novice — hence all the more reason it needs to be explained, and your jumping in to clarify is much appreciated.
jhollington 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 03:41 PM.

 

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