Hello community, here is the log from the commit of package imapfilter for openSUSE:Factory checked in at 2016-06-25 02:23:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/imapfilter (Old) and /work/SRC/openSUSE:Factory/.imapfilter.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "imapfilter" Changes: -------- --- /work/SRC/openSUSE:Factory/imapfilter/imapfilter.changes 2016-02-16 09:19:22.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.imapfilter.new/imapfilter.changes 2016-06-25 02:23:54.000000000 +0200 @@ -1,0 +2,8 @@ +Thu Jun 23 05:31:57 UTC 2016 - [email protected] + +- update to version 2.6.7: + * A dry-run mode that disables all actions that modify data. + * Bug fix; handle IDLE untagged responses that are received in + pieces. + +------------------------------------------------------------------- Old: ---- imapfilter-2.6.6.tar.gz New: ---- imapfilter-2.6.7.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ imapfilter.spec ++++++ --- /var/tmp/diff_new_pack.1WQHrq/_old 2016-06-25 02:23:55.000000000 +0200 +++ /var/tmp/diff_new_pack.1WQHrq/_new 2016-06-25 02:23:55.000000000 +0200 @@ -21,7 +21,7 @@ License: MIT Group: Productivity/Networking/Email/Utilities Url: https://github.com/lefcha/imapfilter -Version: 2.6.6 +Version: 2.6.7 Release: 0 Source: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ imapfilter-2.6.6.tar.gz -> imapfilter-2.6.7.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imapfilter-2.6.6/NEWS new/imapfilter-2.6.7/NEWS --- old/imapfilter-2.6.6/NEWS 2016-01-23 21:12:28.000000000 +0100 +++ new/imapfilter-2.6.7/NEWS 2016-06-06 23:37:30.000000000 +0200 @@ -1,3 +1,7 @@ +IMAPFilter 2.6.7 - 7 Jun 2016 + - A dry-run mode that disables all actions that modify data. + - Bug fix; handle IDLE untagged responses that are received in pieces. + IMAPFilter 2.6.6 - 23 Jan 2016 - Bug fix; print an error message if "ssl" has been set to "ssl3". diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imapfilter-2.6.6/doc/imapfilter.1 new/imapfilter-2.6.7/doc/imapfilter.1 --- old/imapfilter-2.6.6/doc/imapfilter.1 2016-01-23 21:12:28.000000000 +0100 +++ new/imapfilter-2.6.7/doc/imapfilter.1 2016-06-06 23:37:30.000000000 +0200 @@ -1,4 +1,4 @@ -.Dd Jul 19, 2015 +.Dd Apr 27, 2016 .Dt IMAPFILTER 1 .Os .Sh NAME @@ -6,7 +6,7 @@ .Nd mail filter .Sh SYNOPSIS .Nm -.Op Fl iVv +.Op Fl inVv .Op Fl c Ar configfile .Op Fl d Ar debugfile .Op Fl e Ar 'command' @@ -38,11 +38,22 @@ .Dq one line of configuration, while it is also possible to pipe a full configuration as a string. -When this options is used, a configuration file will not be loaded. +When this option is used, a configuration file will not be loaded. .It Fl i Enters interactive mode after executing the configuration file. .It Fl l Ar logfile File that contains logs of error messages produced. +.It Fl n +This option enables the so called dry-run mode, and any actions that would +result in changes to the server do not actually take place. So the requests +that would modify any data are not sent to the server, even though +informational messages about these actions are still printed. + +Any other methods, that only receive data from the server, are performed as +normal, such as for example the searching methods. Note, that the number of +messages an action is reported to be applied upon, might differ between dry-run +mode and the normal execution, and this is expected as in the latter case the +data on the server are continuesly altered by subsequent actions. .It Fl t Ar truststore The path to the system's SSL CA TrustStore directory or file. SSL connections will be validated using the CA certificates found in this directory or file, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imapfilter-2.6.6/src/imapfilter.c new/imapfilter-2.6.7/src/imapfilter.c --- old/imapfilter-2.6.6/src/imapfilter.c 2016-01-23 21:12:28.000000000 +0100 +++ new/imapfilter-2.6.7/src/imapfilter.c 2016-06-06 23:37:30.000000000 +0200 @@ -51,6 +51,7 @@ opts.verbose = 0; opts.interactive = 0; + opts.dryrun = 0; opts.log = NULL; opts.config = NULL; opts.oneline = NULL; @@ -65,7 +66,7 @@ env.home = NULL; env.pathmax = -1; - while ((c = getopt(argc, argv, "Vc:d:e:il:t:v?")) != -1) { + while ((c = getopt(argc, argv, "Vc:d:e:il:nt:v?")) != -1) { switch (c) { case 'V': version(); @@ -86,6 +87,9 @@ case 'l': opts.log = optarg; break; + case 'n': + opts.dryrun = 1; + break; case 't': opts.truststore = optarg; break; @@ -191,7 +195,7 @@ usage(void) { - fprintf(stderr, "usage: imapfilter [-iVv] [-c configfile] " + fprintf(stderr, "usage: imapfilter [-inVv] [-c configfile] " "[-d debugfile] [-e 'command'] [-l logfile]\n"); exit(0); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imapfilter-2.6.6/src/imapfilter.h new/imapfilter-2.6.7/src/imapfilter.h --- old/imapfilter-2.6.6/src/imapfilter.h 2016-01-23 21:12:28.000000000 +0100 +++ new/imapfilter-2.6.7/src/imapfilter.h 2016-06-06 23:37:30.000000000 +0200 @@ -48,6 +48,8 @@ #define STATUS_TRYCREATE 9 #define STATUS_TIMEOUT 10 +#define STATUS_DRYRUN STATUS_OK + /* Initial size for buffers. */ #define INPUT_BUF 4096 #define OUTPUT_BUF 1024 @@ -64,6 +66,7 @@ typedef struct options { int verbose; /* Verbose mode. */ int interactive; /* Act as an interpreter. */ + int dryrun; /* Don't send commands that do changes. */ char *log; /* Log file for error messages. */ char *config; /* Configuration file. */ char *oneline; /* One line of program/configuration. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imapfilter-2.6.6/src/request.c new/imapfilter-2.6.7/src/request.c --- old/imapfilter-2.6.6/src/request.c 2016-01-23 21:12:28.000000000 +0100 +++ new/imapfilter-2.6.7/src/request.c 2016-06-06 23:37:30.000000000 +0200 @@ -376,6 +376,9 @@ { int t, r; + if (opts.dryrun) + return STATUS_DRYRUN; + TRY(t = send_request(ssn, "EXPUNGE")); TRY(r = response_generic(ssn, t)); @@ -603,6 +606,9 @@ { int t, r; + if (opts.dryrun) + return STATUS_DRYRUN; + TRY(t = send_request(ssn, "UID STORE %s %sFLAGS.SILENT (%s)", mesg, (!strncasecmp(mode, "add", 3) ? "+" : !strncasecmp(mode, "remove", 6) ? "-" : ""), flags)); @@ -626,6 +632,9 @@ int t, r; const char *m; + if (opts.dryrun) + return STATUS_DRYRUN; + m = apply_namespace(mbox, ssn->ns.prefix, ssn->ns.delim); TRY(t = send_request(ssn, "UID COPY %s \"%s\"", mesg, m)); @@ -655,6 +664,9 @@ int t, r; const char *m; + if (opts.dryrun) + return STATUS_DRYRUN; + m = apply_namespace(mbox, ssn->ns.prefix, ssn->ns.delim); TRY(t = send_request(ssn, "APPEND \"%s\"%s%s%s%s%s%s {%d}", m, @@ -698,6 +710,9 @@ int t, r; const char *m; + if (opts.dryrun) + return STATUS_DRYRUN; + m = apply_namespace(mbox, ssn->ns.prefix, ssn->ns.delim); TRY(t = send_request(ssn, "CREATE \"%s\"", m)); @@ -716,6 +731,9 @@ int t, r; const char *m; + if (opts.dryrun) + return STATUS_DRYRUN; + m = apply_namespace(mbox, ssn->ns.prefix, ssn->ns.delim); TRY(t = send_request(ssn, "DELETE \"%s\"", m)); @@ -734,6 +752,9 @@ int t, r; char *o, *n; + if (opts.dryrun) + return STATUS_DRYRUN; + o = xstrdup(apply_namespace(oldmbox, ssn->ns.prefix, ssn->ns.delim)); n = xstrdup(apply_namespace(newmbox, ssn->ns.prefix, ssn->ns.delim)); @@ -753,6 +774,9 @@ int t, r; const char *m; + if (opts.dryrun) + return STATUS_DRYRUN; + m = apply_namespace(mbox, ssn->ns.prefix, ssn->ns.delim); TRY(t = send_request(ssn, "SUBSCRIBE \"%s\"", m)); @@ -771,6 +795,9 @@ int t, r; const char *m; + if (opts.dryrun) + return STATUS_DRYRUN; + m = apply_namespace(mbox, ssn->ns.prefix, ssn->ns.delim); TRY(t = send_request(ssn, "UNSUBSCRIBE \"%s\"", m)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imapfilter-2.6.6/src/response.c new/imapfilter-2.6.7/src/response.c --- old/imapfilter-2.6.6/src/response.c 2016-01-23 21:12:28.000000000 +0100 +++ new/imapfilter-2.6.7/src/response.c 2016-06-06 23:37:30.000000000 +0200 @@ -842,6 +842,7 @@ response_idle(session *ssn, int tag, char **event) { regexp *re; + ssize_t n; if (tag == -1) return -1; @@ -851,23 +852,22 @@ for (;;) { buffer_reset(&ibuf); - switch (receive_response(ssn, ibuf.data, - get_option_number("keepalive") * 60, 0)) { - case -1: - return -1; - break; /* NOTREACHED */ - case 0: - return STATUS_TIMEOUT; - break; /* NOTREACHED */ - } + do { + buffer_check(&ibuf, ibuf.len + INPUT_BUF); + n = receive_response(ssn, ibuf.data + ibuf.len, + get_option_number("keepalive") * 60, 0); + if (n < 0) + return -1; + if (n == 0) + return STATUS_TIMEOUT; + ibuf.len += n; + + if (check_bye(ibuf.data)) + return STATUS_BYE; + } while (regexec(re->preg, ibuf.data, re->nmatch, re->pmatch, 0)); verbose("S (%d): %s", ssn->socket, ibuf.data); - if (check_bye(ibuf.data)) - return STATUS_BYE; - - if (regexec(re->preg, ibuf.data, re->nmatch, re->pmatch, 0)) - continue; if (get_option_boolean("wakeonany")) break; if (!strncasecmp(ibuf.data + re->pmatch[1].rm_so, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imapfilter-2.6.6/src/version.h new/imapfilter-2.6.7/src/version.h --- old/imapfilter-2.6.6/src/version.h 2016-01-23 21:12:28.000000000 +0100 +++ new/imapfilter-2.6.7/src/version.h 2016-06-06 23:37:30.000000000 +0200 @@ -3,7 +3,7 @@ /* Program's version number. */ -#define VERSION "2.6.6" +#define VERSION "2.6.7" /* Program's copyright. */ #define COPYRIGHT "Copyright (c) 2001-2016 Eleftherios Chatzimparmpas"
