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 30 Dec 2019, 10:46 PM   #16
JamesHenderson
Cornerstone of the Community
 
Join Date: Jan 2003
Location: Oxfordshire, UK
Posts: 506
Quote:
Originally Posted by TheJapanese View Post
That's what I want. Which sieve script do I have to use?
so, to be clear, you do not want to move the email to the alias folder if it is sent to the alias address only?
JamesHenderson is offline   Reply With Quote
Old 31 Dec 2019, 02:09 AM   #17
SideshowBob
Member
 
Join Date: Jan 2017
Posts: 94
Quote:
Originally Posted by JamesHenderson View Post
Can you expand on this as I didnít fully understand it; why would redirect make fileinto :copy not work?
Because a redirect, by default, cancels the implicit keep.

:copy is misleading, it would have been more accurate to call it :withoutsideeffect.

One of the most serious problems with procmail was that you have to tell it what to do with each email or it will discard it by default. Sieve addressed this with the implicit keep. However if you send an email somewhere outside your normal workflow, when you need to read it locally, you have effectively regressed to the procmail situation.

The copy extension was created to solve that problem by allowing a redirect or fileinto that doesn't cancel the implicit keep.

The problem of sending an email to two folders is easily solved without :copy by two fileintos, or fileinto+keep. You could do it with :copy if you really want to, but there's more that can go wrong.

Quote:
Originally Posted by JamesHenderson View Post
  • ... which means copying/duplicating the email to the alias folder (and leaving the original in the inbox).
  • ... which means moving (to the alias folder).
Again, there is no distinction between moving and copying here. And there isn't an original in the Inbox.
SideshowBob is offline   Reply With Quote
Old 31 Dec 2019, 02:21 PM   #18
TheJapanese
Member
 
Join Date: Apr 2016
Posts: 63
Quote:
Originally Posted by JamesHenderson View Post
so, to be clear, you do not want to move the email to the alias folder if it is sent to the alias address only?
Uh sorry. Yes I want to - misunderstood.
TheJapanese is offline   Reply With Quote
Old 31 Dec 2019, 05:14 PM   #19
JamesHenderson
Cornerstone of the Community
 
Join Date: Jan 2003
Location: Oxfordshire, UK
Posts: 506
no worries!

Then, based ob everything I have understood from this thread, your script should be something like:

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";
	}
}
Could someone check may logic and syntax etc?
JamesHenderson is offline   Reply With Quote
Old 11 Jan 2020, 03:39 PM   #20
TheJapanese
Member
 
Join Date: Apr 2016
Posts: 63
Quote:
Originally Posted by JamesHenderson View Post
no worries!

Then, based ob everything I have understood from this thread, your script should be something like:

Code:
if address :is ["To","Cc","Bcc"] "[email protected]n.de" {
	if address :is ["To","Cc","Bcc"] "[email protected]" {
		fileinto "INBOX.alias";
                keep;
	}
	elseif not address :is ["To","Cc","Bcc"] "[email protected]" {
		fileinto "INBOX.alias";
	}
}
Could someone check may logic and syntax etc?
Hi, I will try it today. Thx for your script.
TheJapanese is offline   Reply With Quote
Old 15 Jan 2020, 11:42 PM   #21
SideshowBob
Member
 
Join Date: Jan 2017
Posts: 94
Quote:
Originally Posted by JamesHenderson View Post
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";
	}
}
You can't actually filter on "Bcc" as it should never appear in incoming mail. If you want to filter reliably based on local addresses, it's best to use the "X-Delivered-to" header which contains the envelope recipient address. If there's more than one local recipient address, Fastmail delivers them separately.

For forwarded mail it's usually best to forward each addresses to a dedicated target address, e.g. if you forward

[email protected] to [email protected]

you can filter on the latter address without missing mail that was BCCed to the former.
SideshowBob is offline   Reply With Quote
Old 16 Jan 2020, 12:18 AM   #22
JamesHenderson
Cornerstone of the Community
 
Join Date: Jan 2003
Location: Oxfordshire, UK
Posts: 506
Thatís very helpful - thanks!
JamesHenderson is offline   Reply With Quote
Old 17 Jan 2020, 11:45 PM   #23
JeremyNicoll
Senior Member
 
Join Date: Dec 2017
Location: Scotland
Posts: 147
Quote:
Originally Posted by SideshowBob View Post
You can't actually filter on "Bcc" as it should never appear in incoming mail.
"Should" is right. But some emails - perhaps not created by 'proper' clients, but built a line at a time (eg in a scripting language) do sometimes contain it. You might almost say that finding such a header could be a good indicator that a mail is spam.

Also, even email clients which properly don't include BCC in sent mails have been known to include it in the logged/sent copy retained by the sender (so the sender can later see who it was BCCed to). If someone resends that, I'm not sure that the client necessarily strips the BCC header out.
JeremyNicoll 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 09:38 AM.

 

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