thsmi / sieve Goto Github PK
View Code? Open in Web Editor NEWSieve Script Editor
License: GNU Affero General Public License v3.0
Sieve Script Editor
License: GNU Affero General Public License v3.0
Sieve throws from time to time when editing a script an syntax error at line 1 called "unexpected string". There is no way getting rid of that message except restarting thunderbird.
This occures almost every time I'm editing the script directly with sieve. If I'm copying some code snippets into it the syntax error does not appear.
Just to make sure here are the first lines of my code:
---SNIP---
require [ "vacation", "regex", "fileinto", "imapflags", "body" ];
if header :contains ["From"] "[email protected]"
{
fileinto "INBOX.xx";
stop;
}
---SNIP---
The sidebar url is hardcoded in SieveFilterEditor.js. Instead the url from the locale file should be used.
Warning: variable request redeclares argument
Source File: chrome://sieve/content/modules/sieve/Sieve.js
Line: 666, Column: 10
Source Code:
var request = requests.shift();
The module doesn't support set variables
e.g.
Error while parsing script.
Unknown Element at: set "start" "2014-02-02";
set "start_txt" "February 2nd";
Thus this is really common to simplify vacation script...
Thunderbird 31 hides the old menu and introduced a new menu button at the right upper corner of its interface. The Sieve menu items under [Menu button] -> [Extras] are missing.
Workaround for now: I can still use it by pressing Alt which unhides the old menu.
Sieve 0.2.2 doesn't work with Mozilla Thunderbird 24. Before this version, it was working well. This version probably introduces some incompatibilities which cause this problem.
Steps to reproduce:
Expected behavior:
A new tab opens and shows filters for the current account. The "Filters for:" combo box contains mail accounts.
Current behavior:
A new tab opens and shows an "in progress" animation. That's all. The combo box meant above is empty.
Hi,
I have some users interrested in using sieve scripts, but the default tes-only interface of the sieve plugin for TB is not usable for them.
Version 0.20 mention a new "drag 'n drop" UI. How can I enable it for my users?
regards.
Some servers dump errors during script execution into a X-header. They should be parsed and displayed to the user.
E.g.:
X-Nemesis-Sieve: missing mailbox "\blubb"
The extension is no longer able to connect. Maybe it has something to do with this JavaScript error that I found in the error console (the original error log entry contained German labels because Iโm using a system with German locale and I tried to correctly translate the labels):
Timestamp: 21.07.15 23:11:51
Error: TypeError: accountManager.allServers.Count is not a function
Source file: chrome://sieve/content/modules/sieve/SieveAccounts.js
Line number: 1222
I imported an existing working sieve script which includes:
if address :regex :comparator "i;ascii-casemap" ["to", "cc"] "j(i|la).*@mydomain.com"
{
fileinto "INBOX";
stop;
}
The server is happy with it and does the right thing, but de-selecting the "Source" button in the Sieve extension results in a popup box with:
Error while parsing script.
[ expected but found:
:regex :comparator "i;ascii-casemap" ["to", "cc"] ...
Does the sieve extension not support :regex at all? Can it be persuaded to do so? I have several other regex rules, this is only one example.
Integrate a simplified GUI into Thunderbird's filter dialog
I recently updated to Thunderbird 38, and the sieve extension does not work anymore. When I click "Manage sieve filters", it just shows a spinning icon "Connecting...", even though the settings did not even change. I verified with Wireshark that not a single package is sent to the server and port used for sieve, so this cannot be a problem with the remote server or the login credentials.
This is using Sieve 0.2.3d, Icedove (Thunderbird in Debian) 38.0.1, with all the other add-ons disabled.
I've been using this addon for years, with great pleasure!
But now we moved on to a new server (Synology), which still uses Sieve as a filter, just not accessible via the normal ports.
I found the sieve script as a file on my home drive. Is it possible to use a file for this addon, instead of the daemon access?
CodeMirror 3 is approaching, the api changed slightly (e.g. Matching Brackets are now a plugin)
So the codebase needs to be updated to be aware of these changes.
After adding a new server to the plugin it shows in my case an SSL warning.
Sadly the plugin does not provide information on that page what the problem is or let the user see the cert to figure out whats going on. In my case a look into the debug log reveals that the problem is that the cert is self signed.
As SSL errors should be taken seriosly the user should not need to open debug log to find the problem.
Hello and thanks for a great plugin!
Is it correct that I can only activate one rule(-set) at any given time? So a "File into Junk" rule made via Sieve in combination with (active at the same time as) a OutOfOffce rule generated via Out Of Office (http://adullact.net/plugins/mediawiki/wiki/milimail/index.php/Out_of_Office) is not possible?
OSX 10.8, Thundebird 17.0.2, Sieve 0.2.2
worked quite before the update.
Tested on two different PCs on Windows 7, with two different mailservers running courier imap. Debug console shows the following errors:
Zeitstempel: 20.07.2015 20:25:13
Warnung: mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create
Quelldatei: chrome://sieve/content/modules/sieve/SieveAccounts.js
Zeile: 427
(This error repeats in several scripts)
Zeitstempel: 20.07.2015 20:25:13
Fehler: uncaught exception: 2147500033
Zeitstempel: 20.07.2015 20:25:13
Fehler: NS_ERROR_NOT_IMPLEMENTED: Method not implemented'Method not implemented' when calling method: [nsIProtocolHandler::newChannel]
Quelldatei: chrome://sieve/content/modules/sieve/Sieve.js
Zeile: 411
I noticed that sieve stores the script with DOS EOLs. Given that most mail servers are Unix derivatives, I think Unix EOLs were more appropriate, although DOS EOLs also work with e.g. dovecot.
When you connect a server through a socks proxy. It doesn't look like the Sieve addon is respecting the proxy configuration defined in Thunderbird.
Please add vnd.dovecot.duplicate extension support.
Installed the nightly build (0.2.3f), now I get:
Last command failed, because the server reported an error:
Failed to override broken certificate.
My Sieve server runs a self-signed cert; I recall having to jump through some hoops with TB to get it talk IMAPS, by setting network.security.ports.banned.override, but that doesn't seem to help here.
Please add support for the vacation extension to the SIEVE protocol.
Thanks!
I cannot connect to my Dovecot managesieve. It worked before, I upgraded my Dovecot from 1.x to 2.0 but after upgrade it worked. Then I fix other things in Dovecot and it stopped working.
I don't believe the problem is in Dovecot. On the server I ran "tcpdump port 4190" to catch connecting from Thunderbird but it never happens now. On desktop where is Thunderdbird is run I tried "telnet mailserver 4190" and it happily connects, reflecting it in tcpdump. So for some reason Thunderdbird Sieve extension don't event try to connect.
When I try "Auto Select Port" button in config dialog, immediately "Selecting Port failed..." is shown and tcpdump hasn't detected network activity. IMAP server is correctly entered.
The Graphical Build window produces a dialog error when "fileinto" is used with ":create". The Source window allows ":create" and the sieve backend allows :create .
The following dialog is shown when ":create" is used:
Here is the source:
#
#2014-3-20
#
require "fileinto";
require "mailbox";
require "imap4flags";
if allof(
anyof(
address :localpart "From" "<omitted>"
, address :localpart "From" "<omitted>"
)
, header :contains "Subject" "Fresh Coffee"
) {
fileinto :create "Trash";
}
Use the Source window to save the script.
Hi,
I have Thunderbird 23 (beta) and your sieve add-on (0.2.2).
I have a Dovecot 2.2.4 server with PigeonHole ManageSieve setup. The sieve add-on connects -- well it appears to -- but nothing ever appears except a spinning circle.
I have confirmed that manually uploaded sieve scripts (using the command line program sieve-connect) work.
What is the best way to go about debugging this?
Thanks,
Anand
I'm not sure when it happened since I don't have to use it often, but I went to add a new filter today and sieve doesn't do anything. The tab opens, and I get a spinner in the middle like it is trying to connect, but it isn't. Both netstat and wireshark show no attempt to connect to the server, and the spinner never times out or anything. Nothing is printed in the error log, even with all of the debug settings checked. I'm using thunderbird 24.1.1 and sieve 0.2.2, and tried removing and reinstalling the plugin already.
Arch Linux
Thunderbird 31.2.0
Sieve 0.2.2
All debug options selected. Zero response in the debug console. Sieve window shows 'wheel of death' and does not respond to any button.
Tried restarting Thunderbird (no change), checked log at server (empty), disabling/enabling add-on.
Hello,
when I connect to our server dovecot-managesieve-0.3.0 in Thunderbird's error console appears the following error:
Timestamp: 05/12/2012 14:47:51
Error: TypeError: this.sessions[sid] is undefined
Source File: chrome://sieve/content/libs/libManageSieve/SieveAbstractClient.js
Line: 193
How could I check this error?
Hello,
I'm using Earlbird (38.0a2) and decided to try the extension as it's a bit tedious to ssh into my mailserver every time I want to change my filters.
Stable version doesn't even seem to load completely. Nightly (0.2.3e) is a bit better. At least it has a functional UI. Though, it can not fetch filter from the server. Spinner keeps spinning and nothing happens.
In the error console I see the following error message:
Error: NS_ERROR_NOT_IMPLEMENTED: Method not implemented'Method not implemented' when calling method: [nsIProtocolHandler::newChannel]
Source File: chrome://sieve/content/modules/sieve/Sieve.js
Line: 411
Server: Dovecot 2.2.13,
it would be nice for the Debian package if the release XPI would include the CHANGELOG.md.
Overriding certs fails with the following error:
onBadCertOverride:TypeError: Cc['@mozilla.org/security/recentbadcerts;1'] is undefined
nsIRecentBadCertService was removed in Gecko 20/Thunderbird 20
see Updating addons broken by private browsing changes for more information
Sieve filter text is pasted intact from the clipboard.
All newlines are stripped from the text, and is pasted from the clipboard as one very long line.
Modules should only be unloaded if logout is completed, otherwise exceptions are thrown
e.g.:
Error: Cc is undefined
Source File: chrome://sieve/content/modules/sieve/Sieve.js
Line: 573
Error: [Exception... "'TypeError: Cc is undefined' when calling method: [nsIStreamListener::onStopRequest]" nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "native frame :: :: <TOP_LEVEL> :: line 0" data: no]
Error: [Exception... "'TypeError: Cc is undefined' when calling method: [nsITimerCallback::notify]" nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "native frame :: :: <TOP_LEVEL> :: line 0" data: no]
I have noticed following behaviour. Setting a rule which marks the message as read and then move it to a folder works correctly. When I configure the rule the other way around, the message is moved to the specific folder, but it remains as unread.
These are the exported test rules:
'# rule:[Test]
if true
{
fileinto "Archive";
setflag "\Seen";
}
is treated different from
'# rule:[Test]
if true
{
setflag "\Seen";
fileinto "Archive";
}
The interfaces of nsISupportsArray changed and was partly dropped.
This causes errors like:
Timestamp: 16.12.2012 13:42:47
Error: TypeError: accountManager.allServers.Count is not a function
Source File: chrome://sieve/content/modules/sieve/SieveAccounts.js
Line: 1222
All in all the Account Manager's interface changed. There is now a length property instead of a Count() method.
// Old syntax
MailServices.accounts.accounts.Count()
// New syntax
MailServices.accounts.accounts.length
Implement a way to convert or migrate existing Thunderbird mail filters to a sieve.
I'm trying to access filters on my cyrus imapd server, and the connection stalls after the "STARTTLS" issent. After the "OK begin TLS negotiation now" , a packet of binary data is sent from the client to the server, and the server respons with several packets of cert. info and other binary contents. That is the end of the transmissions. The "CAPABILITY" shown below is apparently never transmitted, unless it is part of the starttls. Note: somehow this did go through one time out of about 50 times I've tried it. Suprised to see it allowed me to to a lot more like start editing a filter, but that success was short lived.
[17:24:56.745 server1] Client -> Server:
STARTTLS
[17:24:56.745 server1] Client -> Server [Byte Array]:
83,84,65,82,84,84,76,83,13,10
[17:24:57.025 server1] Server -> Client [Byte Array]
79,75,32,34,66,101,103,105,110,32,84,76,83,32,110,101,103,111,116,105,97,116,105,111,110,32,110,111,119,34,13,10
[17:24:57.025 server1] Server -> Client
OK "Begin TLS negotiation now"
[17:24:57.026 server1] Client -> Server:
CAPABILITY
[17:24:57.026 server1] Client -> Server [Byte Array]:
67,65,80,65,66,73,76,73,84,89,13,10
[17:25:16.580 server1] libManageSieve/Sieve.js:
OnTimeout
The filter:
require ["include"]; include :personal "me_file";
Yields "Server reports no errors" and seems to execute correctly on the server but switching to the javascript point and click mode throws an error dialog:
uncaught exception: Unknown Element at: include :personal "me_file";
Is http://www.ietf.org/rfc/rfc6609.txt supported? If not, could it be?
Implement native support for SASL GSSAPI
Th show stopper concerning SASL GSSAPI is that nsIAuthModule is not exposed to javascript. It's just accessible from C++. So there's no way to use Thunderbird's native implementation from extensions.
One way to get around this would be to patch Thunderbird to expose the nsIAuthModule to Scripts.
The other way would be reimplementing nsAuthGSSAPI.cpp in JavaScript with C-Types.
As workaround there is a perl based proxy implementation: https://github.com/thsmi/sieve/tree/master/tools/GSSAPI%20Proxy
I love the Thunderbird Theme "TT DeepDark 9.0.2" very much.
https://addons.mozilla.org/de/thunderbird/addon/tt-deepdark/?src=ss
But sadly Sieve seems not to be capable to use the colors like it should.
Please have a look at the attached image.
I would love to see this fixed asap - maybe with version 0.2.3 ? :D
There's a problem with the parsing of quoted string responses that themselves contain quote characters, e.g., "foo "bar"". The server I'm testing returns such strings in responses reporting sieve script errors.
I've changed the server so it uses literals to report such responses. This works around the problem, but unfortunately some other clients have problems dealing with literals in this context, which puts me in a position of choosing which client to support.
Additionally, once this happens the session desynchronizes and freezes up. If I let it time out exceptions are thrown which renders all of Thunderbird inert.
The log when all this happens looks like this:
[15:41:36.724 server3] Client -> Server:
CHECKSCRIPT {55+}
#
#2013-2-6
#
if header :contains "subject" "doof {
[15:41:36.725 server3] Client -> Server [Byte Array]:
67,72,69,67,75,83,67,82,73,80,84,32,123,53,53,43,125,13,10,35,13,10,35,32,50,48,49,51,45,50,45,54,13,10,35,13,10,105,102,32,104,101,97,100,101,114,32,58,99,111,110,116,97,105,110,115,32,34,115,117,98,106,101,99,116,34,32,34,100,111,111,102,32,123,13,10
[15:41:36.727 server3] Server -> Client [Byte Array]
78,79,32,34,79,112,101,110,32,115,116,114,105,110,103,32,97,116,32,101,110,100,32,111,102,32,101,120,112,114,101,115,115,105,111,110,32,97,114,111,117,110,100,32,105,110,112,117,116,32,108,105,110,101,32,52,32,91,115,32,32,92,34,115,117,98,106,101,99,116,92,34,32,92,34,100,111,111,102,32,123,94,93,34,13,10
[15:41:36.727 server3] Server -> Client
NO "Open string at end of expression around input line 4 [s \"subject\" \"doof {^]"
[15:41:36.728 server3] Parsing Warning in libManageSieve/Sieve.js:
(new String("Linebreak expected:\r\nsubject\\\" \\\"doof {^]\"\r\n"))
[15:41:56.728 server3] libManageSieve/Sieve.js:
OnTimeout
[15:46:36.718 server3] Sending keep alive packet...
[15:58:16.761 server3] Stop request received ...
[15:58:16.761 server3] Disconnected ...
[15:58:16.761 server3] On Server Disconnect: server3/ [cid=0,cid=2]
[15:58:16.761 server3] Invoking Listeners for onDisconnect
[15:58:16.762 server3] Channel Closed: server3/cid=2 [cid=0]
[15:58:16.762 server3] Invoking Listeners for onChannelClosed
[15:58:16.763 server3] Channel Closed: server3/cid=0 []
[15:58:16.763 server3] No Listener for onChannelClosed
[]
Timestamp: 2/6/13 3:58:16 PM
Error: this.sessions[sid] is undefined
Source File: chrome://sieve/content/modules/sieve/SieveConnectionManager.js
Line: 186
Timestamp: 2/6/13 5:47:24 PM
Warning: Use of nsIDOMWindowInternal is deprecated. Use nsIDOMWindow instead.
Source File: chrome://messenger/content/messenger.xul
Line: 0
Timestamp: 2/6/13 5:47:24 PM
Error: SieveOverlayManager._imports[url] is undefined
Source File: chrome://sieve/content/modules/overlays/SieveOverlayManager.jsm
Line: 392
Timestamp: 2/6/13 5:47:24 PM
Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIObserverService.removeObserver]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://messenger/content/search.xml :: :: line 156" data: no]
FWIW, I took a peek at the code. I'm not sure I see what's causing this specifically, but the procedure:
SieveResponseParser.prototype.extractQuoted
= function ()
{
if (this.isQuoted() == false)
throw "Quoted string expected but found \n"+this.getData();
// now search for the end. But we need to be aware of escape sequences.
var nextQuote = this.pos;
do
{
nextQuote = this.indexOf(CHAR_QUOTE, nextQuote+1);
if (nextQuote == -1)
throw "Quoted string not properly closed\n"+this.getData();
} while (this.data[nextQuote-1] == CHAR_BACKSLASH )
var quoted = this.getData(this.pos+1,nextQuote);
this.pos = nextQuote+1;
// Cleanup escape sequences
quoted = quoted.replace('\\"','"',"g")
quoted = quoted.replace("\\\\","\\","g");
return quoted;
}
has at least one other problem: It won't handle a string like "" correctly. In general you have to parse these sorts of strings forward, peeking back as this code does doesn't work.
Connection worked right before the update. After the update to version 24 the sieve window just tries to connect forever (or loads forever)
There are no messages in the debug console even after turning all sieve debug settings on.
i'm getting this error, when i open the "Server side filters" tab or press the "Parse Sieve Script" button.
using 0.2.3f nightly build.
Timestamp: 16.12.2012 16:05:45
Warning: TypeError: variable ch redeclares argument
Source File: chrome://sieve/content/libs/libSieveDOM/toolkit/SieveParser.js
Line: 27, Column: 6
Source Code:
var ch = [].concat(ch)
I have a new managesieve server implementation that I am testing with this plugin. It seems that when I don't offer STARTTLS I am informed that my server doesn't implement managesieve. This is true even if "secure connection" is false. And TLS is definintely being negotiated.
FWIW, my logs indicate the client simply disconnects once it gets the banner without STARTTLS back.
Quoted strings in the RFC are defined as follows:
quoted = DQUOTE *1024QUOTED-CHAR DQUOTE
;; limited to 1024 octets between the <">s
QUOTED-CHAR = SAFE-UTF8-CHAR / "\" QUOTED-SPECIALS
QUOTED-SPECIALS = DQUOTE / "\"
The backslash is used as a escape character but escape sequences are ignored see:
On Ubuntu 14.04 and 15.04, using TB36, the sieve Manager Filters page always just sits there with a spinning wheel and never displays anything.
Turning on all debug flags, the error console shows:
Timestamp: 2015-04-25 03:13:13 PM
Warning: mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create
Source File: chrome://sieve/content/modules/sieve/SieveAccounts.js
Line: 448
Timestamp: 2015-04-25 03:13:13 PM
Warning: mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create
Source File: chrome://sieve/content/modules/sieve/SieveResponseCodes.js
Line: 54
Timestamp: 2015-04-25 03:13:13 PM
Warning: mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create
Source File: chrome://sieve/content/modules/sieve/SieveResponse.js
Line: 297
Timestamp: 2015-04-25 03:13:13 PM
Warning: mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create
Source File: chrome://sieve/content/modules/sieve/SieveRequest.js
Line: 168
Timestamp: 2015-04-25 03:13:13 PM
Warning: mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create
Source File: chrome://sieve/content/editor/SieveFilterExplorer.js
Line: 45
Timestamp: 2015-04-25 03:13:13 PM
Error: TypeError: accountManager.allServers.Count is not a function
Source File: chrome://sieve/content/modules/sieve/SieveAccounts.js
Line: 1222
Timestamp: 2015-04-25 03:13:20 PM
Error: uncaught exception: 2147746065
...and then it just sits there forever. Tested against dovecot-2.2.10p3 & dovecot-pigeonhole-0.4.2p2v0 on OpenBSD. This used to work, as recently as ~4 months ago.
Hi,
It would be nice to use ManagedSieve in Postbox 3. Is there much porting effort?
Best regards
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.