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 6 Jul 2017, 04:32 AM   #1
edu
Senior Member
 
Join Date: Jun 2016
Posts: 194
Sieve rule to send notification

Hello, I need your help.

I normally send a notification to another email address when I receive email in Fastmail. I didn't know how to do it and the rule I made is not good but at least I know what happens when I receive the notification by email.

Can you help me to make this rule better and working as it should be?.

Actually my rule is:

if address :contains ["to"] "@"
{
notify :method "mailto" ptions ["xxx@xxx.com"] :message "New Email";
}

Sorry, before "ptions" you should see an "o" and 2 points ":" but in this forum the combination results in an icon
Thanks

Last edited by edu : 6 Jul 2017 at 04:56 AM.
edu is offline   Reply With Quote

Old 6 Jul 2017, 06:19 AM   #2
jhollington
Essential Contributor
 
Join Date: Apr 2008
Posts: 371
Looking at that rule I can't see any reason why it shouldn't be working.... what's the specific problem you're having with it?
jhollington is offline   Reply With Quote
Old 6 Jul 2017, 06:30 AM   #3
edu
Senior Member
 
Join Date: Jun 2016
Posts: 194
Quote:
Originally Posted by jhollington View Post
Looking at that rule I can't see any reason why it shouldn't be working.... what's the specific problem you're having with it?
Too simple and confusing. I receive no subject in the email, and the email telling me that it's coming from ???, the only thing working good is the message. I would like something better.
edu is offline   Reply With Quote
Old 6 Jul 2017, 06:47 AM   #4
jhollington
Essential Contributor
 
Join Date: Apr 2008
Posts: 371
Okay, gotcha.

You can try something more like this, then, if you want the "From" address to be the same as the original e-mail:

Code:
notify :method "mailto" :options ["xxx@xxx.com", "From", "Orig"] :message "$from$ / [New Email] $subject$ / You've got mail!";
Or, alternatively, you could go with something like this if you want to use a specific "from" address for the notifications:

Code:
notify :method "mailto" :options ["xxx@xxx.com", "From", "Orig"] :message "<me@mydomain.com> / [New Email] $subject$ / You've got mail!";
The key is the slashes in the :message directive — it basically takes the form of "from / subject / body." While FastMail's documentation says that if you don't use slashes, the text should go in the subject line, that doesn't actually appear to be the case, but either way, the three-part slashed option seems to be the only realistic way to do this anyway, as you've discovered.

The "From", "Orig" options after the target e-mail address tell FastMail to expand the "$from$" directive to include the name and the e-mail address. Without it, you'll just get the raw e-mail address.

See Sieve Notify Extension in FastMail's help pages for more info.
jhollington is offline   Reply With Quote
Old 6 Jul 2017, 07:31 AM   #5
edu
Senior Member
 
Join Date: Jun 2016
Posts: 194
Thank you very much, I will test it

Quote:
Originally Posted by jhollington View Post
Okay, gotcha.

You can try something more like this, then, if you want the "From" address to be the same as the original e-mail:

Code:
notify :method "mailto" :options ["xxx@xxx.com", "From", "Orig"] :message "$from$ / [New Email] $subject$ / You've got mail!";
Or, alternatively, you could go with something like this if you want to use a specific "from" address for the notifications:

Code:
notify :method "mailto" :options ["xxx@xxx.com", "From", "Orig"] :message "<me@mydomain.com> / [New Email] $subject$ / You've got mail!";
The key is the slashes in the :message directive — it basically takes the form of "from / subject / body." While FastMail's documentation says that if you don't use slashes, the text should go in the subject line, that doesn't actually appear to be the case, but either way, the three-part slashed option seems to be the only realistic way to do this anyway, as you've discovered.

The "From", "Orig" options after the target e-mail address tell FastMail to expand the "$from$" directive to include the name and the e-mail address. Without it, you'll just get the raw e-mail address.

See Sieve Notify Extension in FastMail's help pages for more info.
edu is offline   Reply With Quote
Old 6 Jul 2017, 07:49 AM   #6
edu
Senior Member
 
Join Date: Jun 2016
Posts: 194
Conclusions:

1. The first method worked but wiithout sending the email address of FM, agan with ???, maybe that's what FM sends from a private address, I don't know

2.- The second method worked too, and so much better with some change. The problem is that it included in the subject the words New Email. So I deleted that part from the sieve code and all is perfect. But... some strange thing. In the subject always appears this before the text: (*1)

Do you know what could it be?

If not then no problem, it's better now. Maybe another thing from FM to tell me something... Thanks a lot

The final code until now:

Code:
if address :contains ["to"] "@"
{
notify :method "mailto" :options ["xxx@xxx.com", "From", "Orig"] :message "<xxxx@fastmail.com> / $subject$ / Email FM!";

}

xxx in email address is for private reasons.

Thanks!

Quote:
Originally Posted by jhollington View Post
Okay, gotcha.

You can try something more like this, then, if you want the "From" address to be the same as the original e-mail:

Code:
notify :method "mailto" :options ["xxx@xxx.com", "From", "Orig"] :message "$from$ / [New Email] $subject$ / You've got mail!";
Or, alternatively, you could go with something like this if you want to use a specific "from" address for the notifications:

Code:
notify :method "mailto" :options ["xxx@xxx.com", "From", "Orig"] :message "<me@mydomain.com> / [New Email] $subject$ / You've got mail!";
The key is the slashes in the :message directive — it basically takes the form of "from / subject / body." While FastMail's documentation says that if you don't use slashes, the text should go in the subject line, that doesn't actually appear to be the case, but either way, the three-part slashed option seems to be the only realistic way to do this anyway, as you've discovered.

The "From", "Orig" options after the target e-mail address tell FastMail to expand the "$from$" directive to include the name and the e-mail address. Without it, you'll just get the raw e-mail address.

See Sieve Notify Extension in FastMail's help pages for more info.

Last edited by edu : 6 Jul 2017 at 07:55 AM.
edu is offline   Reply With Quote
Old 6 Jul 2017, 08:05 AM   #7
edu
Senior Member
 
Join Date: Jun 2016
Posts: 194
If I delete in the code this: "Orig" then the email is sent from my default FM address, not from the email address I put in the code, and the previous (*1) doesn't appear. So, I keep the last code as I published in my last post.

Maybe (*1) means that it's sent from an alias, I don't know.
It's good to learn
edu is offline   Reply With Quote
Old 6 Jul 2017, 09:09 AM   #8
n5bb
Intergalactic Postmaster
 
Join Date: May 2004
Location: Irving, Texas
Posts: 8,916
Quote:
Originally Posted by edu View Post
...Maybe (*1) means that it's sent from an alias, I don't know...
It's used to help prevent email loops. See:
https://www.fastmail.com/help/techni...l#loopchecking

Bill
n5bb is offline   Reply With Quote
Old 6 Jul 2017, 03:03 PM   #9
edu
Senior Member
 
Join Date: Jun 2016
Posts: 194
Quote:
Originally Posted by n5bb View Post
It's used to help prevent email loops. See:
https://www.fastmail.com/help/techni...l#loopchecking

Bill
Thank you Bill!
edu 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 04:56 PM.

 

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