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 9 Oct 2019, 08:54 PM   #1
JeremyNicoll
Essential Contributor
 
Join Date: Dec 2017
Location: Scotland
Posts: 483
Does FM's 'How to use Sieve' page have an error on it?

I was reading through: https://www.fastmail.com/help/techni...tml?u=cd9841d4

I think one part is wrong, namely the text about using ":count" in the "Comparators" section. They say:
Here's some sample code: address :count "lt" :comparator "i;ascii-numeric" ["to", "cc"] "5". This tests if the total number of To and CC fields is less than 5 (Note that this tests the fields in the message, not the addresses in those fields. Indeed, this test will always be true if the message is RFC 2822 compliant).
I think they've got this the wrong way round. Their sample
address :count ...
/does/ count the number of addresses contained in the email's TO and CC headers... I think they should have put
header :count ...

The reference to RFC-compliance is because the RFC says that an email should only ever have at most one TO header and at most one CC header, so the count of the number of those headers should always be 0, 1 or 2, ie always less than 5.

Amazingly FM even include an 'always be true' link to the appropriate part of the RFC5231 description of ":count" where there's an example that (to my mind) directly contradicts their own advice. The example in the RFC says:
The test:

header :count "ge" :comparator "i;ascii-numeric"
["to", "cc"] ["3"]

will always evaluate to false on an RFC 2822 compliant message
[RFC2822], since a message can have at most one "to" field and at
most one "cc" field. This test counts the number of fields, not the
number of addresses.


I'll raise this with FM... unless someone here says I have misunderstood.
JeremyNicoll is offline   Reply With Quote

Old 9 Oct 2019, 11:02 PM   #2
SideshowBob
Essential Contributor
 
Join Date: Jan 2017
Posts: 278
Preferably, a code example shouldn't be an example of a pointless use, so it wouldn't be sensible to change the example to fit the text.

The author seems a bit confused about the word "field". :count is counting the number of fields, not the number of items within a field.
SideshowBob is offline   Reply With Quote
Old 14 Oct 2019, 08:16 PM   #3
JeremyNicoll
Essential Contributor
 
Join Date: Dec 2017
Location: Scotland
Posts: 483
Ticket raised.
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:04 PM.

 

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