![]() |
|
FastMail Forum All posts relating to FastMail.FM should go here: suggestions, comments, requests for help, complaints, technical issues etc. |
![]() |
|
Thread Tools |
![]() |
#1 |
Junior Member
Join Date: Nov 2022
Posts: 4
|
Calling webhook / get request from Sieve script
Sorry if this has been asked before, but is it possible to directly issue a get request from a Sieve script in Fastmail? Any code sample would be amazing! I'm trying to no longer have to rely on IFTTT for some home automation stuff. Thanks!
|
![]() |
![]() |
![]() |
#2 |
The "e" in e-mail
Join Date: May 2003
Location: mostly in Thailand
Posts: 3,074
|
I am not sure exactly what you hope to achieve. However, in general (and with very limited exceptions) sieve scripts are designed only to operate directly on the received email itself. Part of its value is that sieve script functionality can rarely involve security risks for that reason. It almost certainly will not directly implement the functionality you have in mind. You may be able to simplify certain tasks. Creative uses of forwarding email copies or generating "vacation" responses based on conditions detected within messages can sometimes replace a lot of complex logic elsewhere. However, sieve scripts are, by design, extremely restricted in the direct side effects they are allowed to have.
|
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Nov 2022
Posts: 4
|
Thanks for the quick response. Here's what I'm trying to achieve: my alarm system doesn't allow integration with home automation systems (such as SmartThings or Home Assistant), therefore the only way I found to capture alarm status changes (armed home, away, off) is to have the system send an email notification to my fastmail account. I have a Sieve script that deciphers the content of the email, and forward a trigger email to an IFTTT trigger, that trigger in return invokes a webhook on my Home Assistant instance to set the Alarm System status accordingly. I want to bypass the IFTTT step entirely and ideally call the webhook (get request to a specific URL) directly from sieve/fastmail. Thanks.
|
![]() |
![]() |
![]() |
#4 | |
The "e" in e-mail
Join Date: May 2003
Location: mostly in Thailand
Posts: 3,074
|
Quote:
|
|
![]() |
![]() |
![]() |
#5 | |
Essential Contributor
Join Date: Dec 2017
Location: Scotland
Posts: 474
|
Quote:
You could possibly do something like this if you ran your own mail server somewhere and sent the notification mails to it. Then - assuming that the server had the ability to run custom code to process all or selected incoming emails - you could program it accordingly. |
|
![]() |
![]() |
![]() |
#6 |
Junior Member
Join Date: Nov 2022
Posts: 4
|
Thanks all for the responses. I do understand that Sieve scripts run on FM's servers, all I was looking for is whether there is a way for these scripts to invoke a URL... I already wrote a pretty complex Sieve script to detect my alarm system's automated emails, extract key information from these emails (is the system being armed, disarmed, etc.) and forward to IFTTT's email endpoint to trigger the webhook call from there. None of that is rocket science but if I could remove a step and directly invoke the webhook URL from Sieve, then it would make things more reliable and performant (again by removing the IFTTT link from the chain). I'm not expecting to have Sieve/FM run arbitrary code on their servers, just letting me "poke" a webhook URL through get/post request. Apparently that's not possible. Thanks again for the responses!
|
![]() |
![]() |
![]() |
#7 | |
Essential Contributor
Join Date: Dec 2017
Location: Scotland
Posts: 474
|
Quote:
Where do you suppose a GET request would put the data returned by the remote server? Suppose they allowed POST requests? Then their server would be attempting to update locations on third-party webservers. Can you not see that that could be misused, and perhaps cause FM to have their servers blocked? |
|
![]() |
![]() |
![]() |
#8 |
Cornerstone of the Community
Join Date: Jun 2004
Location: Rupert, WV
Posts: 863
|
Perhaps this add-on could be used? https://quickfilters.quickfolders.org/filtaquilla.html
Of course, an add-on such as this can only be used in an email client and only when that client is running. - Bruce |
![]() |
![]() |
![]() |
#9 |
The "e" in e-mail
Join Date: Oct 2002
Location: Holon, Israel.
Posts: 4,746
|
FM already issues get requests when a user opens an email message that contains external images: they issue an http get request and host the retrieved content on fastmailusercontent.com.
So if fetching data from a url counts as running arbitrary code, then FM allows anyone that can send email to FM users to run arbitrary code on their server (and not just arbitrary code that FM users create). |
![]() |
![]() |
![]() |
#10 | |
Junior Member
Join Date: Nov 2022
Posts: 4
|
Quote:
In any case, I get from this thread that this is not something that is going to be possible with FM, so for now I will continue using IFTTT as my intermediate stage to translate emails forwarded from FM into webhook calls, and I'll keep looking for other options, including switching to gmail and investigating building a gmail script to do what I'm trying to accomplish here. Thanks all again! |
|
![]() |
![]() |
![]() |
#11 |
Cornerstone of the Community
Join Date: Jun 2004
Location: Rupert, WV
Posts: 863
|
Here is another TBird add-on which may or may not (probably the latter) be of use to you. Scriptable Notifications - https://addons.thunderbird.net/eN-US...notifications/
- Bruce |
![]() |
![]() |
![]() |
Thread Tools | |
|
|