dburkart / check-sieve Goto Github PK
View Code? Open in Web Editor NEWSyntax checker for mail sieves.
License: MIT License
Syntax checker for mail sieves.
License: MIT License
It would be nice to have a brew formula for installing check-sieve.
Unsure if it's worth it for you to have a whole tap just for this, and I'm not sure this would be accepted into homebrew core just yet, but at least good to provide the formula for anyone coming across this:
# See upstream issue: https://github.com/dburkart/check-sieve/issues/46
class CheckSieve < Formula
version '0.9'
sha256 'cc9a8ee4fe3e6464d1934325d2c17c4f37799aedb85d7fda9e00991e23d93c60'
desc 'CLI to check Sieve files for errors.'
homepage 'https://github.com/dburkart/check-sieve'
url "https://github.com/dburkart/check-sieve/archive/refs/tags/check-sieve-#{version}.tar.gz"
license 'MIT'
def install
system 'make', 'install', "INSTALL_PREFIX=#{prefix}"
end
end
I also pushed it to my personal tap, so can be installed with:
brew install gibfahn/tap/check-sieve
This memo updates the definition of the "reject" action to allow
messages to be refused during the SMTP transaction, and defines the
"ereject" action to require messages to be refused during the SMTP
transaction, if possible.
Support syntax checking for the variables extension
Make sure libchecksieve.a has a uniform API, and investigate what else can be added.
We should build an abstract syntax tree as we go along, since that will provide us multiple benefits in the long run. Once we have that, we can move much of the verification code into that, and it will make things like testing a sieve against e-mail possible.
Implementing a style guide and enforcing a uniform syntax style would significantly enhance development, particularly as the codebase expands.
Presently, there are several tools available and up to the task:
ClangFormat describes a set of tools that are built on top of LibFormat. It can support your workflow in a variety of ways including a standalone tool and editor integrations.
clang-tidy is a clang-based C++ “linter” tool. Its purpose is to provide an extensible framework for diagnosing and fixing typical programming errors, like style violations, interface misuse, or bugs that can be deduced via static analysis. clang-tidy is modular and provides a convenient interface for writing new checks.
Cppcheck is a static analysis tool for C/C++ code. It provides unique code analysis to detect bugs and focuses on detecting undefined behaviour and dangerous coding constructs. The goal is to have very few false positives. Cppcheck is designed to be able to analyze your C/C++ code even if it has non-standard syntax (common in embedded projects).
Cpplint is a command-line tool to check C/C++ files for style issues following Google's C++ style guide. Cpplint is developed and maintained by Google Inc. at google/styleguide, also see the wikipedia entry
While Google maintains cpplint, Google is not (very) responsive to issues and pull requests, this fork aims to be (somewhat) more open to add fixes to cpplint to enable fixes, when those fixes make cpplint usable in wider contexts. Also see discussion here google/styleguide#528.
A source code beautifier for C, C++, C#, Objective-C, D, Java, Pawn and Vala.
Maintaining a shared programming style and implementing that standard using automation and analysis tools requires a well-formed style guide. The following major style guides exist:
Based on conventions in the wild, the trend seems to lean toward the Google style guide; however, I leave this personal preference to @dburkart.
I will now examine and compare the existing code to the listed conventions.
Starting with functions, the opening brace {
is on the same line as the function declaration:
check-sieve/src/AST/Validation/Command.cc
Line 76 in 40e51c6
This alone eliminates the following style guides based on brace placement:
This leaves the following style guides:
Next, the return type of a function is on the same line as the function declaration:
check-sieve/src/AST/Validation/Command.cc
Line 122 in 40e51c6
The following style guides also implement this preference:
The following style guides appear to be the most compatible:
Implementing clang-format
, clang-tidy
, and cppcheck
would greatly improve QA across the codebase. These can be passively enforced via GitHub actions to contextualize pull requests.
Note
Implementing the change will also require a refactor of the existing code -- creating a particularly messy commit diff.
The tool has no --help, for instance. In addition we should support the following options:
Add support for the Ihave Extension
Abstract:
This document describes the RELATIONAL extension to the Sieve mail
filtering language defined in RFC 3028. This extension extends
existing conditional tests in Sieve to allow relational operators.
In addition to testing their content, it also allows for testing of
the number of entities in header and envelope fields.
This document obsoletes RFC 3431.
Dear check-sieve team,
I get the following error when trying to install check-sieve at my opensuse Tumbleweed:
make install --debug
GNU Make 4.4.1
Gebaut für x86_64-suse-linux-gnu
Copyright (C) 1988-2023 Free Software Foundation, Inc.
Lizenz GPLv3+: GNU GPL Version 3 oder später https://gnu.org/licenses/gpl.html
Dies ist freie Software: Sie können sie nach Belieben ändern und weiter verteilen.
Soweit es die Gesetze erlauben, gibt es KEINE GARANTIE.
Makedateien werden gelesen …
Makedateien werden aktualisiert …
Ziele werden aktualisiert …
Die Datei „install“ existiert nicht.
Die Datei „all“ existiert nicht.
Die Datei „libchecksieve.a“ existiert nicht.
Das Ziel „libchecksieve.a“ muss neu erzeugt werden.
make -C ./gen
GNU Make 4.4.1
Gebaut für x86_64-suse-linux-gnu
Copyright (C) 1988-2023 Free Software Foundation, Inc.
Lizenz GPLv3+: GNU GPL Version 3 oder später https://gnu.org/licenses/gpl.html
Dies ist freie Software: Sie können sie nach Belieben ändern und weiter verteilen.
Soweit es die Gesetze erlauben, gibt es KEINE GARANTIE.
Makedateien werden gelesen …
make[1]: Verzeichnis „/opt/check-sieve/gen“ wird betreten
Makedateien werden aktualisiert …
Ziele werden aktualisiert …
Die Datei „all“ existiert nicht.
Die Datei „../gen/sieve_parser.tab.o“ existiert nicht.
Das Ziel „../gen/sieve_parser.tab.o“ muss neu erzeugt werden.
g++ -c -I../gen/ -I../src/ -I../src/AST -I../src/Server -std=c++11 -fPIC -Wno-deprecated-register -DPLATFORM="x86_64-Linux" ../gen/sieve_parser.tab.cc -o ../gen/sieve_parser.tab.o
Die Zieldatei „../gen/sieve_parser.tab.o“ wurde erfolgreich aktualisiert.
Die Datei „../gen/sieve_scanner.o“ existiert nicht.
Das Ziel „../gen/sieve_scanner.o“ muss neu erzeugt werden.
g++ -c -I../gen/ -I../src/ -I../src/AST -I../src/Server -std=c++11 -fPIC -Wno-deprecated-register -DPLATFORM="x86_64-Linux" ../gen/sieve_scanner.cc -o ../gen/sieve_scanner.o
Die Zieldatei „../gen/sieve_scanner.o“ wurde erfolgreich aktualisiert.
Das Ziel „all“ muss neu erzeugt werden.
Die Zieldatei „all“ wurde erfolgreich aktualisiert.
make[1]: Verzeichnis „/opt/check-sieve/gen“ wird verlassen
make -C ./src lib
GNU Make 4.4.1
Gebaut für x86_64-suse-linux-gnu
Copyright (C) 1988-2023 Free Software Foundation, Inc.
Lizenz GPLv3+: GNU GPL Version 3 oder später https://gnu.org/licenses/gpl.html
Dies ist freie Software: Sie können sie nach Belieben ändern und weiter verteilen.
Soweit es die Gesetze erlauben, gibt es KEINE GARANTIE.
Makedateien werden gelesen …
make[1]: Verzeichnis „/opt/check-sieve/src“ wird betreten
Makedateien werden aktualisiert …
Ziele werden aktualisiert …
Die Datei „lib“ existiert nicht.
Die Datei „../src/sieve_driver.o“ existiert nicht.
Das Ziel „../src/sieve_driver.o“ muss neu erzeugt werden.
g++ -c -I../gen/ -I../src/ -I../src/AST -I../src/Server -std=c++11 -fPIC -Wno-deprecated-register -DPLATFORM="x86_64-Linux" ../src/sieve_driver.cc -o ../src/sieve_driver.o
Die Zieldatei „../src/sieve_driver.o“ wurde erfolgreich aktualisiert.
Die Datei „../src/checksieve.o“ existiert nicht.
Das Ziel „../src/checksieve.o“ muss neu erzeugt werden.
g++ -c -I../gen/ -I../src/ -I../src/AST -I../src/Server -std=c++11 -fPIC -Wno-deprecated-register -DPLATFORM="x86_64-Linux" ../src/checksieve.cc -o ../src/checksieve.o
Die Zieldatei „../src/checksieve.o“ wurde erfolgreich aktualisiert.
Die Datei „../src/diagnostic.o“ existiert nicht.
Das Ziel „../src/diagnostic.o“ muss neu erzeugt werden.
g++ -c -I../gen/ -I../src/ -I../src/AST -I../src/Server -std=c++11 -fPIC -Wno-deprecated-register -DPLATFORM="x86_64-Linux" ../src/diagnostic.cc -o ../src/diagnostic.o
Die Zieldatei „../src/diagnostic.o“ wurde erfolgreich aktualisiert.
Die Datei „../src/AST/Validation/Command.o“ existiert nicht.
Das Ziel „../src/AST/Validation/Command.o“ muss neu erzeugt werden.
g++ -c -I../gen/ -I../src/ -I../src/AST -I../src/Server -std=c++11 -fPIC -Wno-deprecated-register -DPLATFORM="x86_64-Linux" ../src/AST/Validation/Command.cc -o ../src/AST/Validation/Command.o
Die Zieldatei „../src/AST/Validation/Command.o“ wurde erfolgreich aktualisiert.
Die Datei „../src/AST/Validation/Test.o“ existiert nicht.
Das Ziel „../src/AST/Validation/Test.o“ muss neu erzeugt werden.
g++ -c -I../gen/ -I../src/ -I../src/AST -I../src/Server -std=c++11 -fPIC -Wno-deprecated-register -DPLATFORM="x86_64-Linux" ../src/AST/Validation/Test.cc -o ../src/AST/Validation/Test.o
Die Zieldatei „../src/AST/Validation/Test.o“ wurde erfolgreich aktualisiert.
Die Datei „../src/AST/Validation/Tag.o“ existiert nicht.
Das Ziel „../src/AST/Validation/Tag.o“ muss neu erzeugt werden.
g++ -c -I../gen/ -I../src/ -I../src/AST -I../src/Server -std=c++11 -fPIC -Wno-deprecated-register -DPLATFORM="x86_64-Linux" ../src/AST/Validation/Tag.cc -o ../src/AST/Validation/Tag.o
Die Zieldatei „../src/AST/Validation/Tag.o“ wurde erfolgreich aktualisiert.
Die Datei „../src/AST/ASTTraceVisitor.o“ existiert nicht.
Das Ziel „../src/AST/ASTTraceVisitor.o“ muss neu erzeugt werden.
g++ -c -I../gen/ -I../src/ -I../src/AST -I../src/Server -std=c++11 -fPIC -Wno-deprecated-register -DPLATFORM="x86_64-Linux" ../src/AST/ASTTraceVisitor.cc -o ../src/AST/ASTTraceVisitor.o
Die Zieldatei „../src/AST/ASTTraceVisitor.o“ wurde erfolgreich aktualisiert.
Die Datei „../src/AST/ASTVerificationVisitor.o“ existiert nicht.
Das Ziel „../src/AST/ASTVerificationVisitor.o“ muss neu erzeugt werden.
g++ -c -I../gen/ -I../src/ -I../src/AST -I../src/Server -std=c++11 -fPIC -Wno-deprecated-register -DPLATFORM="x86_64-Linux" ../src/AST/ASTVerificationVisitor.cc -o ../src/AST/ASTVerificationVisitor.o
Die Zieldatei „../src/AST/ASTVerificationVisitor.o“ wurde erfolgreich aktualisiert.
Die Datei „../src/AST/ASTBlock.o“ existiert nicht.
Das Ziel „../src/AST/ASTBlock.o“ muss neu erzeugt werden.
g++ -c -I../gen/ -I../src/ -I../src/AST -I../src/Server -std=c++11 -fPIC -Wno-deprecated-register -DPLATFORM="x86_64-Linux" ../src/AST/ASTBlock.cc -o ../src/AST/ASTBlock.o
Die Zieldatei „../src/AST/ASTBlock.o“ wurde erfolgreich aktualisiert.
Die Datei „../src/AST/ASTBoolean.o“ existiert nicht.
Das Ziel „../src/AST/ASTBoolean.o“ muss neu erzeugt werden.
g++ -c -I../gen/ -I../src/ -I../src/AST -I../src/Server -std=c++11 -fPIC -Wno-deprecated-register -DPLATFORM="x86_64-Linux" ../src/AST/ASTBoolean.cc -o ../src/AST/ASTBoolean.o
Die Zieldatei „../src/AST/ASTBoolean.o“ wurde erfolgreich aktualisiert.
Die Datei „../src/AST/ASTBranch.o“ existiert nicht.
Das Ziel „../src/AST/ASTBranch.o“ muss neu erzeugt werden.
g++ -c -I../gen/ -I../src/ -I../src/AST -I../src/Server -std=c++11 -fPIC -Wno-deprecated-register -DPLATFORM="x86_64-Linux" ../src/AST/ASTBranch.cc -o ../src/AST/ASTBranch.o
Die Zieldatei „../src/AST/ASTBranch.o“ wurde erfolgreich aktualisiert.
Die Datei „../src/AST/ASTCommand.o“ existiert nicht.
Das Ziel „../src/AST/ASTCommand.o“ muss neu erzeugt werden.
g++ -c -I../gen/ -I../src/ -I../src/AST -I../src/Server -std=c++11 -fPIC -Wno-deprecated-register -DPLATFORM="x86_64-Linux" ../src/AST/ASTCommand.cc -o ../src/AST/ASTCommand.o
Die Zieldatei „../src/AST/ASTCommand.o“ wurde erfolgreich aktualisiert.
Die Datei „../src/AST/ASTCondition.o“ existiert nicht.
Das Ziel „../src/AST/ASTCondition.o“ muss neu erzeugt werden.
g++ -c -I../gen/ -I../src/ -I../src/AST -I../src/Server -std=c++11 -fPIC -Wno-deprecated-register -DPLATFORM="x86_64-Linux" ../src/AST/ASTCondition.cc -o ../src/AST/ASTCondition.o
Die Zieldatei „../src/AST/ASTCondition.o“ wurde erfolgreich aktualisiert.
Die Datei „../src/AST/ASTNoOp.o“ existiert nicht.
Das Ziel „../src/AST/ASTNoOp.o“ muss neu erzeugt werden.
g++ -c -I../gen/ -I../src/ -I../src/AST -I../src/Server -std=c++11 -fPIC -Wno-deprecated-register -DPLATFORM="x86_64-Linux" ../src/AST/ASTNoOp.cc -o ../src/AST/ASTNoOp.o
Die Zieldatei „../src/AST/ASTNoOp.o“ wurde erfolgreich aktualisiert.
Die Datei „../src/AST/ASTNumeric.o“ existiert nicht.
Das Ziel „../src/AST/ASTNumeric.o“ muss neu erzeugt werden.
g++ -c -I../gen/ -I../src/ -I../src/AST -I../src/Server -std=c++11 -fPIC -Wno-deprecated-register -DPLATFORM="x86_64-Linux" ../src/AST/ASTNumeric.cc -o ../src/AST/ASTNumeric.o
Die Zieldatei „../src/AST/ASTNumeric.o“ wurde erfolgreich aktualisiert.
Die Datei „../src/AST/ASTRequire.o“ existiert nicht.
Das Ziel „../src/AST/ASTRequire.o“ muss neu erzeugt werden.
g++ -c -I../gen/ -I../src/ -I../src/AST -I../src/Server -std=c++11 -fPIC -Wno-deprecated-register -DPLATFORM="x86_64-Linux" ../src/AST/ASTRequire.cc -o ../src/AST/ASTRequire.o
Die Zieldatei „../src/AST/ASTRequire.o“ wurde erfolgreich aktualisiert.
Die Datei „../src/AST/ASTSieve.o“ existiert nicht.
Das Ziel „../src/AST/ASTSieve.o“ muss neu erzeugt werden.
g++ -c -I../gen/ -I../src/ -I../src/AST -I../src/Server -std=c++11 -fPIC -Wno-deprecated-register -DPLATFORM="x86_64-Linux" ../src/AST/ASTSieve.cc -o ../src/AST/ASTSieve.o
Die Zieldatei „../src/AST/ASTSieve.o“ wurde erfolgreich aktualisiert.
Die Datei „../src/AST/ASTString.o“ existiert nicht.
Das Ziel „../src/AST/ASTString.o“ muss neu erzeugt werden.
g++ -c -I../gen/ -I../src/ -I../src/AST -I../src/Server -std=c++11 -fPIC -Wno-deprecated-register -DPLATFORM="x86_64-Linux" ../src/AST/ASTString.cc -o ../src/AST/ASTString.o
Die Zieldatei „../src/AST/ASTString.o“ wurde erfolgreich aktualisiert.
Die Datei „../src/AST/ASTStringList.o“ existiert nicht.
Das Ziel „../src/AST/ASTStringList.o“ muss neu erzeugt werden.
g++ -c -I../gen/ -I../src/ -I../src/AST -I../src/Server -std=c++11 -fPIC -Wno-deprecated-register -DPLATFORM="x86_64-Linux" ../src/AST/ASTStringList.cc -o ../src/AST/ASTStringList.o
Die Zieldatei „../src/AST/ASTStringList.o“ wurde erfolgreich aktualisiert.
Die Datei „../src/AST/ASTTag.o“ existiert nicht.
Das Ziel „../src/AST/ASTTag.o“ muss neu erzeugt werden.
g++ -c -I../gen/ -I../src/ -I../src/AST -I../src/Server -std=c++11 -fPIC -Wno-deprecated-register -DPLATFORM="x86_64-Linux" ../src/AST/ASTTag.cc -o ../src/AST/ASTTag.o
Die Zieldatei „../src/AST/ASTTag.o“ wurde erfolgreich aktualisiert.
Die Datei „../src/AST/ASTTest.o“ existiert nicht.
Das Ziel „../src/AST/ASTTest.o“ muss neu erzeugt werden.
g++ -c -I../gen/ -I../src/ -I../src/AST -I../src/Server -std=c++11 -fPIC -Wno-deprecated-register -DPLATFORM="x86_64-Linux" ../src/AST/ASTTest.cc -o ../src/AST/ASTTest.o
Die Zieldatei „../src/AST/ASTTest.o“ wurde erfolgreich aktualisiert.
Die Datei „../src/AST/ASTTestList.o“ existiert nicht.
Das Ziel „../src/AST/ASTTestList.o“ muss neu erzeugt werden.
g++ -c -I../gen/ -I../src/ -I../src/AST -I../src/Server -std=c++11 -fPIC -Wno-deprecated-register -DPLATFORM="x86_64-Linux" ../src/AST/ASTTestList.cc -o ../src/AST/ASTTestList.o
Die Zieldatei „../src/AST/ASTTestList.o“ wurde erfolgreich aktualisiert.
Die Datei „../src/Server/MailServer.o“ existiert nicht.
Das Ziel „../src/Server/MailServer.o“ muss neu erzeugt werden.
g++ -c -I../gen/ -I../src/ -I../src/AST -I../src/Server -std=c++11 -fPIC -Wno-deprecated-register -DPLATFORM="x86_64-Linux" ../src/Server/MailServer.cc -o ../src/Server/MailServer.o
Die Zieldatei „../src/Server/MailServer.o“ wurde erfolgreich aktualisiert.
Das Ziel „lib“ muss neu erzeugt werden.
Die Zieldatei „lib“ wurde erfolgreich aktualisiert.
make[1]: Verzeichnis „/opt/check-sieve/src“ wird verlassen
ar rc libchecksieve.a ./gen/sieve_parser.tab.o ./gen/sieve_scanner.o ./src/sieve_driver.o ./src/checksieve.o ./src/diagnostic.o ./src/AST/Validation/Command.o ./src/AST/Validation/Test.o ./src/AST/Validation/Tag.o ./src/AST/ASTTraceVisitor.o ./src/AST/ASTVerificationVisitor.o ./src/AST/ASTBlock.o ./src/AST/ASTBoolean.o ./src/AST/ASTBranch.o ./src/AST/ASTCommand.o ./src/AST/ASTCondition.o ./src/AST/ASTNoOp.o ./src/AST/ASTNumeric.o ./src/AST/ASTRequire.o ./src/AST/ASTSieve.o ./src/AST/ASTString.o ./src/AST/ASTStringList.o ./src/AST/ASTTag.o ./src/AST/ASTTest.o ./src/AST/ASTTestList.o ./src/Server/MailServer.o
Die Zieldatei „libchecksieve.a“ wurde erfolgreich aktualisiert.
Die Datei „check-sieve“ existiert nicht.
Das Ziel „check-sieve“ muss neu erzeugt werden.
make -C ./src binary
GNU Make 4.4.1
Gebaut für x86_64-suse-linux-gnu
Copyright (C) 1988-2023 Free Software Foundation, Inc.
Lizenz GPLv3+: GNU GPL Version 3 oder später https://gnu.org/licenses/gpl.html
Dies ist freie Software: Sie können sie nach Belieben ändern und weiter verteilen.
Soweit es die Gesetze erlauben, gibt es KEINE GARANTIE.
Makedateien werden gelesen …
make[1]: Verzeichnis „/opt/check-sieve/src“ wird betreten
Makedateien werden aktualisiert …
Ziele werden aktualisiert …
Die Datei „binary“ existiert nicht.
Die Datei „../src/sieve.o“ existiert nicht.
Das Ziel „../src/sieve.o“ muss neu erzeugt werden.
g++ -c -I../gen/ -I../src/ -I../src/AST -I../src/Server -std=c++11 -fPIC -Wno-deprecated-register -DPLATFORM="x86_64-Linux" ../src/sieve.cc -o ../src/sieve.o
In Datei, eingebunden von ../src/sieve.cc:8:
../src/Server/MailServer.hh:17:38: Fehler: »uint32_t« wurde nicht deklariert
17 | MailServer(std::string hostname, uint32_t port);
| ^~~~~~~~
../src/Server/MailServer.hh:24:5: Fehler: »uint32_t« bezeichnet keinen Typ
24 | uint32_t _port;
| ^~~~~~~~
../src/Server/MailServer.hh:1:1: Anmerkung: »uint32_t« ist im Header »« definiert; haben Sie vergessen, »#include « zu schreiben?
+++ |+#include
1 | #pragma once
cc1plus: Anmerkung: Unbekannte Kommandozeilenoption »-Wno-deprecated-register« könnte den Zweck haben, bisherige Diagnosemeldungen zu unterdrücken
make[1]: *** [Makefile:22: ../src/sieve.o] Fehler 1
make[1]: Verzeichnis „/opt/check-sieve/src“ wird verlassen
make: *** [Makefile:25: check-sieve] Fehler 2
Am I missing any dependency? I did checkout the master from git.
Hello,
I'm really sorry to post this problem, but I don't understand how it works
at this point, I get a response:
jeremy@jerem-debian:~/git/check-sieve (master) $ ./check-sieve /tmp/managesieve.sieve
Errors found in "/tmp/managesieve.sieve":
invalid character
On line 1:
require ["fileinto","regex"];
^
jeremy@jerem-debian:~/git/check-sieve (master) $
I think I'm forgetting something, but I don't see what :(
i've read the readme several times, but i must be missing something. i don't think i should care what's in the tests folder
thanks for the help !
This document describes an extension to the Sieve email filtering
language for an autoresponder similar to that of the Unix "vacation"
command for replying to messages. Various safety features are
included to prevent problems such as message loops.
Add support for Converting Messages Before Delivery
There are some things we may want to allow which is not technically correct syntax, but is allowed by most sieve software. For example, extraneous semicolons are sometimes allowed (particularly after blocks), however that is syntactically invalid.
check-sieve used to print out hints after finding syntax issues, but doesn't anymore since I implemented the AST.
The first argument to the "set" action is a quoted string, but it actually needs to validate to these rules:
variable-name = num-variable / identifier
num-variable = 1*DIGIT
Yup.
Abstract:
This document defines extensions to the Sieve email filtering
language to permit analysis and manipulation of the MIME body parts
of an email message.
This document describes the "date" and "index" extensions to the
Sieve email filtering language. The "date" extension gives Sieve the
ability to test date and time values in various ways. The "index"
extension provides a means to limit header and address tests to
specific instances of header fields when header fields are repeated.
The idea is that we could pass an e-mail message to check-sieve, and walk over the AST, generating a list of actions we would have taken. This would allow true testing of the logic of a mail sieve script.
Abstract:
This document defines a new command for the "Sieve" email filtering
language that tests for the occurrence of one or more strings in the
body of an email message.
RFC 3028 is only partially supported at the moment. Known areas which need improvement are:
test
is supposed to conform to identifier arguments
, but does not.command
should conform to identifier arguments ( ";" / block )
, but does not.check-sieve currently doesn't seem to support the :create
tag on the fileinto
command. This is part of the mailbox extension.
It would be nice if check-sieve supported the spamtest and virus test keywords. These are implemented in dovecot's "Pigeonhole" sieve implementation
Add support for the Environment Extension
The Sieve Email Filtering "include" extension permits users to
include one Sieve script inside another. This can make managing
large scripts or multiple sets of scripts much easier, and allows a
site and its users to build up libraries of scripts. Users are able
to include their own personal scripts or site-wide scripts.
I wanted to do a package on Arch User Repository, but I thought that installing mail-sieve-verifier(-git)
and having a check-sieve
command was kinda odd. Shall we change the name of the executable or leave like this?
While investigating Issue #47, I found this small sieve script which validates, but really shouldn't:
if not (address :is "Foo") {
discard;
}
The problem is that there is no ASTNode to indicate the existence of a test-list; it is simply implied by sibling tests in the syntax tree. So a single-item list validates fine, because all the verifier sees is a single test.
Right now, the parser stops on first error. Let's teach it some error recovery so we can have it be more useful when there are multiple errors in a mail sieve.
To reproduce:
./check-sieve bogus-file
Currently it just hangs
Once we start constructing an abstract syntax tree, all of the verification code should be moved there. This will greatly clean up the parser code (and will be more powerful in the long run).
This depends on issue #21.
For instance, the :comparator flag is governed by "comparator-*", i.e. to use syntax like:
if header :value "lt" :comparator "i;ascii-numeric"
["x-priority"] ["3"]
{
fileinto "Priority";
}
One would need the following require statement:
require "comparator-i;ascii-numerif";
To support this, we need the ability to match part of a required extension.
Right now, the driver class reports out errors to STDOUT as it goes along. Instead of this, we should add an API to generate our reporting from a relevant parse_result
struct.
Issue #43 introduced dependence on C++0x regex support, which made the tests fail on Linux.
Add support for Extensions for Notifications
check-sieve
should allow the user to 'enable' or 'disable' extensions via the command line. In this way, the user can simulate whatever is enabled on their particular mail server.
Perhaps one way to do this is to pass in the mail server, and check-sieve can figure out what the server's capabilities are.
Hi!
I'm looking forward to use mail-sieve-verifier, however when I'm running make
I'm getting the following:
$ make
g++ -Igen/ -Isrc/ -std=c++0x -fPIC -Wno-deprecated-register -DPLATFORM=\"x86_64-Linux\" -c src/sieve.cc
g++ -Igen/ -Isrc/ -std=c++0x -fPIC -Wno-deprecated-register -DPLATFORM=\"x86_64-Linux\" libchecksieve.a sieve.o -o check-sieve
sieve.o: In function `print_version()':
sieve.cc:(.text+0xa): undefined reference to `sieve::version()'
sieve.o: In function `main':
sieve.cc:(.text+0x179): undefined reference to `sieve::driver::driver()'
sieve.cc:(.text+0x413): undefined reference to `sieve::driver::parse_file(std::string const&)'
sieve.cc:(.text+0x483): undefined reference to `sieve::driver::~driver()'
sieve.cc:(.text+0x4bb): undefined reference to `sieve::driver::~driver()'
collect2: error: ld returned 1 exit status
Makefile:11: recipe for target 'check-sieve' failed
make: *** [check-sieve] Error 1
Am I missing a dependency? Sieve, bison and flex are installed with the correct version.
Some infos that may be useful:
$ uname -a
Linux geoffrey-vps 4.0.6-1-ARCH #1 SMP PREEMPT Tue Jun 23 14:25:08 CEST 2015 x86_64 GNU/Linux
$ g++ --version
g++ (GCC) 5.2.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ pacman -Q gcc-multilib
gcc-multilib 5.2.0-2
$ pacman -Q bison
bison 3.0.4-1
$ pacman -Q flex
flex 2.5.39-1
$ pacman -Q pigeonhole
pigeonhole 0.4.8-1
Unit test coverage is pretty sparse. We should fix that.
Because apparently it obsoletes RFC 3028.
Now that there's an Arch package for check-sieve, an "Installing" section should be added to the README.md.
Add support for Subaddress Extension.
The Abstract:
The Sieve scripting language allows users to control handling and
disposal of their incoming e-mail. By default, an e-mail message
that is processed by a Sieve script is saved in the owner's "inbox".
Actions such as "fileinto" and "redirect" cancel this default
behavior.
This document defines a new keyword parameter, ":copy", to be used
with the Sieve "fileinto" and "redirect" actions. Adding ":copy" to
an action suppresses cancellation of the default "inbox" save. It
allows users to add commands to an existing script without changing
the meaning of the rest of the script.
If I have a test-list with a single element, check-sieve produces an "Unrecognized command" error for the test identifier. The only exceptions are for true
and false
. Adding a second element fixes this, but shouldn't be necessary. The Sieve grammar defines a test-list as containing 1 or more tests, not 2 or more.
It's also a bit surprising that the error says "Unrecognized command" instead of something like "unrecognized test".
This bug is new in version 0.7, version 0.6 accepts this syntax without comment. Version 0.6 also uses the correct "Unrecognized test" warning if I put an actual bogus test in there, as opposed to 0.7's "Unrecognized command".
Example:
if anyof (not true) {
keep;
} else {
discard;
}
This produces Unrecognized command "not".
Add support for Internet Message Access Protocol (IMAP) Events in Sieve
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.