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 29 Dec 2019, 03:06 PM   #1
TheJapanese
Member
 
Join Date: Apr 2016
Posts: 63
Issues with Rules / not in INBOX?

Hi,

I have some issues with the rules section.

I do have a main mail-address and an alias.

I created a rule, which sorts all mails coming to [email protected] to a subfolder (works like a charm).

But if I get a message like:
To: [email protected]
CC: [email protected]

The mail is visible within the subfolder (defined by the rule), but 'not' in my INBOX.

Why does it happen and what can I do, as I wrote the mail to [email protected] and [email protected]?

Hope to get some help over here?
TheJapanese is offline   Reply With Quote

Old 29 Dec 2019, 06:34 PM   #2
JamesHenderson
Cornerstone of the Community
 
Join Date: Jan 2003
Location: Oxfordshire, UK
Posts: 506
the sieve action fileinto is a *move* (not *copy*) action.

If your test only looks for the presence of **[email protected]** (and not last the absence of **[email protected]**) and then **moves** it to the subfolder, there would be no logic to do something different if the email also contains **[email protected]**.

Can you please share your sieve?

[edit: typos and clarification]
JamesHenderson is offline   Reply With Quote
Old 29 Dec 2019, 07:45 PM   #3
xyzzy
Essential Contributor
 
Join Date: May 2018
Posts: 200
I assume you created a rule that moves a email that matches the alias on the to or cc to place in your alias subfolder. If so that has precedence over the default which would move to the inbox. Using the Rules UI you cannot explicitly file a single message into two mailboxes. But you can by explicitly writing it in the sieve code.

For example, assuming your current rule is,

Code:
Any "Cc" email address is exactly [email protected]
with an action to move to your subfolder then the generated sieve code would be,
Code:
elsif address :is "CC" "[email protected]" {
  fileinto "INBOX.subfolder";
}
And thus that's all it will do, i.e., filter the matching message into your subfolder. (the elseif would just be an if if it's the first organize rule)

In order to get this to filter into both your subfolder and inbox you would need to remove the UI organize rule and explicitly add the following sieve code to your sieve script with a small change:
Code:
elsif address :is "CC" "[email protected]" {
  fileinto :copy "INBOX.subfolder";
}
Note the addition of the :copy option to the fileinto. As I said you cannot cause that to happen from the Organize Rules UI. You have to explicitly do it from the sieve code. This causes the message to be sent to the subfolder but it will still be sent to the inbox by default (the addition of :copy does not override the fileinto default to the inbox).

One convenient (and logical) place to add this code might be in the last edit box of the sieve script. This is the area following UI generated organize rules code. There you would also use an elsif (as shown) if it isn't the only organize rule.

Be aware that while you see two copies of the message in the two folders, if I recall, actions performed on one affect the other. For example marking one as read also marks the other as read. I can't recall if deleting one deletes the other (but I think it does). Not sure I like this behavior but it is what it is. Note I haven't had occasion to test this out for a while so maybe this behavior has changed since then.

Note, I am not sure why you would want to send one to a separate folder and the inbox (unless you also are using a POP email client and want it to get it's own copy too -- and not delete the inbox copy from the client) but that's your business and none of mine.

Last edited by xyzzy : 29 Dec 2019 at 09:09 PM.
xyzzy is online now   Reply With Quote
Old 29 Dec 2019, 08:29 PM   #4
JamesHenderson
Cornerstone of the Community
 
Join Date: Jan 2003
Location: Oxfordshire, UK
Posts: 506
Quote:
Originally Posted by xyzzy View Post
Note the addition of the :copy option to the fileinto.
could not, for the life of me, remember how to copy (not move). Thanks :-)

Last edited by JamesHenderson : 30 Dec 2019 at 01:58 AM.
JamesHenderson is offline   Reply With Quote
Old 29 Dec 2019, 11:24 PM   #5
TheJapanese
Member
 
Join Date: Apr 2016
Posts: 63
Thx for your feedback.

