|
FastMail Forum All posts relating to FastMail.FM should go here: suggestions, comments, requests for help, complaints, technical issues etc. |
|
Thread Tools |
26 Sep 2016, 05:07 PM | #1 |
Junior Member
Join Date: Nov 2014
Posts: 12
|
Sieve notify script -- two questions
I have made a very basic and simple sieve script to send a summary notification (without the body text) to my_target_email_address whenever an email is received from any xyz.com email address.
Code:
if address :matches "From" "*xyz.com" { notify :method "mailto" :options ["my_target_email_address", "From", "Orig"] :message "$from$ / [Notify from $from$] $subject$ / "; } From: abc@xyz.com Subject: (*1) [Notify from abc@xyz.com] Abracadabra I have two questions. 1. Why does the subject line start with "(*1)"? Is there any way to suppress it? 2. Since I am looking for all emails from a certain domain, which of the following criteria is efficient (or preferred)? Code:
if address :matches "From" "*xyz.com" Code:
if address :domain :is "From" "xyz.com" |
26 Sep 2016, 05:24 PM | #2 |
The "e" in e-mail
Join Date: May 2003
Location: mostly in Thailand
Posts: 3,093
|
On your second question, best of all is probably
Code:
if address :domain :is "From" "xyz.com" |
26 Sep 2016, 09:40 PM | #3 | |
Cornerstone of the Community
Join Date: Jun 2004
Location: Rupert, WV
Posts: 880
|
Quote:
-bruce |
|
26 Sep 2016, 11:06 PM | #4 | ||
Junior Member
Join Date: Nov 2014
Posts: 12
|
Quote:
Quote:
|
||
26 Sep 2016, 11:25 PM | #5 |
Junior Member
Join Date: Nov 2014
Posts: 12
|
Bruce, this can't be the case as I have just tested the sieve with several unread emails present in both inboxes (source and target). I am sure that the "(*1)" subject prefix is generated by the sieve processor for some specific -- and, to me, unknown -- reason.
|
27 Sep 2016, 07:04 AM | #6 | ||
The "e" in e-mail
Join Date: May 2003
Location: mostly in Thailand
Posts: 3,093
|
Quote:
Referring to the documentation at https://www.fastmail.com/help/techni...ve-notify.html, the Subject line is supposed to be <from> <subject> Quote:
You could report this, but I would expect you to have a fairly long wait for a fix. Sieve support is not a priority for Fastmail these days. More promising, I think, is to fiddle with the options (such as by explicitly specifying a default, for instance) to see if that causes the parsing error to go away. |
||
27 Sep 2016, 11:14 AM | #7 | |
Intergalactic Postmaster
Join Date: May 2004
Location: Irving, Texas
Posts: 8,927
|
Notify loop detection logic
The subject starts with (*1) because Fastmail uses this as an email loop indicator for such messages. As I say in this post:
Quote:
Bill |
|
28 Sep 2016, 12:44 AM | #9 | |
Junior Member
Join Date: Nov 2014
Posts: 12
|
Quote:
During the course of experimentation a couple of days ago, I used to get notification emails without this (*1) thing. I just tried to replicate the earlier results and here are the scripts to suppress this dreaded prefix at the expense of not getting the original email address in the From field. This was achieved by removing , "From", "Orig" from : options. As earlier, it is assumed that an email is sent from abc@xyz .com to my_fastmail_address with the subject line "Abracadabra". Code:
if address :matches "From" "*xyz.com" { notify :method "mailto" :options ["my_target_email_address"] :message "$from$ / [Notify from $from$] $subject$ / "; } From: my_fastmail_address Subject: (from abc@xyz .com) [Notify from abc@xyz .com] Abracadabra Note the sieve processor has added (from abc@xyz .com). The second script gets rid of $from$ from :message. Code:
if address :matches "From" "*xyz.com" { notify :method "mailto" :options ["my_target_email_address"] :message " / [Notify from $from$] $subject$ / "; } From: my_fastmail_address Subject: [Notify from abc@xyz .com] Abracadabra Last edited by Nafri : 28 Sep 2016 at 09:44 PM. |
|
28 Sep 2016, 11:29 PM | #10 | |||
Junior Member
Join Date: Nov 2014
Posts: 12
|
Please correct me if I am wrong but I think that the description given on fastmail's help page entitled Sieve Notify extension is at odds with the implementation of sieve notify extension. Some examples:
- For :message <text>, the help page says that the <text> can be one of these two: Quote:
Quote:
The documentation for the first option reads like as if the sieve processor will itself insert "Notify from". Actually it will gladly insert whatever text one provides through a string in the <subject> part of <text>. - On the notification loop checking, the documentation says the following: Quote:
|
|||
29 Sep 2016, 07:36 AM | #11 |
Intergalactic Postmaster
Join Date: May 2004
Location: Irving, Texas
Posts: 8,927
|
I am again asking Fastmail staff about their plans to rework the Sieve notify feature.
Bill Last edited by n5bb : 29 Sep 2016 at 07:50 AM. |
29 Sep 2016, 09:02 AM | #12 | |
The "e" in e-mail
Join Date: Jul 2004
Location: Melbourne, Australia
Posts: 2,696
Representative of:
Fastmail.fm |
Quote:
We have a major project working on the Cyrus server for the next 2 months, because Robert S is coming over from Austria to spend October and November co-working with us in the FastMail offices and concentrating on JMAP work. We're also planning to add the ability to re-process messages through sieve again - in particular to handle the use-case where a message was delivered to Spam but is actually legitimate, so the "report Not-Spam" will cause it to be delivered to the correct folder rather than dumped in Inbox. Support for RFC 5435 (aka "enotify", rather than the pre-standard "notify" that we currently have) is not an immediate priority, largely because we'd have to rewrite all existing scripts! Annoyingly the earlier draft which our server is based on uses the same keyword, so you can't mix the two styles together! I do want to go through cyrus-imapd and find all the draft standards that we're implementing where there's an actual standard, but I can't bump that up above all the other really important work. I'm in the middle of a massive redesign of some internals to allow greater than 32bit cache sizes and label support on messages for JMAP. That's going to have to take priority! Sorry. Regarding the (*1) we need a way to catch mail loops through external systems which strip headers, which is why we're modifying the subject. Mail forwarding and automated creation is fraught, and mail loops suck They tend to be the things that wake us up with a middle of the night page and everything stuck for many other users - it's hard to justify changing it. |
|
29 Sep 2016, 09:50 AM | #13 |
Intergalactic Postmaster
Join Date: May 2004
Location: Irving, Texas
Posts: 8,927
|
We appreciate the update, Bron.
Mail loops can be horrible! A few months someone at my company did a reply-all to an automated IT "we will respond later when we have it figured out" message, and they added a large group of the CC list. I'm not sure if it was "out of office" auto-responses or something else which triggered the problem, but every few minutes the IT auto-responder sent out another blast to many dozens of recipients, and each message had an additional "user response" tacked to the bottom. I guess the IT auto-responder was adding it's own response to the user comments. This happened on a weekend or overnight, and the number of auto-replies was also increasing. So one auto-reply turned into two longer auto-replies then three even longer auto-replies. By the time a human IT person saw the mess, our email inboxes were filled with pages of increasingly long junk messages. By the way, Rob M had told me several years ago (2010 or earlier, I think) that tweaks had been made to the Sieve notify feature for some customers. The side effect of these (and the vague old Sieve notify spectication) has led to requiring users to experiment to discover the secret tricks. My suggestion is to throw everything away and start over from scratch with something which meets modern RFC's. Bill |
29 Sep 2016, 09:56 AM | #14 | |
The "e" in e-mail
Join Date: May 2003
Location: mostly in Thailand
Posts: 3,093
|
Quote:
I appreciate why the notify header cleanup is down the priority list. To be honest, my priority (if sieve was going to get attention) would be editheader. However, purely academic, rather than changing the Subject header, for loop detection, would it not make more sense just to use a separate header like x-loop-detect or something? |
|
29 Sep 2016, 10:07 AM | #15 | |
Intergalactic Postmaster
Join Date: May 2004
Location: Irving, Texas
Posts: 8,927
|
Quote:
Bill |
|