philpennock / sieve-connect Goto Github PK
View Code? Open in Web Editor NEWA client for the MANAGESIEVE Protocol
License: Other
A client for the MANAGESIEVE Protocol
License: Other
When I try to build the script, I get following error:
$ make
./repo-generate version > versionfile
./repo-generate date > datefile
perl -MFile::Slurp -p < sieve-connect.pre.pl > sieve-connect.pl -e ' \
BEGIN { $newver = read_file("versionfile"); chomp $newver; }; \
next unless /VERSION.*MAGIC LINE REPLACED IN DISTRIBUTION/; \
$_ = qq{our \$VERSION = '"'"'$newver'"'"';\n}; \
'
Can't modify single ref constructor in scalar assignment at -e line 4, near "qq{our \$VERSION = '$newver';\n};"
syntax error at -e line 5, at EOF
Execution of -e aborted due to compilation errors.
make: *** [sieve-connect.pl] Error 255
I am using Ubuntu 14.04. Perl is at version 5.18.2-2ubuntu1 and File::Slurp is at version 9999.19-4.
Hello,
Thank you for making this program, it certainly gives me the illusion of power over my mail :)
I'm running into an issue when trying checkscript
or edit
on any sieve script, which returns:
CHECKSCRIPT failed: NO "null"
I have a few rules in a rules.sieve
on the server (created via a web UI). They've been working okay for a few years. I receive the above failure when I:
edit
the script and save with changesedit
the script, save with no changesedit
the script, deleting everything, saving an empty filedownload
the script then run checkscript rules.sieve
All local commands seem to work fine, so I assume this is a problem with the server?
Thanks!
Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through in regex; marked by <-- HERE in m/^{ <-- HERE (\d+)\+?}\r?$/ at /usr/bin/sieve-connect line 926.
Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through in regex; marked by <-- HERE in m/^{ <-- HERE (\d+)\+?}\r?$/ at /usr/bin/sieve-connect line 1509.
Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through in regex; marked by <-- HERE in m/^{ <-- HERE \d+\+?}\r?\n?/ at /usr/bin/sieve-connect line 1525.
Hello,
I'm attempting to do some housekeeping with the sieve-connect Debian package, and #882942 was reported against 0.88 a few years ago.
From a casual inspection, the regular expressions still appear to have the same escaping issues in 0.90, which I'm looking at updating the package to at the moment.
Phil,
this is the same patch I sent in a while ago. I'm only adding it here for
referencing purposes.
This patch adds support for the special case of patched Cyrus servers
which behave differently from what sieve-connect would infer from their
version numbers.
Some modern servers get patched to not resend their capabilities after
STARTTLS. For example, Kolab's Cyrus gets patched this way to ensure
compatibility with older Kontact versions (Cyrus timsieved
v2.3.16-kolab-nocaps).
sieve-connect simply needs to do nothing in regards to compatibilities
after STARTTLS in this case. This patch applies this behavior to any
Cyrus servers which carry "nocaps" in their version string.
---
sieve-connect.pre.pl | 32 +++++++++++++++++++++++++++++---
1 file changed, 29 insertions(+), 3 deletions(-)
diff --git a/sieve-connect.pre.pl b/sieve-connect.pre.pl
index 0474bcb..20bdb35 100755
--- a/sieve-connect.pre.pl
+++ b/sieve-connect.pre.pl
@@ -699,12 +699,34 @@ if (exists $capa{STARTTLS}) {
# This means that if they don't support NOOP by 2.3.14, I have to
# figure out how to decide what is safe and backtrack which version
# precisely was the first to send the capability response correctly.
+ #
+ # There is also at least one special version which needs special
+ # treatment despite having a higher version number: Kolab's patched
+ # "nocaps" Cyrus version (see below).
my $use_noop = 1;
- if (exists $capa{"IMPLEMENTATION"} and
- $capa{"IMPLEMENTATION"} =~ /^Cyrus timsieved v2\.3\.(\d+)\z/ and
- $1 >= 13) {
+ my $timsieved_nocaps = 0;
+ my $cyrus_version_extension = '';
+ if (exists $capa{"IMPLEMENTATION"}) {
+ if ($capa{"IMPLEMENTATION"} =~ /^Cyrus timsieved v2\.3\.(\d+)\z/
+ and $1 >= 13) {
debug("--- Cyrus drops connection with dubious log msg if send NOOP, skip that");
$use_noop = 0;
+ } elsif ($capa{"IMPLEMENTATION"} =~
+ /^Cyrus timsieved v2\.3\.\d+-([\w-]*nocaps)\z/ ) {
+ $cyrus_version_extension = $1;
+ # Special case: Cyrus may have been patched to not resend its
+ # capabilities for compatibility with older Kontact versions.
+ # Kolab does this, for example; see
+ # https://roundup.kolab.org/issue2443. This patch may even
+ # have been applied to more modern versions such as v2.3.16.
+ # For this reason, we need to specifically check for this case.
+ # If a nocaps server is detected, nothing needs to be done (see
+ # the $timsieved_nocaps check below).
+ debug("--- Special Cyrus server version detected:" .
+ " $cyrus_version_extension");
+ $use_noop = 0;
+ $timsieved_nocaps = 1;
+ }
}
if ($use_noop) {
@@ -713,6 +735,10 @@ if (exists $capa{STARTTLS}) {
parse_capabilities($sock,
sent_a_noop => $noop_tag,
external_first => $prioritise_auth_external);
+ } elsif ($timsieved_nocaps) {
+ # For the nocaps version of Cyrus, nothing should be done here.
+ debug("--- $cyrus_version_extension: using capabilities" .
+ " transmitted before STARTTLS!");
} else {
parse_capabilities($sock,
external_first => $prioritise_auth_external);
Following the instructions in the README.md I got two issues:
Readline not found
> brew install sieve-connect
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/3/manifests/3.0.1
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/3/blobs/sha256:331a18b7ac0b35d55adb422268c6b08190b378bdfec915a5f6d0b7
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:331a18b7ac0b35d55adb422268c6b08190b378bdf
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/Readline/manifests/8.1.2
curl: (22) The requested URL returned error: 404
Error: sieve-connect: Failed to download resource "Readline_bottle_manifest"
Download failed: https://ghcr.io/v2/homebrew/core/Readline/manifests/8.1.2
Error 255
brew install sieve-connect --without-readline
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/3/manifests/3.0.1
Already downloaded: /Users/redacted/Library/Caches/Homebrew/downloads/242b5104bb035508bc4a51aad45a97b19ccf3776c4a2d396d0b5e815bce690d1--openssl@3-3.0.1.bottle_manifest.json
[REDACTED]
==> make install
==> perl Makefile.PL INSTALL_BASE=/usr/local/Cellar/sieve-connect/0.90/libexec
==> make PERL5LIB=/usr/local/Cellar/sieve-connect/0.90/libexec/lib:/usr/local/Cellar/sieve-connect/0.90/libexec/lib/perl5
Last 15 lines from /Users/redacted/Library/Logs/Homebrew/sieve-connect/20.make:
t_werasc (ERASEWORD) found in ltchars
Writing sgtty section of cchars.h... Done.
cc -c -g -pipe -fno-strict-aliasing -fstack-protector-strong -DPERL_USE_SAFE_PUTENV -Os -DVERSION=\"2.38\" -DXS_VERSION=\"2.38\" -iwithsysroot "/System/Library/Perl/5.30/darwin-thread-multi-2level/CORE" ReadKey.c
rm -f blib/arch/auto/Term/ReadKey/ReadKey.bundle
cc -bundle -undefined dynamic_lookup -fstack-protector-strong ReadKey.o -o blib/arch/auto/Term/ReadKey/ReadKey.bundle \
\
chmod 755 blib/arch/auto/Term/ReadKey/ReadKey.bundle
"/usr/bin/perl" "-Iblib/arch" "-Iblib/lib" ReadKey.pm.PL ReadKey.pm
Can't load 'blib/arch/auto/Term/ReadKey/ReadKey.bundle' for module Term::ReadKey: dlopen(blib/arch/auto/Term/ReadKey/ReadKey.bundle, 0x0001): tried: 'blib/arch/auto/Term/ReadKey/ReadKey.bundle' (relative path not allowed in hardened program), '/usr/lib/ReadKey.bundle' (no such file) at /System/Library/Perl/5.30/darwin-thread-multi-2level/DynaLoader.pm line 197.
at /System/Library/Perl/5.30/darwin-thread-multi-2level/DynaLoader.pm line 95.
DynaLoader::croak("Can't load 'blib/arch/auto/Term/ReadKey/ReadKey.bundle' for m"...) called at /System/Library/Perl/5.30/darwin-thread-multi-2level/DynaLoader.pm line 197
DynaLoader::bootstrap("Term::ReadKey") called at ReadKey.pm.PL line 515
Creating ReadKey.pm
Bootstrapping the XS for blockoptions: make: *** [ReadKey.pm] Error 255
If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/philpennock/homebrew-protocols/issues
I do not have a clue of what is going on and I will probably going to use a different tool, maybe this report helps anyways.
Phil,
Do you have an exmaple of how you would use --passwordfd in a script or makefile to help manage updates to sieve script(s) on a server?
The maintainer of IP::Socket::INET6 has indicated 'that it is deprecated and no longer suitable for use'.
Suggest updating sieve-connect to use its recommended replacement IO::Socket::IP.
See https://metacpan.org/pod/IO::Socket::INET6, https://metacpan.org/pod/IO::Socket::IP
Thanks
The 0.85.2 "automatic discovery" of SSL CA path/file doesn't quite work on OpenBSD.
I see that fixup_ssl_configuration() tries to guess, but it just assumes that if the system has openssl(1) and openssl version -d
outputs OPENSSLDIR: ..., then it can be used as a parent directory for the ".../certs/" subdirectory. This is not the case on OpenBSD, it doesn't have that directory, instead it has /etc/ssl/cert.pem. But a few lines after this autodetection (same function), it would have guessed right, because this path (.../cert.pem) is contained in @golang_locations. Too bad it won't get picked up, because this is some kind of last resort, if openssl(1) would not have been found.
Some kind of a solution "in the middle" would be effective, in my opinion.
Hello,
I'm getting the following error trying to install via brew install sieve-connect
on MacOS 10.14.4
==> Installing sieve-connect from philpennock/protocols
==> Downloading https://people.spodhuis.org/phil.pennock/software/sieve-connect-0.90.tar.bz2
Already downloaded: ....
Error: An exception occurred within a child process:
NameError: uninitialized constant #<Class:0x00007fc5021ac6a0>::DATA
Did you mean? Data
Date
brew install --verbose
does not show something valuable, methinks (only untar,cp,chmod lines)
Hallo,
thanks for the sieve-connect tool,
I use it in bash scripts and found out the error behaviour isn't consistent.
Sometimes you get return code <> 0, the expected behaviour
but othertimes you get return code = 0 and an error message on stderr
or is start an interactive shell and wait for input from stdin
test@test4:~ > echo password | sieve-connect -s server -u user --passwordfd 0 --localsieve --remotesieve sieve --upload
unable to read "--remotesieve": No such file or directory
test@test4:~ > echo $?
2
test@test4:~ > echo password | sieve-connect -s server -u user --passwordfd 0 --localsieve /tmp/sieve_local --check
CHECKSCRIPT failed: NO {101}
line 4: error: expecting ',' or end of string list ']', but found identifier.
error: parse failed.
test@test4:~ > echo $?
0
test@test4:~ > echo password | sieve-connect -s server -u user --passwordfd 0 --localsieve --check
ReadLine support enabled.
>
my suggestion is another command line option like "--batch" or "--strict"
if set then no interactive shell is startet, every waring turns to an error,
another point
If I use mutiple action option like check upload activate only the last last "action" is executed
no warning is printed.
It would be nice, if the options are put to an command queue in order of their appearence
and then executed one ather the other, so you have to call the sieve-connect only once.
greeting
Juergen
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.