I made a standard rule like:
Any "To"/"CC"/"BCC" email-address is [email protected] > Move the message to subfolder 'aliasfolder".

The rule is working.

But like I said, if I get a mail from someone who is writing to my main address ([email protected]) AND to [email protected] then the mail only appears in the subfolder aliasfolder (and is not in my INBOX).

Just to clarify... It's one mailbox with an alias. Not two different mailboxes.

The alias address is a address from my website (contact address). So everyone who writes to this address the mail should be moved to the alias-subfolder.
But it could also be the reason that someone writes to my main-address AND to my alias address (within one mail).

Last edited by TheJapanese : 29 Dec 2019 at 11:28 PM. Reason: explanation added
TheJapanese is offline   Reply With Quote
Old 30 Dec 2019, 02:00 AM   #6
JamesHenderson
Cornerstone of the Community
 
Join Date: Jan 2003
Location: Oxfordshire, UK
Posts: 506
Are you an ex-Gmail user? I ask because in Fastmail, an email cannot be in two folders at the same time. An email can be copied into another folder but then there are two separate (identical) emails.
JamesHenderson is offline   Reply With Quote
Old 30 Dec 2019, 02:03 AM   #7
JamesHenderson
Cornerstone of the Community
 
Join Date: Jan 2003
Location: Oxfordshire, UK
Posts: 506
Quote:
Originally Posted by TheJapanese View Post
Thx for your feedback.

I made a standard rule like:
Any "To"/"CC"/"BCC" email-address is [email protected] > Move the message to subfolder 'aliasfolder".

The rule is working.

But like I said, if I get a mail from someone who is writing to my main address ([email protected]) AND to [email protected] then the mail only appears in the subfolder aliasfolder (and is not in my INBOX).
You need two rules:

Any "To"/"CC"/"BCC" email-address is [email protected] and no "To"/"CC"/"BCC" email-address is [email protected]> move the message to subfolder 'aliasfolder".

Any "To"/"CC"/"BCC" email-address is [email protected] and any "To"/"CC"/"BCC" email-address is [email protected]> copy the message to subfolder 'aliasfolder".

