Projects
Kolab:Winterfell
cyrus-imapd
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 4
View file
cyrus-imapd.spec
Changed
@@ -20,8 +20,8 @@ %global _cyrusgroup mail %global _cyrexecdir %{_exec_prefix}/lib/%{_name} -%global real_version 2.5.7 -%global snapshot_version 8 +%global real_version 2.5.8 +%global snapshot_version 12 %global dot_snapshot_version %{?snapshot_version:.%{snapshot_version}} ## @@ -34,6 +34,7 @@ %global with_dav 0 %global with_tcpwrap 0 +%global with_zlib 0 Name: cyrus-imapd Summary: A high-performance mail server with IMAP, POP3, NNTP and SIEVE support @@ -329,6 +330,9 @@ %if 0%{?with_tcpwrap} < 1 --without-wrap \ %endif +%if 0%{?with_zlib} < 1 + --without-zlib \ +%endif %if 0%{?with_dav} --with-http \ %endif @@ -748,6 +752,18 @@ %{_libdir}/*.la %changelog +* Thu Jun 02 2016 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 2.5.8.12-1 +- Check in 12 revisions ahead of upstream 2.5.8 release + +* Mon May 09 2016 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 2.5.7.26-1 +- Check in 26 revisions ahead of upstream 2.5.7 release + +* Fri Apr 29 2016 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 2.5.7.25-1 +- Check in 25 revisions ahead of upstream 2.5.7 release + +* Mon Mar 21 2016 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 2.5.7.10-1 +- Check in 10 revisions ahead of upstream 2.5.7 release + * Thu Mar 10 2016 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 2.5.7.8-1 - Check in 8 revisions ahead of upstream 2.5.7 release
View file
cyr_systemd_helper
Changed
@@ -2,14 +2,20 @@ # get_config config default # extracts config option from config file get_config() { - if conf=$(grep "^$1" /etc/imapd.conf); then - echo $conf | cut -d: -f2 - else - echo $2 - fi + if conf=$(grep "^$1" /etc/imapd.conf); then + echo $conf | cut -d: -f2 + else + echo $2 + fi } CONFIGDIRECTORY=$(get_config configdirectory /var/lib/imap) +if ! -d ${CONFIGDIRECTORY} ; then + mkdir -p ${CONFIGDIRECTORY} + chmod 700 ${CONFIGDIRECTORY} + chown cyrus:mail ${CONFIGDIRECTORY} +fi + RETVAL=0 # Sometimes, there is no path @@ -20,26 +26,36 @@ fi start() { - cd $CONFIGDIRECTORY - $runuser - cyrus -s /bin/sh -c "umask 166 ; /usr/lib/cyrus-imapd/cvt_cyrusdb_all import > ${CONFIGDIRECTORY}/rpm/db_import.log 2>&1" < /dev/null - RETVAL=$? + cd $CONFIGDIRECTORY + $runuser - cyrus -s /bin/bash -c '/usr/lib/cyrus-imapd/mkimap' >/dev/null 2>&1 < /dev/null + + mkdir -p ${CONFIGDIRECTORY}/rpm + chown cyrus:mail ${CONFIGDIRECTORY}/rpm + + $runuser - cyrus -s /bin/sh -c "umask 166 ; /usr/lib/cyrus-imapd/cvt_cyrusdb_all import > ${CONFIGDIRECTORY}/rpm/db_import.log 2>&1" < /dev/null + RETVAL=$? } stop() { - cd $CONFIGDIRECTORY - $runuser - cyrus -s /bin/sh -c "umask 166 ; /usr/lib/cyrus-imapd/cvt_cyrusdb_all export > ${CONFIGDIRECTORY}/rpm/db_export.log 2>&1" < /dev/null - RETVAL=$? + cd $CONFIGDIRECTORY + mkdir -p ${CONFIGDIRECTORY}/rpm + chown cyrus:mail ${CONFIGDIRECTORY}/rpm + + $runuser - cyrus -s /bin/sh -c "umask 166 ; /usr/lib/cyrus-imapd/cvt_cyrusdb_all export > ${CONFIGDIRECTORY}/rpm/db_export.log 2>&1" < /dev/null + RETVAL=$? } case "$1" in - start) - start - ;; - stop) - stop - ;; - *) - ;; + start) + start + ;; + + stop) + stop + ;; + + *) + ;; esac exit $RETVAL
View file
cyrus-imapd-2.5.7.8.tar.gz/doc/text
Deleted
-(directory)
View file
cyrus-imapd-2.5.7.8.tar.gz/doc/text/.gitignore
Deleted
@@ -1,33 +0,0 @@ -altnamespace -anoncvs -bugs -changes -faq -feedback -htmlstrip -index -install -install-admin-mb -install-auth -install-compile -install-configure -install-murder -install-netnews -install-virtdomains -install-perf -install-prereq -install-replication -install-sieve -install-snmpmon -install-testing -install-upgrade -mailing-list -man -notes -os -overview -questions -readme -sieve -sieve-protocol -specs
View file
cyrus-imapd-2.5.7.8.tar.gz/.gitignore -> cyrus-imapd-2.5.8.12.tar.gz/.gitignore
Changed
@@ -37,6 +37,8 @@ cscope.out depcomp doc/man/ +doc/murder.png +doc/netnews.png doc/rst/ doc/text/ imap/arbitron @@ -153,6 +155,7 @@ sieve/tests/ stamp-h1 timsieved/timsieved +tools/htmlstrip tools/vzic/vzic xversion.h ylwrap
View file
cyrus-imapd-2.5.7.8.tar.gz/Makefile.am -> cyrus-imapd-2.5.8.12.tar.gz/Makefile.am
Changed
@@ -63,7 +63,8 @@ BUILT_SOURCES = \ xversion.h \ imap/imap_err.c \ - lib/imapopts.c + lib/imapopts.c \ + lib/imapopts.h DISTCLEANFILES = \ imap/imap_err.c \ @@ -106,7 +107,7 @@ DIST_SUBDIRS = . dist_sysconf_DATA = lib_LTLIBRARIES = lib/libcyrus_min.la lib/libcyrus.la -EXTRA_PROGRAMS = doc/text/htmlstrip +EXTRA_PROGRAMS = tools/htmlstrip check_PROGRAMS = service_PROGRAMS = user_PROGRAMS = @@ -313,6 +314,8 @@ cunit/cunit-to-junit.pl \ cunit/key.pem \ cunit/vg.supp \ + doc/murder.png \ + doc/netnews.png \ doc \ imap/dav_util.h \ imap/http_err.et \ @@ -659,7 +662,7 @@ exit $$retval endif -doc_text_htmlstrip_SOURCE = doc/text/htmlstrip.c +tools_htmlstrip_SOURCE = tools/htmlstrip.c includedir=@includedir@/cyrus @@ -682,7 +685,6 @@ lib/gmtoff.h \ lib/hash.h \ lib/hashu64.h \ - lib/imapopts.h \ lib/imapurl.h \ lib/imclient.h \ lib/imparse.h \ @@ -709,6 +711,9 @@ lib/wildmat.h \ lib/xmalloc.h +nodist_include_HEADERS = \ + lib/imapopts.h + nobase_include_HEADERS = sieve/sieve_interface.h nobase_nodist_include_HEADERS = sieve/sieve_err.h @@ -1209,12 +1214,14 @@ lib_libcyrus_la_LIBADD = $(LIB_RT) ${LIB_SASL} $(SSL_LIBS) lib_libcyrus_la_CFLAGS = $(AM_CFLAGS) $(CFLAG_VISIBILITY) +nodist_lib_libcyrus_min_la_SOURCES = \ + lib/imapopts.c + lib_libcyrus_min_la_SOURCES = \ lib/arrayu64.c \ lib/assert.c \ lib/hash.c \ lib/hashu64.c \ - lib/imapopts.c \ lib/libconfig.c \ lib/mpool.c \ lib/retry.c \ @@ -1489,6 +1496,12 @@ grep -E ' yy_size_t _yybytes_len ' sieve/addr-lex.c && \ sed -r -i -s 's/\tint i;/\tyy_size_t i;/g' sieve/addr-lex.c || : + grep -E '^static int yy_n_chars;' sieve/sieve-lex.c && \ + sed -r -i -s 's/\tyy_size_t yy_buf_size;/\tint yy_buf_size;/g' sieve/sieve-lex.c || : + + grep -E '^static int yy_n_chars;' sieve/addr-lex.c && \ + sed -r -i -s 's/\tyy_size_t yy_buf_size;/\tint yy_buf_size;/g' sieve/addr-lex.c || : + GIT_VERSION = $(PACKAGE_VERSION)@git_version@ snapshot:: @@ -1559,7 +1572,9 @@ @cmp -s xversion.h.tmp xversion.h || mv xversion.h.tmp xversion.h @rm -f xversion.h.tmp -dist-hook: doc/text/htmlstrip doc/man/cyradm.1.html doc/man/sieveshell.1.html +.PHONY: doc + +doc: tools/htmlstrip doc/man/cyradm.1.html doc/man/sieveshell.1.html @$(MKDIR_P) doc/text doc/man for man in $(top_builddir)/man/*.1-9 $(top_srcdir)/man/*.1-9; \ do \ @@ -1571,9 +1586,8 @@ for file in $(top_srcdir)/doc/*.html; \ do \ echo "=== $$file ==="; \ - doc/text/htmlstrip $$file > doc/text/`basename $$file .html`; \ + tools/htmlstrip $$file > doc/text/`basename $$file .html`; \ done - @rm doc/text/htmlstrip doc/text/htmlstrip.o doc/text/.dirstamp @echo "== done ==" install-data-hook:
View file
cyrus-imapd-2.5.7.8.tar.gz/configure.ac -> cyrus-imapd-2.5.8.12.tar.gz/configure.ac
Changed
@@ -44,13 +44,16 @@ dnl -AC_INIT(cyrus-imapd, 2.5.7, http://bugzilla.cyrusimap.org,,http://www.cyrusimap.org) +AC_INIT(cyrus-imapd, 2.5.8, http://bugzilla.cyrusimap.org,,http://www.cyrusimap.org) AC_PREREQ(2.63) AC_CONFIG_SRCDIR(imap/imapd.c) AC_CONFIG_HEADERS(config.h) AC_CONFIG_MACRO_DIR(cmulocal) AC_CANONICAL_SYSTEM +dnl in case the first use of PKG_CHECK_MODULES is inside a conditional +PKG_PROG_PKG_CONFIG + AM_INIT_AUTOMAKE(-Wall -Werror -Wno-portability foreign dist-bzip2 no-installinfo subdir-objects) AC_CONFIG_LIBOBJ_DIR(lib) @@ -1238,6 +1241,11 @@ AC_DEFINE(WITH_DKIM,,Build DKIM support into iSchedule?) fi + AC_EGREP_HEADER(ICAL_IANA_PARAMETER, ical.h, + AC_DEFINE(HAVE_IANA_PARAMS,, + Do we have support for IANA params?), + AC_MSG_WARN(Your version of libical can not support scheduling or managed attachments. Consider upgrading to libical >= 0.48)) + AC_EGREP_HEADER(ICAL_SCHEDULESTATUS_PARAMETER, ical.h, AC_DEFINE(HAVE_SCHEDULING_PARAMS,, Do we have built-in support for scheduling params?)) @@ -1255,7 +1263,7 @@ if test "$ENABLE_RSCALE" != no; then AC_SUBST(ICU_CFLAGS) AC_SUBST(ICU_LIBS) - AC_CHECK_LIB(ical, icalrecur_rscale_token_handling_is_supported, + AC_CHECK_LIB(ical, icalrecurrencetype_rscale_is_supported, AC_DEFINE(HAVE_RSCALE,, Build RSCALE support into httpd?)) fi fi
View file
cyrus-imapd-2.5.7.8.tar.gz/doc/changes.html -> cyrus-imapd-2.5.8.12.tar.gz/doc/changes.html
Changed
@@ -8,6 +8,38 @@ </head> <body> +<h1>Changes to the Cyrus IMAP Server since 2.5.7</h1> +<h2>Murder changes</h2> +<ul> +<li>Allow replicated backends in a discrete Murder to both actively +participate in the Murder.</li> +<li>When choosing between ANNOTATEMORE and METADATA, favour what the +client used.</li> +</ul> +<h2>Other changes</h2> +<ul> +<li>cyr_dbtool now supports improved_mboxlist_sort (-M)</li> +</ul> +<h2>Bug fixes</h2> +<ul> +<li>Fixed: master on pselect systems no longer chokes on repeated interrupts +(thanks Jens Erat and team)</li> +<li>Fixed: better iOS CalDAV support (don’t announce VPOLL)</li> +<li>Fixed: backported version detection code to detect future versions</li> +<li>Fixed bug #3927: don’t break cyrus.index on XFER of mailbox with annotations +(thanks Wolfgang Breyha)</li> +<li>Fixed: replication/XFER of mailbox names containing ‘@’</li> +<li>Fixed: METADATA and GETMETADATA pattern/list recognition</li> +<li>Fixed bug #3862: don’t leave behind inconsistent mailboxes when +mupdate fails during mailbox rename</li> +<li>Fixed compilation with Sun Studio 12 C Compiler (thanks Marty Lee)</li> +<li>Fixed bug #3765: ctl_cyrusdb now uses database paths from imapd.conf +(thanks Simon Matter)</li> +<li>Fixed T227: service processes no longer crash with ‘-T 0’ argument +(thanks Ian Batten and Jens Erat)</li> +<li>various build system fixes</li> +</ul> + <h1>Changes to the Cyrus IMAP Server since 2.5.6</h1> <h2>Security fixes</h2> <ul>
View file
cyrus-imapd-2.5.7.8.tar.gz/imap/annotate.c -> cyrus-imapd-2.5.8.12.tar.gz/imap/annotate.c
Changed
@@ -968,7 +968,7 @@ r = split_attribs(data, datalen, &value); - if (!r) r = frock->proc(mboxname, uid, entry, userid, &value, frock->rock); + if (!r) r = frock->proc(mboxname, uid, entry, userid ? userid : "", &value, frock->rock); return r; }
View file
cyrus-imapd-2.5.7.8.tar.gz/imap/http_caldav.c -> cyrus-imapd-2.5.8.12.tar.gz/imap/http_caldav.c
Changed
@@ -104,6 +104,7 @@ #ifdef HAVE_RSCALE +#include <unicode/ucal.h> #include <unicode/uversion.h> static int rscale_cmp(const void *a, const void *b) @@ -111,12 +112,23 @@ /* Convert to uppercase since that's what we prefer to output */ return strcmp(ucase(*((char **) a)), ucase(*((char **) b))); } - -static icalarray *rscale_calendars = NULL; #endif /* HAVE_RSCALE */ -#ifndef HAVE_SCHEDULING_PARAMS +#ifdef HAVE_SCHEDULING_PARAMS + +/* Wrappers to fetch scheduling parameters by kind */ + +#define icalproperty_get_scheduleagent_parameter(prop) \ + icalproperty_get_first_parameter(prop, ICAL_SCHEDULEAGENT_PARAMETER) + +#define icalproperty_get_scheduleforcesend_parameter(prop) \ + icalproperty_get_first_parameter(prop, ICAL_SCHEDULEFORCESEND_PARAMETER) + +#define icalproperty_get_schedulestatus_parameter(prop) \ + icalproperty_get_first_parameter(prop, ICAL_SCHEDULESTATUS_PARAMETER) + +#elif defined(HAVE_IANA_PARAMS) /* Functions to replace those not available in libical < v1.0 */ @@ -179,18 +191,22 @@ #define icalproperty_get_schedulestatus_parameter(prop) \ icalproperty_get_iana_parameter_by_name(prop, "SCHEDULE-STATUS") -#else +#else /* !HAVE_IANA_PARAMS */ -/* Wrappers to fetch scheduling parameters by kind */ +/* Functions to replace those not available in libical < v0.48 */ -#define icalproperty_get_scheduleagent_parameter(prop) \ - icalproperty_get_first_parameter(prop, ICAL_SCHEDULEAGENT_PARAMETER) +#define icalparameter_get_scheduleagent(param) ICAL_SCHEDULEAGENT_NONE -#define icalproperty_get_scheduleforcesend_parameter(prop) \ - icalproperty_get_first_parameter(prop, ICAL_SCHEDULEFORCESEND_PARAMETER) +#define icalparameter_get_scheduleforcesend(param) ICAL_SCHEDULEFORCESEND_NONE -#define icalproperty_get_schedulestatus_parameter(prop) \ - icalproperty_get_first_parameter(prop, ICAL_SCHEDULESTATUS_PARAMETER) +#define icalparameter_new_schedulestatus(stat) NULL; \ + (void) stat /* silence compiler */ + +#define icalproperty_get_scheduleagent_parameter(prop) NULL + +#define icalproperty_get_scheduleforcesend_parameter(prop) NULL + +#define icalproperty_get_schedulestatus_parameter(prop) NULL #endif /* HAVE_SCHEDULING_PARAMS */ @@ -660,6 +676,7 @@ caldav_init(); +#ifdef HAVE_IANA_PARAMS config_allowsched = config_getenum(IMAPOPT_CALDAV_ALLOWSCHEDULING); if (config_allowsched) { namespace_calendar.allow |= ALLOW_CAL_SCHED; @@ -669,6 +686,7 @@ ical_set_unknown_token_handling_setting(ICAL_ASSUME_IANA_TOKEN); #endif } +#endif /* HAVE_IANA_PARAMS */ #ifdef HAVE_TZ_BY_REF if (namespace_timezone.enabled) { @@ -2638,13 +2656,12 @@ #ifdef HAVE_RSCALE /* Make sure we support the provided RSCALE in an RRULE */ prop = icalcomponent_get_first_property(comp, ICAL_RRULE_PROPERTY); - if (prop) { + if (prop && rscale_calendars) { struct icalrecurrencetype rt = icalproperty_get_rrule(prop); - if (*rt.rscale) { - UEnumeration *en; - UErrorCode stat = U_ZERO_ERROR; - const char *rscale; + if (rt.rscale) { + /* Perform binary search on sorted icalarray */ + unsigned found = 0, start = 0, end = rscale_calendars->num_elements; ucase(rt.rscale); while (!found && start < end) { @@ -2656,9 +2673,8 @@ else if (r < 0) end = mid; else start = mid + 1; } - uenum_close(en); - if (!rscale) { + if (!found) { txn->error.precond = CALDAV_SUPP_RSCALE; ret = HTTP_FORBIDDEN; goto done; @@ -3508,19 +3524,18 @@ if (!fctx->req_tgt->collection) return HTTP_NOT_FOUND; - r = annotatemore_lookupmask(fctx->mailbox->name, prop_annot, httpd_userid, &attrib); + r = annotatemore_lookupmask(fctx->mailbox->name, prop_annot, + httpd_userid, &attrib); if (r) return HTTP_SERVER_ERROR; if (attrib.len) { types = strtoul(buf_cstring(&attrib), NULL, 10); } else { - const char **hdr = spool_getheader(fctx->req_hdrs, "User-Agent"); - types = -1; /* ALL components types */ - /* XXX iOS/8 doesn't like VPOLL */ - if (hdr && strstr(hdr0, "iOS/8")) types &= ~CAL_COMP_VPOLL; + /* Apple clients don't like VPOLL */ + types &= ~CAL_COMP_VPOLL; } buf_free(&attrib); @@ -4340,26 +4355,22 @@ if (fctx->req_tgt->resource) return HTTP_NOT_FOUND; -#ifdef HAVE_RSCALE - if (icalrecur_rscale_token_handling_is_supported()) { + if (rscale_calendars) { xmlNodePtr top; - UEnumeration *en; - UErrorCode status = U_ZERO_ERROR; - const char *rscale; + int i, n; top = xml_add_prop(HTTP_OK, fctx->nsNS_DAV, &propstatPROPSTAT_OK, name, ns, NULL, 0); - en = ucal_getKeywordValuesForLocale("calendar", NULL, FALSE, &status); - while ((rscale = uenum_next(en, NULL, &status))) { + for (i = 0, n = rscale_calendars->num_elements; i < n; i++) { + const char **rscale = icalarray_element_at(rscale_calendars, i); + xmlNewChild(top, fctx->nsNS_CALDAV, - BAD_CAST "supported-rscale", BAD_CAST rscale); + BAD_CAST "supported-rscale", BAD_CAST *rscale); } - uenum_close(en); return 0; } -#endif return HTTP_NOT_FOUND; }
View file
cyrus-imapd-2.5.7.8.tar.gz/imap/httpd.c -> cyrus-imapd-2.5.8.12.tar.gz/imap/httpd.c
Changed
@@ -283,8 +283,10 @@ &namespace_principal, &namespace_calendar, &namespace_addressbook, +#ifdef HAVE_IANA_PARAMS &namespace_ischedule, &namespace_domainkey, +#endif /* HAVE_IANA_PARAMS */ #endif /* WITH_DAV */ &namespace_rss, &namespace_dblookup,
View file
cyrus-imapd-2.5.7.8.tar.gz/imap/imap_proxy.c -> cyrus-imapd-2.5.8.12.tar.gz/imap/imap_proxy.c
Changed
@@ -1280,7 +1280,8 @@ if (!CAPA(be, CAPA_METADATA) && use_metadata) { syslog( LOG_WARNING, - "METADATA requested, but '%s' does not have the capability" + "METADATA requested, but '%s' does not have the capability", + server ); }
View file
cyrus-imapd-2.5.7.8.tar.gz/imap/imapd.c -> cyrus-imapd-2.5.8.12.tar.gz/imap/imapd.c
Changed
@@ -8136,11 +8136,7 @@ strarray_append(entries, arg.s); - // It is a list if there are wildcards - if (!strchr(arg.s, '*') || !strchr(arg.s, '%')) { - // No wildcards; Not a list - *is_list = 0; - } + *is_list = 0; } if (c == ' ' || c == '\r') return c; @@ -10032,11 +10028,31 @@ { const char *minor; + /* IMPORTANT: + * + * When adding checks for new versions, you must also backport these + * checks to previous versions (especially 2.4 and 2.5). + * + * Otherwise, old versions will be unable to recognise the new version, + * assume it is ancient, and downgrade the index to the oldest version + * supported (version 6, prior to v2.3). + */ + + /* It's like looking in the mirror and not suffering from schizophrenia */ + if (strstr(be->banner, cyrus_version())) { + return MAILBOX_MINOR_VERSION; + } + /* master branch? */ - if (strstr(be->banner, "git3.0")) { + if (strstr(be->banner, "Cyrus IMAP 3.0")) { return 13; } + /* version 3.0.* is 13 */ + if (strstr(be->banner, "3.0.")) { + return 13; + } + /* version 2.5 is 13 */ if (strstr(be->banner, "Cyrus IMAP 2.5.") || strstr(be->banner, "Cyrus IMAP Murder 2.5.") @@ -10476,34 +10492,46 @@ return 0; } -static int xfer_setquotaroot(struct xfer_header *xfer, const char *mboxname) +static int xfer_setquotaroots(struct xfer_header *xfer) { + struct xfer_item *item; struct quota q; int r; - char extnameMAX_MAILBOX_NAME; - (*imapd_namespace.mboxname_toexternal)(&imapd_namespace, mboxname, - imapd_userid, extname); - - quota_init(&q, mboxname); - r = quota_read(&q, NULL, 0); - if (r == IMAP_QUOTAROOT_NONEXISTENT) return 0; - if (r) return r; - - /* note use of + to force the setting of a nonexistant - * quotaroot */ - prot_printf(xfer->be->out, "Q01 SETQUOTA {" SIZE_T_FMT "+}\r\n+%s ", - strlen(extname)+1, extname); - print_quota_limits(xfer->be->out, &q); - prot_printf(xfer->be->out, "\r\n"); - quota_free(&q); - - r = getresult(xfer->be->in, "Q01"); - if (r) syslog(LOG_ERR, - "Could not move mailbox: %s, " \ - "failed setting initial quota root\r\n", - mboxname); - return r; + for (item = xfer->items; item; item = item->next) { + quota_init(&q, item->mbentry->name); + + r = quota_read(&q, NULL, 0); + + if (r == IMAP_QUOTAROOT_NONEXISTENT) { + quota_free(&q); + continue; + } + + if (r) { + quota_free(&q); + return r; + } + + /* note use of + to force the setting of a nonexistant + * quotaroot */ + prot_printf(xfer->be->out, "Q01 SETQUOTA {" SIZE_T_FMT "+}\r\n+%s ", + strlen(item->extname)+1, item->extname); + print_quota_limits(xfer->be->out, &q); + prot_printf(xfer->be->out, "\r\n"); + quota_free(&q); + + r = getresult(xfer->be->in, "Q01"); + if (r) { + syslog(LOG_ERR, + "Could not move mailbox: %s, " \ + "failed setting quota root\r\n", + item->mbentry->name); + return r; + } + } + + return 0; } static int xfer_addsubmailboxes(struct xfer_header *xfer, const char *mboxname) @@ -10613,14 +10641,14 @@ goto done; } - /* set the quotaroot if needed */ - r = xfer_setquotaroot(xfer, mailboxname); - if (r) goto done; - /* add all submailboxes to the move list as well */ r = xfer_addsubmailboxes(xfer, mailboxname); if (r) goto done; + /* set quotaroots if needed */ + r = xfer_setquotaroots(xfer); + if (r) goto done; + /* backport the seen file if needed */ if (xfer->remoteversion < 12) { r = seen_open(userid, SEEN_CREATE, &xfer->seendb); @@ -11824,14 +11852,26 @@ if (listargs->cmd & LIST_CMD_LSUB) { prot_printf(backend_inbox->out, "%s Lsub ", tag); } else { - prot_printf(backend_inbox->out, "%s List (subscribed", tag); - if (listargs->sel & LIST_SEL_REMOTE) { - prot_printf(backend_inbox->out, " remote"); - } - if (listargs->sel & LIST_SEL_RECURSIVEMATCH) { - prot_printf(backend_inbox->out, " recursivematch"); + const char *select_opts = { + /* XXX MUST be in same order as LIST_SEL_* bitmask */ + "subscribed", "remote", "recursivematch", + "special-use", NULL + }; + char c = '('; + int i; + + prot_printf(backend_inbox->out, "%s List ", tag); + + for (i = 0; select_optsi; i++) { + unsigned opt = (1 << i); + + if (!(listargs->sel & opt)) continue; + + prot_printf(backend_inbox->out, "%c%s", c, select_optsi); + c = ' '; } - prot_printf(backend_inbox->out, ") "); + + prot_puts(backend_inbox->out, ") "); } /* print reference argument */ @@ -11850,23 +11890,56 @@ } (void)prot_putc(')', backend_inbox->out); } else { - prot_printf(backend_inbox->out, + prot_printf(backend_inbox->out, "{%tu+}\r\n%s", strlen(listargs->pat.data0), listargs->pat.data0); } /* print list return options */ if (listargs->ret) { + const char *return_opts = { + /* XXX MUST be in same order as LIST_RET_* bitmask */ + "subscribed", "children", "special-use", + "status ", "myrights", NULL + }; char c = '('; + int i,j; - prot_printf(backend_inbox->out, " return "); - if (listargs->ret & LIST_RET_SUBSCRIBED) { - prot_printf(backend_inbox->out, "%csubscribed", c); + prot_puts(backend_inbox->out, " return "); + for (i = 0; return_optsi; i++) { + unsigned opt = (1 << i); + + if (!(listargs->ret & opt)) continue; + + prot_printf(backend_inbox->out, "%c%s", c, return_optsi); c = ' '; + + if (opt == LIST_RET_STATUS) { + /* print status items */ + const char *status_items = { + /* XXX MUST be in same order as STATUS_* bitmask */ + "messages", "recent", "uidnext", "uidvalidity", "unseen", + "highestmodseq", NULL + }; + + c = '('; + + for (j = 0; status_itemsj; j++) { + if (!(listargs->statusitems & (1 << j))) continue; + + prot_printf(backend_inbox->out, "%c%s", c, + status_itemsj); + c = ' '; + } + + (void)prot_putc(')', backend_inbox->out); + + } } - if (listargs->ret & LIST_RET_CHILDREN) { - prot_printf(backend_inbox->out, "%cchildren", c); + if (listargs->ret & LIST_RET_SPECIALUSE) { + prot_printf(backend_inbox->out, "%cspecial-use", c); c = ' '; } + (void)prot_putc(')', backend_inbox->out); }
View file
cyrus-imapd-2.5.7.8.tar.gz/imap/imapd.h -> cyrus-imapd-2.5.8.12.tar.gz/imap/imapd.h
Changed
@@ -277,6 +277,7 @@ STATUS_UIDVALIDITY = (1<<3), STATUS_UNSEEN = (1<<4), STATUS_HIGHESTMODSEQ = (1<<5) + /* XXX New items MUST be handled in imapd.c:list_data_remote() */ }; /* Arguments to List functions */ @@ -305,6 +306,7 @@ LIST_SEL_REMOTE = (1<<1), LIST_SEL_RECURSIVEMATCH = (1<<2), LIST_SEL_SPECIALUSE = (1<<3) + /* XXX New options MUST be handled in imapd.c:list_data_remote() */ }; /* Bitmask for List return options */ @@ -314,6 +316,7 @@ LIST_RET_SPECIALUSE = (1<<2), LIST_RET_STATUS = (1<<3), LIST_RET_MYRIGHTS = (1<<4) + /* XXX New options MUST be handled in imapd.c:list_data_remote() */ }; /* Bitmask for List name attributes */
View file
cyrus-imapd-2.5.7.8.tar.gz/imap/jcal.c -> cyrus-imapd-2.5.8.12.tar.gz/imap/jcal.c
Changed
@@ -249,9 +249,11 @@ kind_string = icalparameter_get_xname(param); break; +#ifdef HAVE_IANA_PARAMS case ICAL_IANA_PARAMETER: kind_string = icalparameter_get_iana_name(param); break; +#endif default: kind_string = icalparameter_kind_to_string(kind); @@ -445,50 +447,41 @@ } -struct icalrecur_parser { - const char* rule; - char* copy; - char* this_clause; - char* next_clause; - - struct icalrecurrencetype rt; -}; - -extern icalrecurrencetype_frequency icalrecur_string_to_freq(const char* str); -extern void icalrecur_add_byrules(struct icalrecur_parser *parser, short *array, - int size, char* vals); -extern void icalrecur_add_bydayrules(struct icalrecur_parser *parser, - const char* vals); - -static const char *_json_x_value(json_t *jvalue) +static void buf_appendjson(struct buf *buf, json_t *jvalue) { - static char buf21; + switch (json_typeof(jvalue)) { + case JSON_ARRAY: { + size_t i, n = json_array_size(jvalue); + const char *sep = ""; - if (json_is_integer(jvalue)) { - snprintf(buf, sizeof(buf), "%" JSON_INTEGER_FORMAT, - json_integer_value(jvalue)); - return buf; + for (i = 0; i < n; i++, sep = ",") { + buf_appendcstr(buf, sep); + buf_appendjson(buf, json_array_get(jvalue, i)); + } + break; } - else return json_string_value(jvalue); -} -static const char *json_x_value(json_t *jvalue) -{ - static struct buf buf = BUF_INITIALIZER; + case JSON_STRING: + buf_appendcstr(buf, json_string_value(jvalue)); + break; - if (json_is_array(jvalue)) { - size_t i, n = json_array_size(jvalue); - const char *sep = ""; + case JSON_INTEGER: + buf_printf(buf, "%" JSON_INTEGER_FORMAT, json_integer_value(jvalue)); + break; - buf_reset(&buf); - for (i = 0; i < n; i++) { - buf_printf(&buf, "%s%s", - sep, _json_x_value(json_array_get(jvalue, i))); - sep = ","; - } - return buf_cstring(&buf); + case JSON_REAL: + buf_printf(buf, "%f", json_real_value(jvalue)); + break; + + case JSON_TRUE: + case JSON_FALSE: + buf_printf(buf, "%d", json_boolean_value(jvalue)); + break; + + default: + /* Shouldn't get here - ignore object */ + break; } - else return _json_x_value(jvalue); } @@ -548,24 +541,30 @@ break; case ICAL_RECUR_VALUE: - if (json_is_object(jvalue)) { - struct icalrecurrencetype *rt = NULL; - const char *key; - json_t *val; - - json_object_foreach(jvalue, key, val) { - rt = icalrecur_add_rule(&rt, key, val, - (int (*)(void *)) &json_integer_value, - (const char * (*)(void *)) &json_x_value); - if (!rt) break; - } - - if (rt && rt->freq != ICAL_NO_RECURRENCE) - value = icalvalue_new_recur(*rt); - } - else - syslog(LOG_WARNING, "jCal object object expected"); - break; + if (json_is_object(jvalue)) { + struct buf rrule = BUF_INITIALIZER; + struct icalrecurrencetype rt; + const char *key, *sep = ""; + json_t *val; + + /* create an iCal RRULE string from jCal 'recur' object */ + json_object_foreach(jvalue, key, val) { + char *mykey = xstrdup(key); + buf_printf(&rrule, "%s%s=", sep, ucase(mykey)); + buf_appendjson(&rrule, val); + sep = ";"; + free(mykey); + } + + /* parse our iCal RRULE string */ + rt = icalrecurrencetype_from_string(buf_cstring(&rrule)); + buf_free(&rrule); + + if (rt.freq != ICAL_NO_RECURRENCE) value = icalvalue_new_recur(rt); + } + else + syslog(LOG_WARNING, "jCal object object expected"); + break; case ICAL_REQUESTSTATUS_VALUE: /* MUST be an array of 2-3 strings */
View file
cyrus-imapd-2.5.7.8.tar.gz/imap/mbdump.c -> cyrus-imapd-2.5.8.12.tar.gz/imap/mbdump.c
Changed
@@ -816,6 +816,14 @@ return 0; } +struct annotation_entry_t +{ + struct annotation_entry_t *next; + char *name; + char *userid; + struct buf content; +}; + EXPORTED int undump_mailbox(const char *mbname, struct protstream *pin, struct protstream *pout, struct auth_state *auth_state __attribute((unused))) @@ -828,14 +836,15 @@ const char *sieve_path = NULL; int sieve_usehomedir = config_getswitch(IMAPOPT_SIEVEUSEHOMEDIR); const char *userid = NULL; - char *annotation = NULL; + int first_annotation = 1; + struct annotation_entry_t *annotation = NULL; struct buf content = BUF_INITIALIZER; char *seen_file = NULL; char *mboxkey_file = NULL; quota_t old_quota_usageQUOTA_NUMRESOURCES; int res; quota_t newquotasQUOTA_NUMRESOURCES; - quota_t quotalimit = -1; + quota_t quotalimit = -2; annotate_state_t *astate = NULL; memset(&file, 0, sizeof(file)); @@ -861,7 +870,7 @@ eatline(pin, c); return IMAP_PROTOCOL_BAD_PARAMETERS; } - + /* We should now have a number or a NIL */ c = getword(pin, &data); if (!strcmp(data.s, "NIL")) { @@ -884,7 +893,7 @@ } else if(c == ')') { goto done; } - + r = mailbox_open_exclusive(mbname, &mailbox); if (r == IMAP_MAILBOX_NONEXISTENT) { mbentry_t *mbentry = NULL; @@ -899,21 +908,16 @@ /* track quota use */ mailbox_get_usage(mailbox, old_quota_usage); - astate = annotate_state_new(); - r = annotate_state_set_mailbox(astate, mailbox); - if (r) goto done; - while(1) { char fnamebufMAX_MAILBOX_PATH + 1024; int isnowait, sawdigit; unsigned long size; unsigned long cutoff = ULONG_MAX / 10; unsigned digit, cutlim = ULONG_MAX % 10; - annotation = NULL; buf_reset(&content); seen_file = NULL; mboxkey_file = NULL; - + c = getastring(pin, pout, &file); if(c != ' ') { r = IMAP_PROTOCOL_ERROR; @@ -922,8 +926,28 @@ if(!strncmp(file.s, "A-", 2)) { /* Annotation */ + struct annotation_entry_t *prev = annotation; int i; - char *tmpuserid; + + annotation = xmalloc(sizeof(struct annotation_entry_t)); + memset(annotation, 0, sizeof(struct annotation_entry_t)); + buf_reset(&annotation->content); + annotation->next = prev; + + /* is this the first annotation? re-read cyrus.header/index */ + if (first_annotation) { + first_annotation = 0; + mailbox_close(&mailbox); + r = mailbox_open_exclusive(mbname, &mailbox); + if (r) goto done; + + if (!astate) { + astate = annotate_state_new(); + } + + r = annotate_state_set_mailbox(astate, mailbox); + if (r) goto done; + } for(i=2; file.si; i++) { if(file.si == '/') break; @@ -932,53 +956,41 @@ r = IMAP_PROTOCOL_ERROR; goto done; } - tmpuserid = xmalloc(i-2+1); - - memcpy(tmpuserid, &(file.s2), i-2); - tmpuseridi-2 = '\0'; - - annotation = xstrdup(&(file.si)); + annotation->userid = xmalloc(i-2+1); + memset(annotation->userid, 0, i-2+1); + + memcpy(annotation->userid, &(file.s2), i-2); + + annotation->name = xstrdup(&(file.si)); if(prot_getc(pin) != '(') { r = IMAP_PROTOCOL_ERROR; - free(tmpuserid); goto done; - } + } /* Parse the modtime...and ignore it */ c = getword(pin, &data); if (c != ' ') { r = IMAP_PROTOCOL_ERROR; - free(tmpuserid); goto done; } - c = getbastring(pin, pout, &content); + c = getbastring(pin, pout, &annotation->content); /* xxx binary */ if(c != ' ') { r = IMAP_PROTOCOL_ERROR; - free(tmpuserid); goto done; } /* got the contenttype...and ignore it */ c = getastring(pin, pout, &data); - + if(c != ')') { r = IMAP_PROTOCOL_ERROR; - free(tmpuserid); goto done; } - annotate_state_write(astate, annotation, tmpuserid, - &content); - - free(tmpuserid); - free(annotation); - annotation = NULL; - buf_reset(&content); - c = prot_getc(pin); if(c == ')') break; /* that was the last item */ else if(c != ' ') { @@ -1229,24 +1241,48 @@ buf_free(&file); buf_free(&data); - if (r) - annotate_state_abort(&mailbox->annot_state); - if (curfile >= 0) close(curfile); /* we fiddled the files under the hood, so we can't do anything * BUT close it */ mailbox_close(&mailbox); /* time to apply quota (mailbox must be unlocked) */ - if (!r) { - for (res = 0; res < QUOTA_NUMRESOURCES; res++) { - if (newquotasres != QUOTA_UNLIMITED) { - break; - } - } - if (res < QUOTA_NUMRESOURCES) { - mboxlist_setquotas(mbname, newquotas, 0); - } + if (!r && quotalimit != -2) + mboxlist_setquotas(mbname, newquotas, 0); + + /* write annotations */ + if (!r && annotation) { + r = mailbox_open_iwl(mbname, &mailbox); + if (r) goto done2; + + mailbox->i.quota_annot_used = 0; + + astate = annotate_state_new(); + r = annotate_state_set_mailbox(astate, mailbox); + if (r) goto done2; + + while (annotation) { + struct annotation_entry_t *next = annotation->next; + + r = annotate_state_write(astate, annotation->name, + annotation->userid, + &annotation->content); + if (r) goto done2; + + old_quota_usageQUOTA_ANNOTSTORAGE += annotation->content.len; + + free(annotation->name); + free(annotation->userid); + buf_free(&annotation->content); + free(annotation); + + annotation = next; + } + + r = annotate_state_commit(&astate); + astate = NULL; + + mailbox_close(&mailbox); } /* let's make sure the modification times are right */ @@ -1300,12 +1336,10 @@ done2: /* just in case we failed during the modifications, close again */ mailbox_close(&mailbox); - if (!r) - r = annotate_state_commit(&astate); - else + + if (astate) annotate_state_abort(&astate); - free(annotation); - buf_free(&content); + free(seen_file); free(mboxkey_file);
View file
cyrus-imapd-2.5.7.8.tar.gz/imap/mboxname.c -> cyrus-imapd-2.5.8.12.tar.gz/imap/mboxname.c
Changed
@@ -1275,13 +1275,10 @@ name++; /* Skip over terminating '-' */ } else { - /* If we're using unixhierarchysep, DOTCHAR is allowed */ if (!strchr(GOODCHARS, *name) && + /* If we're using unixhierarchysep, DOTCHAR is allowed */ !(unixsep && *name == DOTCHAR)) return IMAP_MAILBOX_BADNAME; - /* If we're not using virtdomains, '@' is not permitted in the mboxname */ - if (!config_virtdomains && *name == '@') - return IMAP_MAILBOX_BADNAME; name++; sawutf7 = 0; }
View file
cyrus-imapd-2.5.7.8.tar.gz/imap/mupdate.c -> cyrus-imapd-2.5.8.12.tar.gz/imap/mupdate.c
Changed
@@ -1600,7 +1600,7 @@ EXISTS, NOTACTIVE, DOESNTEXIST, ISOK, NOOUTPUT } msg = NOOUTPUT; - syslog(LOG_DEBUG, "cmd_set(fd:%d, %s)", C->fd, mailbox); + syslog(LOG_DEBUG, "cmd_set(fd:%d, %s, %d)", C->fd, mailbox, t); pthread_mutex_lock(&mailboxes_mutex); /* LOCK */ @@ -1637,7 +1637,7 @@ } else if (t == SET_DEACTIVATE) { t = SET_RESERVE; } - + if (t == SET_DELETE) { if (!m) { /* Check if we run in a discrete murder topology */ @@ -1645,12 +1645,11 @@ /* Replicated backends with the same server name issue * deletion twice. Suppress bailing out on the second one * (the replica). + * + * Note: This implies deleting a non-existing mailbox is OK. */ - if (strcmp(m->location, location)) { - /* failed; mailbox doesn't exist */ - msg = DOESNTEXIST; - goto done; - } + msg = ISOK; + goto done; } /* otherwise do nothing (local delete on master) */ } else { @@ -1672,13 +1671,14 @@ m->t = t; } else { struct mbent *newm; - + /* allocate new mailbox */ if (acl) { newm = xrealloc(m, sizeof(struct mbent) + strlen(acl)); } else { newm = xrealloc(m, sizeof(struct mbent) + 1); } + newm->mailbox = xstrdup(mailbox); newm->location = xstrdup(location); @@ -1737,7 +1737,7 @@ break; default: break; - } + } } static void cmd_find(struct conn *C, const char *tag, const char *mailbox,
View file
cyrus-imapd-2.5.7.8.tar.gz/imap/sync_client.c -> cyrus-imapd-2.5.8.12.tar.gz/imap/sync_client.c
Changed
@@ -2621,6 +2621,10 @@ /* Check for shutdown file */ if (sync_shutdown_file && !stat(sync_shutdown_file, &sbuf)) { unlink(sync_shutdown_file); + /* Have to exit with r == 0 or do_daemon() will call us again. + * The value of r is unknown from calls to sync_log_reader_begin() below. + */ + r = 0; break; }
View file
cyrus-imapd-2.5.7.8.tar.gz/imap/xcal.c -> cyrus-imapd-2.5.8.12.tar.gz/imap/xcal.c
Changed
@@ -56,14 +56,6 @@ #include "xcal.h" -extern icalvalue_kind icalproperty_kind_to_value_kind(icalproperty_kind kind); -extern const char* icalrecur_freq_to_string(icalrecurrencetype_frequency kind); -extern const char* icalrecur_weekday_to_string(icalrecurrencetype_weekday kind); -#ifdef HAVE_RSCALE -extern const char* icalrecur_skip_to_string(icalrecurrencetype_skip kind); -#endif - - /* * Determine the type (kind) of an iCalendar property value. */ @@ -160,34 +152,6 @@ } -static const struct { - const char *str; - int limit; - size_t offset; -} recurmap = -{ - { "bysecond", ICAL_BY_SECOND_SIZE, - offsetof(struct icalrecurrencetype, by_second) }, - { "byminute", ICAL_BY_MINUTE_SIZE, - offsetof(struct icalrecurrencetype, by_minute) }, - { "byhour", ICAL_BY_HOUR_SIZE, - offsetof(struct icalrecurrencetype, by_hour) }, - { "byday", ICAL_BY_DAY_SIZE, - offsetof(struct icalrecurrencetype, by_day) }, - { "bymonthday", ICAL_BY_MONTHDAY_SIZE, - offsetof(struct icalrecurrencetype, by_month_day) }, - { "byyearday", ICAL_BY_YEARDAY_SIZE, - offsetof(struct icalrecurrencetype, by_year_day) }, - { "byweekno", ICAL_BY_WEEKNO_SIZE, - offsetof(struct icalrecurrencetype, by_week_no) }, - { "bymonth", ICAL_BY_MONTH_SIZE, - offsetof(struct icalrecurrencetype, by_month) }, - { "bysetpos", ICAL_BY_SETPOS_SIZE, - offsetof(struct icalrecurrencetype, by_set_pos) }, - { 0, 0, 0 }, -}; - - /* * Add iCalendar recur-rule-parts to a structured element. */ @@ -196,75 +160,47 @@ void (*add_str)(void *, const char *, const char *)) { - int i, j; - - if (recur->freq == ICAL_NO_RECURRENCE) return; - - add_str(obj, "freq", icalrecur_freq_to_string(recur->freq)); - -#ifdef HAVE_RSCALE - if (*recur->rscale) { - add_str(obj, "rscale", recur->rscale); + char *rrule, *rpart; + tok_t rparts; - if (recur->skip != ICAL_SKIP_BACKWARD) - add_str(obj, "skip", icalrecur_skip_to_string(recur->skip)); - } -#endif - - /* until and count are mutually exclusive */ - if (recur->until.year) { - add_str(obj, "until", icaltime_as_iso_string(recur->until)); - } - else if (recur->count) add_int(obj, "count", recur->count); - - if (recur->interval != 1) add_int(obj, "interval", recur->interval); - - /* Monday is the default, so no need to include it */ - if (recur->week_start != ICAL_MONDAY_WEEKDAY && - recur->week_start != ICAL_NO_WEEKDAY) { - const char *daystr; - - daystr = icalrecur_weekday_to_string( - icalrecurrencetype_day_day_of_week(recur->week_start)); - add_str(obj, "wkst", daystr); + /* generate an iCal RRULE string */ + rrule = icalrecurrencetype_as_string_r(recur); + + /* split string into rparts & values */ + tok_initm(&rparts, rrule, "=;", TOK_TRIMLEFT|TOK_TRIMRIGHT); + while ((rpart = tok_next(&rparts))) { + if (!strcmp(rpart, "UNTIL")) { + /* need to translate date format to ISO */ + struct icaltimetype until = icaltime_from_string(tok_next(&rparts)); + + add_str(obj, "until", icaltime_as_iso_string(until)); + } + else { + /* assume the rpart has multiple values - split them */ + tok_t vlist; + char *val, *p; + + tok_init(&vlist, tok_next(&rparts), ",", + TOK_TRIMLEFT|TOK_TRIMRIGHT); + while ((val = tok_next(&vlist))) { + if (add_int) { + /* try converting value to integer */ + int n = strtol(val, &p, 10); + + if (n && !*p) { + add_int(obj, lcase(rpart), n); + continue; + } + } + + add_str(obj, lcase(rpart), val); + } + tok_fini(&vlist); + } } + tok_fini(&rparts); - /* The BY* parameters can each take a list of values. - * - * Each of the lists is terminated with the value - * ICAL_RECURRENCE_ARRAY_MAX unless the the list is full. - */ - for (j = 0; recurmapj.str; j++) { - short *array = (short *)((size_t) recur + recurmapj.offset); - int limit = recurmapj.limit - 1; - - for (i = 0; i < limit && arrayi != ICAL_RECURRENCE_ARRAY_MAX; i++) { - char temp20; - - if (j == 3) { /* BYDAY */ - const char *daystr; - int pos; - - daystr = icalrecur_weekday_to_string( - icalrecurrencetype_day_day_of_week(arrayi)); - pos = icalrecurrencetype_day_position(arrayi); - - if (pos != 0) { - snprintf(temp, sizeof(temp), "%d%s", pos, daystr); - daystr = temp; - } - - add_str(obj, recurmapj.str, daystr); - } -#ifdef HAVE_RSCALE - else if (j == 7 && ICAL_RSCALE_IS_LEAP_MONTH(arrayi)) { - snprintf(temp, sizeof(temp), "%dL", ICAL_RSCALE_MONTH_NUM(arrayi)); - add_str(obj, recurmapj.str, temp); - } -#endif - else add_int(obj, recurmapj.str, arrayi); - } - } + free(rrule); } @@ -294,15 +230,6 @@ /* * Add an iCalendar recur-rule-part to a XML recur element. */ -static void icalrecur_add_int_as_xml_element(void *xrecur, const char *rpart, - int i) -{ - char ibuf20; - - snprintf(ibuf, sizeof(ibuf), "%d", i); - xmlNewTextChild((xmlNodePtr) xrecur, NULL, BAD_CAST rpart, BAD_CAST ibuf); -} - static void icalrecur_add_string_as_xml_element(void *xrecur, const char *rpart, const char *s) { @@ -327,9 +254,11 @@ kind_string = icalparameter_get_xname(param); break; +#ifdef HAVE_IANA_PARAMS case ICAL_IANA_PARAMETER: kind_string = icalparameter_get_iana_name(param); break; +#endif default: kind_string = icalparameter_kind_to_string(kind); @@ -438,10 +367,9 @@ case ICAL_RECUR_VALUE: { struct icalrecurrencetype recur = icalvalue_get_recur(value); - icalrecurrencetype_add_as_xxx(&recur, xtype, - &icalrecur_add_int_as_xml_element, - &icalrecur_add_string_as_xml_element); - return; + icalrecurrencetype_add_as_xxx(&recur, xtype, NULL, + &icalrecur_add_string_as_xml_element); + return; } case ICAL_REQUESTSTATUS_VALUE: { @@ -662,109 +590,14 @@ } -/* Add an iCalendar recurrence rule part to icalrecurrencetype. - * - * XXX The following structure is opaque libical, but for some stupid - * reason the icalrecur_add_by*rules() functions require it even though - * all they use is the rt field. MUST keep this in sync with icalrecur.c - */ -struct icalrecur_parser { - const char* rule; - char* copy; - char* this_clause; - char* next_clause; - - struct icalrecurrencetype rt; -}; - -extern icalrecurrencetype_frequency icalrecur_string_to_freq(const char* str); -#ifdef HAVE_RSCALE -extern icalrecurrencetype_skip icalrecur_string_to_skip(const char* str); -#endif -extern void icalrecur_add_byrules(struct icalrecur_parser *parser, short *array, - int size, char* vals); -extern void icalrecur_add_bydayrules(struct icalrecur_parser *parser, - const char* vals); - -struct icalrecurrencetype *icalrecur_add_rule(struct icalrecurrencetype **rt, - const char *rpart, void *data, - int (*get_int)(void *), - const char* (*get_str)(void *)) +static void append_byrule(char *byrule, struct buf *vals, struct buf *rrule) { - static struct icalrecur_parser parser; + /* append BY* rule to RRULE buffer */ + buf_printf(rrule, ";%s=%s", ucase(byrule), buf_cstring(vals)); - if (!*rt) { - /* Initialize */ - *rt = &parser.rt; - icalrecurrencetype_clear(*rt); - } - - if (!strcmp(rpart, "freq")) { - (*rt)->freq = icalrecur_string_to_freq(get_str(data)); - } -#ifdef HAVE_RSCALE - else if (!strcmp(rpart, "rscale")) { - (*rt)->rscale = icalmemory_tmp_copy(get_str(data)); - } - else if (!strcmp(rpart, "skip")) { - (*rt)->skip = icalrecur_string_to_skip(get_str(data)); - } -#endif - else if (!strcmp(rpart, "count")) { - (*rt)->count = get_int(data); - } - else if (!strcmp(rpart, "until")) { - (*rt)->until = icaltime_from_string(get_str(data)); - } - else if (!strcmp(rpart, "interval")) { - (*rt)->interval = get_int(data); - if ((*rt)->interval < 1) (*rt)->interval = 1; /* MUST be >= 1 */ - } - else if (!strcmp(rpart, "wkst")) { - (*rt)->week_start = icalrecur_string_to_weekday(get_str(data)); - } - else if (!strcmp(rpart, "byday")) { - icalrecur_add_bydayrules(&parser, get_str(data)); - } - else { - int i; - - for (i = 0; recurmapi.str && strcmp(rpart, recurmapi.str); i++); - - if (recurmapi.str) { - short *array = - (short *)((size_t) *rt + recurmapi.offset); - int limit = recurmapi.limit; - - icalrecur_add_byrules(&parser, array, limit, - icalmemory_tmp_copy(get_str(data))); - } - else { - syslog(LOG_WARNING, "Unknown recurrence rule-part: %s", rpart); - icalrecurrencetype_clear(*rt); - *rt = NULL; - } - } - -#ifdef HAVE_RSCALE - /* When "RSCALE" is not present the default is "YES". - When "RSCALE" is present the default is "BACKWARD". */ - if (!(*rt)->rscale) (*rt)->skip = ICAL_SKIP_YES; - else if ((*rt)->skip == ICAL_SKIP_NO) (*rt)->skip = ICAL_SKIP_BACKWARD; -#endif - - return *rt; -} - - -int xmlElementContent_to_int(void *content) -{ - return atoi((const char *) content); -} - -const char *xmlElementContent_to_str(void *content) -{ - return (const char *) content; + /* free the vals buffer */ + buf_free(vals); + free(vals); } @@ -868,22 +701,57 @@ } case ICAL_RECUR_VALUE: { - struct icalrecurrencetype *rt = NULL; - - for (node = xmlFirstElementChild(xtype); node; - node = xmlNextElementSibling(node)) { - - content = xmlNodeGetContent(node); - rt = icalrecur_add_rule(&rt, (const char *) node->name, content, - &xmlElementContent_to_int, - &xmlElementContent_to_str); - xmlFree(content); - content = NULL; - if (!rt) break; - } - - if (rt && rt->freq != ICAL_NO_RECURRENCE) - value = icalvalue_new_recur(*rt); + struct buf rrule = BUF_INITIALIZER; + struct hash_table byrules; + struct icalrecurrencetype rt; + char *sep = ""; + + construct_hash_table(&byrules, 10, 1); + + /* create an iCal RRULE string from xCal <recur> sub-elements */ + for (node = xmlFirstElementChild(xtype); node; + node = xmlNextElementSibling(node)) { + + content = xmlNodeGetContent(node); + if (!xmlStrncmp(node->name, BAD_CAST "by", 2)) { + /* BY* rules can have a list of values - + assemble them using a hash table */ + struct buf *vals = + hash_lookup((const char *) node->name, &byrules); + + if (vals) { + /* append this value to existing list */ + buf_printf(vals, ",%s", (char *) content); + } + else { + /* create new list with this valiue */ + vals = xzmalloc(sizeof(struct buf)); + buf_setcstr(vals, (char *) content); + hash_insert((char *) node->name, vals, &byrules); + } + } + else { + /* single value rpart */ + buf_printf(&rrule, "%s%s=%s", sep, + ucase((char *) node->name), (char *) content); + sep = ";"; + } + + xmlFree(content); + content = NULL; + } + + /* append the BY* rules to RRULE buffer */ + hash_enumerate(&byrules, + (void (*)(const char*, void*, void*)) &append_byrule, + &rrule); + free_hash_table(&byrules, NULL); + + /* parse our iCal RRULE string */ + rt = icalrecurrencetype_from_string(buf_cstring(&rrule)); + buf_free(&rrule); + + if (rt.freq != ICAL_NO_RECURRENCE) value = icalvalue_new_recur(rt); break; }
View file
cyrus-imapd-2.5.7.8.tar.gz/lib/imapoptions -> cyrus-imapd-2.5.8.12.tar.gz/lib/imapoptions
Changed
@@ -796,7 +796,7 @@ { "ldap_deref", "never", STRINGLIST("search", "find", "always", "never") } /* Specify how aliases dereferencing is handled during search. */ -{ "ldap_domain_base_dn", "", STRING } +{ "ldap_domain_base_dn", NULL, STRING } /* Base DN to search for domain name spaces. */ { "ldap_domain_filter", "(&(objectclass=domainrelatedobject)(associateddomain=%s))", STRING }
View file
cyrus-imapd-2.5.7.8.tar.gz/man/cyr_dbtool.8 -> cyrus-imapd-2.5.8.12.tar.gz/man/cyr_dbtool.8
Changed
@@ -48,6 +48,9 @@ .I config-file +.B \-M + + .B \-n @@ -102,6 +105,9 @@ .BI \-C " config-file" Read configuration options from \fIconfig-file\fR. .TP +.BI \-M +Uses improved MBOX list sort. +.TP .BI \-n Create the database file if it doesn't already exist. .TP
View file
cyrus-imapd-2.5.7.8.tar.gz/man/master.8 -> cyrus-imapd-2.5.8.12.tar.gz/man/master.8
Changed
@@ -144,7 +144,10 @@ rereads its configuration file when it receives a hangup signal, SIGHUP. Services and events may be added, deleted or modified when the configuration file is reread. Any active services removed from the -configuration file will be allowed to run until completion. +configuration file will be allowed to run until completion. Services +added or modified to listen on a privileged port may not be able to +bind the port, depending on your system configuration. In this case a +full restart is needed. .PP .I Master propagates the hangup signal, SIGHUP, to its child service processes, so @@ -155,7 +158,7 @@ file. Children that are servicing a client connection when SIGHUP is received are allowed to run until the client logouts before being recycled. It may take a long time until the client logouts, so a log message is -generated for processes that have not been recycled whithin 30s. +generated for processes that have not been recycled within 30s. .SH NOTES The environment variable \fBCYRUS_VERBOSE\fR can be set to log additional debugging information. Setting the value to 1 results in base level logging.
View file
cyrus-imapd-2.5.7.8.tar.gz/master/master.c -> cyrus-imapd-2.5.8.12.tar.gz/master/master.c
Changed
@@ -2457,33 +2457,52 @@ } maxfd++; /* need 1 greater than maxfd */ - /* how long to wait? - do now so that any scheduled wakeup - * calls get accounted for*/ - tvptr = NULL; - if (schedule && !in_shutdown) { - double delay = timesub(&now, &schedule->mark); - if (delay > 0.0) { - timeval_set_double(&tv, delay); - } - else { - tv.tv_sec = 0; - tv.tv_usec = 0; + int interrupted = 0; + do { + /* how long to wait? - do now so that any scheduled wakeup + * calls get accounted for*/ + gettimeofday(&now, 0); + tvptr = NULL; + if (schedule && !in_shutdown) { + double delay = timesub(&now, &schedule->mark); + if (!interrupted && delay > 0.0) { + timeval_set_double(&tv, delay); + } + else { + tv.tv_sec = 0; + tv.tv_usec = 0; + } + tvptr = &tv; } - tvptr = &tv; - } #if defined(HAVE_UCDSNMP) || defined(HAVE_NETSNMP) - if (tvptr == NULL) blockp = 1; - snmp_select_info(&maxfd, &rfds, tvptr, &blockp); + if (tvptr == NULL) blockp = 1; + snmp_select_info(&maxfd, &rfds, tvptr, &blockp); #endif - errno = 0; - r = myselect(maxfd, &rfds, NULL, NULL, tvptr); - if (r == -1 && errno == EAGAIN) continue; - if (r == -1 && errno == EINTR) continue; - if (r == -1) { - /* uh oh */ - fatalf(1, "select failed: %m"); - } + errno = 0; + r = myselect(maxfd, &rfds, NULL, NULL, tvptr); + + if (r == -1) { + switch (errno) { + case EAGAIN: + case EINTR: + /* Try again to get valid rfds, this time without blocking so we + * will definitely process messages without getting interrupted + * again. */ + interrupted++; + if (interrupted > 5) { + syslog(LOG_WARNING, "Repeatedly interrupted, too many signals?"); + /* Fake a timeout */ + r = 0; + FD_ZERO(&rfds); + } + break; + default: + /* uh oh */ + fatalf(1, "select failed: %m"); + } + } + } while (!in_shutdown && r == -1); #if defined(HAVE_UCDSNMP) || defined(HAVE_NETSNMP) /* check for SNMP queries */
View file
cyrus-imapd-2.5.7.8.tar.gz/ptclient/ldap.c -> cyrus-imapd-2.5.8.12.tar.gz/ptclient/ldap.c
Changed
@@ -933,7 +933,7 @@ if (rc != PTSM_OK) return rc; - if (ptsm->domain_base_dn && ptsm->domain_base_dn0 != '\0' && (strrchr(canon_id, '@') != NULL)) { + if (ptsm->domain_base_dn && (strrchr(canon_id, '@') != NULL)) { syslog(LOG_DEBUG, "Attempting to get domain for %s from %s", canon_id, ptsm->domain_base_dn); /* Get the base dn to search from domain_base_dn searched on domain_scope with @@ -1019,7 +1019,7 @@ * the *only* entry found. */ if (ldap_count_entries(ptsm->ld, res) < 1) { - syslog(LOG_ERR, "No entries found"); + syslog(LOG_ERR, "No entries found (%s, %d)", __func__, __LINE__); } else if (ldap_count_entries(ptsm->ld, res) > 1) { syslog(LOG_ERR, "Multiple entries found: %d", ldap_count_entries(ptsm->ld, res)); } else { @@ -1191,17 +1191,70 @@ char *dn = NULL; rc = ptsmodule_connect(); + if (rc != PTSM_OK) { *reply = "ptsmodule_connect() failed"; return rc; } rc = ptsmodule_get_dn(canon_id, size, &dn); + if (rc != PTSM_OK) { *reply = "identifier not found"; return rc; } + rc = ldap_search_st(ptsm->ld, dn, LDAP_SCOPE_BASE, "(objectclass=*)", attrs, 0, &(ptsm->timeout), &res); + + if (rc != LDAP_SUCCESS) { + *reply = "ldap_search(attribute) failed"; + + if ( rc == LDAP_SERVER_DOWN ) { + ldap_unbind(ptsm->ld); + ptsm->ld = NULL; + rc = PTSM_RETRY; + } else { + rc = PTSM_FAIL; + } + + goto done; + } + + int numvals; + + if ((entry = ldap_first_entry(ptsm->ld, res)) != NULL) { + + if ((char *)ptsm->user_attribute) { + vals = ldap_get_values(ptsm->ld, entry, (char *)ptsm->user_attribute); + + if (vals != NULL) { + numvals = ldap_count_values(vals); + + if (numvals == 1) { + if (!*newstate) { + *dsize = sizeof(struct auth_state); + *newstate = xmalloc(*dsize); + + if (*newstate == NULL) { + *reply = "no memory"; + rc = PTSM_FAIL; + goto done; + } + + (*newstate)->ngroups = 0; + } + + size = strlen(vals0); + strcpy((*newstate)->userid.id, ptsmodule_canonifyid(vals0, size)); + (*newstate)->userid.hash = strhash((*newstate)->userid.id); + } + + ldap_value_free(vals); + vals = NULL; + } + } + } + rc = ptsmodule_expand_tokens(ptsm->member_filter, canon_id, dn, &filter); if (rc != PTSM_OK) { *reply = "ptsmodule_expand_tokens() failed for member filter"; @@ -1227,6 +1280,7 @@ } n = ldap_count_entries(ptsm->ld, res); + if (n < 0) { *reply = "ldap_count_entries() failed"; rc = PTSM_FAIL; @@ -1235,45 +1289,51 @@ *dsize = sizeof(struct auth_state) + (n * sizeof(struct auth_ident)); + *newstate = xmalloc(*dsize); + if (*newstate == NULL) { *reply = "no memory"; rc = PTSM_FAIL; goto done; } + + size = strlen(canon_id); + (*newstate)->ngroups = n; - strcpy((*newstate)->userid.id, canon_id); - (*newstate)->userid.hash = strhash(canon_id); + strcpy((*newstate)->userid.id, ptsmodule_canonifyid(canon_id, size)); + (*newstate)->userid.hash = strhash((*newstate)->userid.id); (*newstate)->mark = time(0); for (i = 0, entry = ldap_first_entry(ptsm->ld, res); entry != NULL; i++, entry = ldap_next_entry(ptsm->ld, entry)) { - vals = ldap_get_values(ptsm->ld, entry, (char *)ptsm->member_attribute); - if (vals == NULL) - continue; + vals = ldap_get_values(ptsm->ld, entry, (char *)ptsm->member_attribute); + if (vals == NULL) + continue; - if ( ldap_count_values( vals ) != 1 ) { - *reply = "too many values"; - rc = PTSM_FAIL; - ldap_value_free(vals); - vals = NULL; - goto done; - } + if ( ldap_count_values( vals ) != 1 ) { + *reply = "too many values"; + rc = PTSM_FAIL; + ldap_value_free(vals); + vals = NULL; + goto done; + } - strcpy((*newstate)->groupsi.id, "group:"); + strcpy((*newstate)->groupsi.id, "group:"); - unsigned int j; - for (j =0; j < strlen(vals0); j++) { - if(Uisupper(vals0j)) - vals0j=tolower(vals0j); - } + unsigned int j; + for (j =0; j < strlen(vals0); j++) { + if(Uisupper(vals0j)) { + vals0j=tolower(vals0j); + } + } - strlcat((*newstate)->groupsi.id, vals0, sizeof((*newstate)->groupsi.id)); - (*newstate)->groupsi.hash = strhash((*newstate)->groupsi.id); + strlcat((*newstate)->groupsi.id, vals0, sizeof((*newstate)->groupsi.id)); + (*newstate)->groupsi.hash = strhash((*newstate)->groupsi.id); - ldap_value_free(vals); - vals = NULL; + ldap_value_free(vals); + vals = NULL; } rc = PTSM_OK; @@ -1343,7 +1403,7 @@ snprintf(domain_filter, sizeof(domain_filter), ptsm->domain_filter, domain); - syslog(LOG_DEBUG, "(groups) Domain filter: %s", domain_filter); + syslog(LOG_DEBUG, "(groups) Base DN: %s, Domain filter: %s", ptsm->domain_base_dn, domain_filter); rc = ldap_search_st(ptsm->ld, ptsm->domain_base_dn, ptsm->domain_scope, domain_filter, domain_attrs, 0, &(ptsm->timeout), &res);
View file
cyrus-imapd-2.5.7.8.tar.gz/ptclient/ptdump.c -> cyrus-imapd-2.5.8.12.tar.gz/ptclient/ptdump.c
Changed
@@ -57,13 +57,20 @@ struct auth_state *authstate = (struct auth_state *)data; int i; - printf("user: "); - fwrite(key, keylen, 1, stdout); - printf(" time: %d groups: %d\n", + if (!strncmp(key, "group:", 6)) { + printf("group: "); + fwrite(key+6, keylen-6, 1, stdout); + } else { + printf("user: "); + fwrite(key, keylen, 1, stdout); + printf(" -> %s\n", authstate->userid.id); + } + + printf(" time: %d\n groups: %d\n", (unsigned)authstate->mark, (unsigned)authstate->ngroups); for (i=0; i < authstate->ngroups; i++) - printf(" %s\n",authstate->groupsi.id); + printf(" %s\n",authstate->groupsi.id); return 0; }
View file
cyrus-imapd-2.5.8.12.tar.gz/tools/htmlstrip.c
Changed
(renamed from doc/text/htmlstrip.c)
View file
cyrus-imapd-2.5.7.8.tar.gz/xversion.h -> cyrus-imapd-2.5.8.12.tar.gz/xversion.h
Changed
@@ -1,3 +1,3 @@ -/* cyrus-imapd 2.5.7.8 */ -#define _CYRUS_VERSION "2.5.7.8" -#define CYRUS_GITVERSION "416a3d99 2016-03-10" +/* cyrus-imapd 2.5.8.12 */ +#define _CYRUS_VERSION "2.5.8.12" +#define CYRUS_GITVERSION "fb7ae876 2016-06-02"
View file
cyrus-imapd.dsc
Changed
@@ -2,7 +2,7 @@ Source: cyrus-imapd Binary: cyrus-imapd Architecture: any -Version: 2.5.7-0~kolab8.1 +Version: 2.5.8-0~kolab12.1 Maintainer: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Uploaders: Paul Klos <kolab@klos2day.nl> Homepage: http://www.cyrusimap.org/ @@ -39,10 +39,9 @@ po-debconf, tcl-dev | tcl8.3-dev, transfig, - xutils-dev | xutils, - zlib1g-dev -Package-List: + xutils-dev | xutils +Package-List: cyrus-imapd deb mail extra -Files: - 00000000000000000000000000000000 0 cyrus-imapd-2.5.7.tar.gz +Files: + 00000000000000000000000000000000 0 cyrus-imapd-2.5.8.12.tar.gz 00000000000000000000000000000000 0 debian.tar.gz
View file
cyrus-imapd.service
Changed
@@ -8,7 +8,6 @@ ExecStartPre=/usr/lib/cyrus-imapd/cyr_systemd_helper start ExecStart=/usr/lib/cyrus-imapd/cyrus-master $CYRUSOPTIONS ExecStopPost=/usr/lib/cyrus-imapd/cyr_systemd_helper stop -PrivateTmp=true Install WantedBy=multi-user.target
View file
debian.changelog
Changed
@@ -1,3 +1,34 @@ + +cyrus-imapd (2.5.8-0~kolab12.1) unstable; urgency=low + + * Check in a snapshot version 12 revisions ahead of the upstream 2.5.8 release + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Thu, 2 Jun 2016 11:30:13 +0100 + +cyrus-imapd (2.5.7-0~kolab26.1) unstable; urgency=low + + * Check in a snapshot version 26 revisions ahead of the upstream 2.5.7 release + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Mon, 9 May 2016 11:30:13 +0100 + +cyrus-imapd (2.5.7-0~kolab25.1) unstable; urgency=low + + * Check in a snapshot version 25 revisions ahead of the upstream 2.5.7 release + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Fri, 29 Apr 2016 11:30:13 +0100 + +cyrus-imapd (2.5.7-0~kolab23.1) unstable; urgency=low + + * Check in a snapshot version 23 revisions ahead of the upstream 2.5.7 release + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Tue, 12 Apr 2016 11:30:13 +0100 + +cyrus-imapd (2.5.7-0~kolab10.1) unstable; urgency=low + + * Check in a snapshot version 10 revisions ahead of the upstream 2.5.7 release + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Mon, 21 Mar 2016 11:30:13 +0100 + cyrus-imapd (2.5.7-0~kolab8.1) unstable; urgency=low * Check in a snapshot version 8 revisions ahead of the upstream 2.5.7 release
View file
debian.rules
Changed
@@ -99,6 +99,7 @@ --with-perl=/usr/bin/perl \ --with-openssl=/usr \ --with-sasl=/usr \ + --without-zlib \ --with-pidfile=/var/run/cyrus-master.pid \ --with-service-path=/usr/lib/cyrus-imapd \ --with-syslogfacility=MAIL \
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.