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, 09:46 PM   #16
JamesHenderson
Cornerstone of the Community
 
Join Date: Jan 2003
Location: Oxfordshire, UK
Posts: 603
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, 01:09 AM   #17
SideshowBob
Essential Contributor
 
Join Date: Jan 2017
Posts: 278
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, 01:21 PM   #18
TheJapanese
Member
 
Join Date: Apr 2016
Posts: 79
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, 04:14 PM   #19
JamesHenderson
Cornerstone of the Community
 
Join Date: Jan 2003
Location: Oxfordshire, UK
Posts: 603
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"] "alias@domain.de" {
	if address :is ["To","Cc","Bcc"] "main@domain.de" {
		fileinto "INBOX.alias";
                keep;
	}
	elseif not address :is ["To","Cc","Bcc"] "main@domain.de" {
		fileinto "INBOX.alias";
	}
}
Could someone check may logic and syntax etc?
JamesHenderson is offline   Reply With Quote
Old 11 Jan 2020, 02:39 PM   #20
TheJapanese
Member
 
Join Date: Apr 2016
Posts: 79
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"] "alias@domain.de" {
	if address :is ["To","Cc","Bcc"] "main@domain.de" {
		fileinto "INBOX.alias";
                keep;
	}
	elseif not address :is ["To","Cc","Bcc"] "main@domain.de" {
		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, 10:42 PM   #21
SideshowBob
Essential Contributor
 
Join Date: Jan 2017
Posts: 278
Quote:
Originally Posted by JamesHenderson View Post
Code:
if address :is ["To","Cc","Bcc"] "alias@domain.de" {
	if address :is ["To","Cc","Bcc"] "main@domain.de" {
		fileinto "INBOX.alias";
                keep;
	}
	elseif not address :is ["To","Cc","Bcc"] "main@domain.de" {
		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

john@example.com to username+john.example.com@fastmail.com

you can filter on the latter address without missing mail that was BCCed to the former.
SideshowBob is offline   Reply With Quote
Old 15 Jan 2020, 11:18 PM   #22
JamesHenderson
Cornerstone of the Community
 
Join Date: Jan 2003
Location: Oxfordshire, UK
Posts: 603
That’s very helpful - thanks!
JamesHenderson is offline   Reply With Quote
Old 17 Jan 2020, 10:45 PM   #23
JeremyNicoll
Essential Contributor
 
Join Date: Dec 2017
Location: Scotland
Posts: 484
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 02:27 PM.

 

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