...something like this?
Code:
if address :is ["To","Cc","Bcc"] "[email protected]" {
	if address :is ["To","Cc","Bcc"] "[email protected]" {
		fileinto :copy "INBOX.alias";
	}
	elseif not address :is ["To","Cc","Bcc"] "[email protected]" {
		fileinto "INBOX.alias";
	}
}
(I haven't checked it for errors)

Last edited by JamesHenderson : 30 Dec 2019 at 02:15 AM. Reason: added code example
JamesHenderson is offline   Reply With Quote
Old 30 Dec 2019, 03:15 AM   #8
SideshowBob
Member
 
Join Date: Jan 2017
Posts: 94
Quote:
Originally Posted by JamesHenderson View Post
You need two rules:

Any "To"/"CC"/"BCC" email-address is [email protected] and no "To"/"CC"/"BCC" email-address is [email protected]> move the message to subfolder 'aliasfolder".

Any "To"/"CC"/"BCC" email-address is [email protected] and any "To"/"CC"/"BCC" email-address is [email protected]> copy the message to subfolder 'aliasfolder".
Sieve doesn't really have a distinction between moving and copying. IMO that terminology is more confusing than useful. What :copy does is prevent the action from cancelling the implicit keep which is assumed if you don't tell sieve what to do with an email.

Using :copy doesn't guarantee that a copy goes into the Inbox (or alternate default folder), but an explicit "keep;" after the fileinto does.
SideshowBob is offline   Reply With Quote
Old 30 Dec 2019, 03:26 AM   #9
JamesHenderson
Cornerstone of the Community
 
Join Date: Jan 2003
Location: Oxfordshire, UK
Posts: 506
Quote:
Originally Posted by SideshowBob View Post
Using :copy doesn't guarantee that a copy goes into the Inbox (or alternate default folder), but an explicit "keep;" after the fileinto does.
so...

Code:
if address :is ["To","Cc","Bcc"] "[email protected]" {
	if address :is ["To","Cc","Bcc"] "[email protected]" {
		fileinto "INBOX.alias";
                keep;
	}
	elseif not address :is ["To","Cc","Bcc"] "[email protected]" {
		fileinto "INBOX.alias";
	}
}
?
JamesHenderson is offline   Reply With Quote
Old 30 Dec 2019, 06:24 AM   #10
xyzzy
Essential Contributor
 
Join Date: May 2018
Posts: 200
At fileinto :copy or a fileinto without a :copy plus a keep will both work.

And an update to what I said about the effects of this. Deleting one does not delete the other but marking as read or unread does affect the other.

Just ran some tests on this to verify both these statements.

Last edited by xyzzy : 30 Dec 2019 at 06:30 AM.
xyzzy is online now   Reply With Quote
Old 30 Dec 2019, 07:57 AM   #11
SideshowBob
Member
 
Join Date: Jan 2017
Posts: 94
Quote:
Originally Posted by xyzzy View Post
At fileinto :copy or a fileinto without a :copy plus a keep will both work.
The latter will always work, the former depends on the rest of the script.

The point of :copy is that "implicit keep" is an important safety-net and sometimes you want to redirect or fileinto without the side-effect of canceling it. For example, you may want to redirect email to another account without the risk of not have a local copy in your own account.


Quote:
And an update to what I said about the effects of this. Deleting one does not delete the other but marking as read or unread does affect the other.

Just ran some tests on this to verify both these statements.
I think it depends on your settings. It used to be the case that setting Group messages with their replies would cause deletions from webmail to be global, now if you set that you get an additional tick-box Delete grouped messages from all folders.
SideshowBob is offline   Reply With Quote
Old 30 Dec 2019, 08:13 AM   #12
JamesHenderson
Cornerstone of the Community
 
Join Date: Jan 2003
Location: Oxfordshire, UK
Posts: 506
Quote:
Originally Posted by SideshowBob View Post
...and sometimes you want to redirect or fileinto without the side-effect of canceling it. For example, you may want to redirect email to another account without the risk of not have a local copy in your own account.
Can you expand on this as I didnít fully understand it; why would redirect make fileinto :copy not work?
JamesHenderson is offline   Reply With Quote
Old 30 Dec 2019, 02:45 PM   #13
TheJapanese
Member
 
Join Date: Apr 2016
Posts: 63
Oh my god - thought that it isn't that kind of a problem?

As I send to two different aliases I thought, this does work without a problem... But looks like it is really really complicated.
TheJapanese is offline   Reply With Quote
Old 30 Dec 2019, 04:47 PM   #14
JamesHenderson
Cornerstone of the Community
 
Join Date: Jan 2003
Location: Oxfordshire, UK
Posts: 506
Quote:
Originally Posted by TheJapanese View Post
Oh my god - thought that it isn't that kind of a problem?

As I send to two different aliases I thought, this does work without a problem... But looks like it is really really complicated.
It's really not that complicated.

You are asking for 2 things:
  • an email to be in two seperate folders if it is sent to two people (you and your alias) which means copying/duplicating the email to the alias folder (and leaving the original in the inbox).
  • an email to be in a single folder if sent to one person (alias) and not the other (you) which means moving (to the alias folder).
JamesHenderson is offline   Reply With Quote
Old 30 Dec 2019, 06:38 PM   #15
TheJapanese
Member
 
Join Date: Apr 2016
Posts: 63
Quote:
Originally Posted by JamesHenderson View Post
It's really not that complicated.

You are asking for 2 things:
  • an email to be in two seperate folders if it is sent to two people (you and your alias) which means copying/duplicating the email to the alias folder (and leaving the original in the inbox).
That's what I want. Which sieve script do I have to use?
TheJapanese 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 05:36 PM.

 

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