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 19 Sep 2023, 01:38 AM   #1
requ1red
Junior Member
 
Join Date: Aug 2016
Posts: 4
mail rues: sieve code: notifications

Hello,

thanks to anyone who might be helping me with answering this question:

In the bottommost code box on the advanced sieve edit page in Fastmail settings, there's the following code (I have changed the email addresses)

Code:
if not string :is "${deletetotrash}" "Y" {
if header :contains ["to", "cc", "resent-to"] "x@fastmail.net" {
  notify :options ["Text","Only"] :message "/ New email from $from$ arrived at x@fastmail.net/ New email from $from$ arrived at x@fastmail.net" "mailto:my@mailaddress.com";
}

}
Does this show up for everybody? Is there something about this code that can only be achieved by manually entering it as opposed to using the filter creation interface?
requ1red is offline   Reply With Quote

Old 19 Sep 2023, 03:29 AM   #2
requ1red
Junior Member
 
Join Date: Aug 2016
Posts: 4
Ummmm, in might be I did this myself 15 years ago, just sayin'. ....
requ1red is offline   Reply With Quote
Old 24 Sep 2023, 07:18 AM   #3
n5bb
Intergalactic Postmaster
 
Join Date: May 2004
Location: Irving, Texas
Posts: 8,908
Sorry for the delay - I just noticed your thread several days after you posted.

In the Edit custom Sieve code screen, the user-editable code sections have a white background while the automatically generated from rules code has a shaded background. The automatically generated code has automatic comments. Each section of automatic code starts with a ### comment. If you add a name to each of your rules (a good idea), that rule code will be commented #Rule your rule name.

The example you gave is for notification of new messages sent to a specific address. But it doesn’t look like the current code, and my guess is that you wrote it from scratch yourself.

In the Fastmail Rules interface you can specify to receive a notification in the browser or iOS/Android app when that rule catches a specific message. But the code you posted sends a notification email (not a browser or app pop up alert), and that would seem only to be of value if you were wanting to be notified of a new message by sending an email to a different email system. For example, there is a mostly obsolete device called a pager which initially could only be activated to sound and/or vibrate an alert when a phone call was placed to the pager telephone number. After email became popular, some systems could also be triggered by sending an email to a particular address for that pager. Similarly, you might have wanted for new messages sent to a specific Fastmail address to trigger a notification in your Gmail or other email account.

The current Fastmail automatic Sieve code adds the $notify flag when that box is selected in a rule. But you won’t find any code in the Sieve script which executes a RFC5435 notification (the top of Sieve script “enotify” entry). So the Fastmail internal code which executes your Sieve script must examine the $notify flag after the script terminates and if set a notification is sent.

I hope this helps. Several years ago I switched from a long custom Sieve script to using the rules system for nearly all of my needs. The advantages of using the normal rules system include:
  • Easier maintenance, especially if you give each rule an informative name
  • You can add a new rule and easily search for matching messages, then cause the actions in the rule to be applied to those existing messages, as well as new messages. So you can add a new label/folder, create a rule to use that new label/folder, and refile existing messages based on that new rule.
  • Editing label/folder names automatically changes the associated rules. If you create manual Sieve code, you must be very careful not to change label/folder names without fixing all manually created code.
Bill
n5bb 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 12:38 PM.

 

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