Projects
Kolab:3.4
cyrus-imapd
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 132
View file
cyrus-imapd.spec
Changed
@@ -38,13 +38,13 @@ Name: cyrus-imapd Summary: A high-performance mail server with IMAP, POP3, NNTP and SIEVE support Version: 2.5 -Release: 0.2.dev20141127.git3123ee08%{?dist} +Release: 0.2.dev20141204.git7f5b99ba%{?dist} License: BSD Group: System Environment/Daemons URL: http://www.cyrusimap.org # Upstream sources -# From 3123ee085528330cd7045a0ba4f9296be77cb5ac +# From 7f5b99bab9641d89735a882761e4d16eca3a4068 Source0: ftp://ftp.andrew.cmu.edu/pub/cyrus/%{_name}-%{real_version}%{?dot_snapshot_version}.tar.gz Source1: cyrus-imapd.imap-2.3.x-conf Source2: cyrus-imapd.cvt_cyrusdb_all
View file
cyrus-imapd-2.5.tar.gz/imap/cyr_expire.c
Changed
@@ -390,6 +390,7 @@ int expire_seconds = 0; char *alt_config = NULL; const char *find_prefix = "*"; + const char *do_user = NULL; struct expire_rock erock; struct delete_rock drock; struct sigaction action; @@ -404,7 +405,7 @@ memset(&drock, 0, sizeof(drock)); strarray_init(&drock.to_delete); - while ((opt = getopt(argc, argv, "C:D:E:X:p:vaxt")) != EOF) { + while ((opt = getopt(argc, argv, "C:D:E:X:p:u:vaxt")) != EOF) { switch (opt) { case 'C': /* alt config file */ alt_config = optarg; @@ -429,6 +430,10 @@ find_prefix = optarg; break; + case 'u': + do_user = optarg; + break; + case 'v': verbose++; break; @@ -517,7 +522,10 @@ } } - mboxlist_findall(NULL, find_prefix, 1, 0, 0, expire, &erock); + if (do_user) + mboxlist_allusermbox(do_user, expire, &erock, /*include_deleted*/1); + else + mboxlist_allmbox(find_prefix, expire, &erock, /*include_deleted*/1); syslog(LOG_NOTICE, "Expired %lu and expunged %lu out of %lu " "messages from %lu mailboxes",
View file
cyrus-imapd-2.5.tar.gz/imap/dav_reconstruct.c
Changed
@@ -92,22 +92,44 @@ static struct caldav_db *caldavdb = NULL; +static int do_user(const char *userid, void *rock __attribute__((unused))) +{ + struct buf fnamebuf = BUF_INITIALIZER; + + printf("Reconstructing DAV DB for %s...\n", userid); + + /* remove existing database entirely */ + /* XXX - build a new file and rename into place? */ + dav_getpath_byuserid(&fnamebuf, userid); + if (buf_len(&fnamebuf)) + unlink(buf_cstring(&fnamebuf)); + buf_free(&fnamebuf); + + mboxlist_allusermbox(userid, do_reconstruct, NULL, 0); + + return 0; +} + int main(int argc, char **argv) { int opt, r; - char *alt_config = NULL, *userid; - struct buf fnamebuf = BUF_INITIALIZER; + char *alt_config = NULL; + int allusers = 0; if ((geteuid()) == 0 && (become_cyrus(/*is_master*/0) != 0)) { fatal("must run as the Cyrus user", EC_USAGE); } - while ((opt = getopt(argc, argv, "C:")) != EOF) { + while ((opt = getopt(argc, argv, "C:a")) != EOF) { switch (opt) { case 'C': /* alt config file */ alt_config = optarg; break; + case 'a': + allusers = 1; + break; + default: usage(); } @@ -127,30 +149,29 @@ signals_set_shutdown(&shut_down); signals_add_handlers(0); - if (optind == argc) usage(); - - userid = argv[optind]; - - printf("Reconstructing DAV DB for %s...\n", userid); caldav_init(); carddav_init(); - /* remove existing database entirely */ - /* XXX - build a new file and rename into place? */ - dav_getpath_byuserid(&fnamebuf, userid); - if (buf_len(&fnamebuf)) - unlink(buf_cstring(&fnamebuf)); - - mboxlist_allusermbox(userid, do_reconstruct, NULL, 0); + if (allusers) { + mboxlist_alluser(do_user, NULL); + } + else if (optind == argc) { + usage(); + } + else { + int i; + for (i = optind; i < argc; i++) + do_user(argv[i], NULL); + } caldav_close(caldavdb); + + carddav_done(); caldav_done(); mboxlist_close(); mboxlist_done(); - buf_free(&fnamebuf); - exit(code); }
View file
cyrus-imapd-2.5.tar.gz/imap/http_caldav.c
Changed
@@ -1051,7 +1051,7 @@ static icalcomponent *record_to_ical(struct mailbox *mailbox, struct index_record *record) { struct buf buf = BUF_INITIALIZER; - icalcomponent *ical = NULL;; + icalcomponent *ical = NULL; /* Load message containing the resource and parse iCal data */ if (!mailbox_map_record(mailbox, record, &buf)) { ical = icalparser_parse_string(buf_cstring(&buf) + record->header_size); @@ -2500,11 +2500,11 @@ if (sscanf(errstr, "No value for %s property", propname) == 1) { /* Empty LOCATION is OK */ - if (!strcmp(propname, "LOCATION")) continue; + if (!strcasecmp(propname, "LOCATION")) continue; + if (!strcasecmp(propname, "COMMENT")) continue; + if (!strcasecmp(propname, "DESCRIPTION")) continue; } } - - return errstr; } } }
View file
cyrus-imapd-2.5.tar.gz/imap/http_carddav.c
Changed
@@ -944,7 +944,7 @@ struct index_record oldrecord; struct stagemsg *stage; char *header; - const char *version = NULL, *uid = NULL, *fullname = NULL; + char *version = NULL, *uid = NULL, *fullname = NULL; quota_t qdiffs[QUOTA_NUMRESOURCES] = QUOTA_DIFFS_DONTCARE_INITIALIZER; uint32_t expunge_uid = 0; time_t now = time(NULL); @@ -956,26 +956,36 @@ while (moreIteration(&i)) { VObject *prop = nextVObject(&i); const char *name = vObjectName(prop); + const wchar_t *value = NULL; if (!strcmp(name, "VERSION")) { - version = fakeCString(vObjectUStringZValue(prop)); - if (strcmp(version, "3.0")) { - txn->error.precond = CARDDAV_SUPP_DATA; - return HTTP_FORBIDDEN; + value = vObjectUStringZValue(prop); + if (value) { + version = fakeCString(value); + if (strcmp(version, "3.0")) { + txn->error.precond = CARDDAV_SUPP_DATA; + ret = HTTP_FORBIDDEN; + goto done; + } } } else if (!strcmp(name, "UID")) { - uid = fakeCString(vObjectUStringZValue(prop)); + value = vObjectUStringZValue(prop); + if (value) + uid = fakeCString(value); } else if (!strcmp(name, "FN")) { - fullname = fakeCString(vObjectUStringZValue(prop)); + value = vObjectUStringZValue(prop); + if (value) + fullname = fakeCString(value); } } /* Sanity check data */ if (!version || !uid || !fullname) { txn->error.precond = CARDDAV_VALID_DATA; - return HTTP_FORBIDDEN; + ret = HTTP_FORBIDDEN; + goto done; } /* Check for existing vCard UID */ @@ -992,7 +1002,8 @@ namespace_addressbook.prefix, owner, strrchr(cdata->dav.mailbox, '.')+1, cdata->dav.resource); txn->error.resource = buf_cstring(&txn->buf); - return HTTP_FORBIDDEN; + ret = HTTP_FORBIDDEN; + goto done; } if (cdata->dav.imap_uid) { @@ -1005,8 +1016,10 @@ time_t lastmod = oldrecord.internaldate; int precond = check_precond(txn, cdata, etag, lastmod); - if (precond != HTTP_OK) - return HTTP_PRECOND_FAILED; + if (precond != HTTP_OK) { + ret = HTTP_PRECOND_FAILED; + goto done; + } } expunge_uid = oldrecord.uid; @@ -1016,7 +1029,8 @@ if (!(f = append_newstage(mailbox->name, now, 0, &stage))) { syslog(LOG_ERR, "append_newstage(%s) failed", mailbox->name); txn->error.desc = "append_newstage() failed\r\n"; - return HTTP_SERVER_ERROR; + ret = HTTP_SERVER_ERROR; + goto done; } /* Create iMIP header for resource */ @@ -1130,5 +1144,10 @@ append_removestage(stage); +done: + free(version); + free(uid); + free(fullname); + return ret; }
View file
cyrus-imapd-2.5.tar.gz/imap/lmtpd.c
Changed
@@ -753,8 +753,8 @@ } } -int deliver_local(deliver_data_t *mydata, const strarray_t *flags, - const char *username, const char *mailboxname) +EXPORTED int deliver_local(deliver_data_t *mydata, const strarray_t *flags, + char *username, const char *mailboxname) { char namebuf[MAX_MAILBOX_BUFFER] = "", *tail; message_data_t *md = mydata->m;
View file
cyrus-imapd-2.5.tar.gz/imap/lmtpd.h
Changed
@@ -71,7 +71,7 @@ /* forward declarations */ extern int deliver_local(deliver_data_t *mydata, const strarray_t *flags, - const char *username, + char *username, const char *mailboxname); extern int deliver_mailbox(FILE *f,
View file
cyrus-imapd-2.5.tar.gz/imap/mailbox.c
Changed
@@ -1639,13 +1639,12 @@ /* * bsearch() function to compare two index record buffers by UID */ -static int rec_compar(const void *a, const void *b) +static int rec_compar(const void *key, const void *mem) { - uint32_t uida = *((uint32_t *) a); - uint32_t uidb = *((uint32_t *) b); - - if (uida < uidb) return -1; - return (uida > uidb); + uint32_t uid = *((uint32_t *) key); + uint32_t recuid = ntohl(*((bit32 *)((const char *)mem+OFFSET_UID))); + if (uid < recuid) return -1; + return (uid > recuid); } /*
View file
cyrus-imapd-2.5.tar.gz/imap/mboxlist.c
Changed
@@ -2287,6 +2287,46 @@ proc, rock, 0); } +struct alluser_rock { + char *prev; + user_cb *proc; + void *rock; +}; + +static int alluser_cb(void *rock, + const char *key, size_t keylen, + const char *val __attribute__((unused)), + size_t vallen __attribute__((unused))) +{ + struct alluser_rock *urock = (struct alluser_rock *)rock; + char *mboxname = xstrndup(key, keylen); + const char *userid = mboxname_to_userid(mboxname); + int r = 0; + + if (userid) { + if (strcmpsafe(urock->prev, userid)) { + r = urock->proc(userid, urock->rock); + free(urock->prev); + urock->prev = xstrdup(userid); + } + } + + free(mboxname); + return r; +} + +EXPORTED int mboxlist_alluser(user_cb *proc, void *rock) +{ + struct alluser_rock urock; + int r = 0; + urock.prev = NULL; + urock.proc = proc; + urock.rock = rock; + r = cyrusdb_foreach(mbdb, "", 0, skipdel_cb, alluser_cb, &urock, NULL); + free(urock.prev); + return r; +} + EXPORTED int mboxlist_allusermbox(const char *userid, foreach_cb *proc, void *rock, int incdel) {
View file
cyrus-imapd-2.5.tar.gz/imap/mboxlist.h
Changed
@@ -209,8 +209,10 @@ mbentry_t **mbentryp); /* direct access to subs DB */ +typedef int user_cb(const char *userid, void *rock); int mboxlist_allsubs(const char *userid, foreach_cb *proc, void *rock); int mboxlist_allmbox(const char *prefix, foreach_cb *proc, void *rock, int incdel); +int mboxlist_alluser(user_cb *proc, void *rock); int mboxlist_allusermbox(const char *userid, foreach_cb *proc, void *rock, int include_deleted);
View file
cyrus-imapd-2.5.tar.gz/imap/proc.c
Changed
@@ -103,6 +103,7 @@ else { buf_setcstr(&buf, config_dir); buf_appendcstr(&buf, FNAME_PROCDIR); + buf_putc(&buf, '/'); } if (pid)
View file
cyrus-imapd-2.5.tar.gz/man/cyr_expire.8
Changed
@@ -60,6 +60,9 @@ .BI \-p " mailbox-prefix" ] [ +.BI \-u " username" +] +[ .B \-t ] [ @@ -140,6 +143,10 @@ Only find mailboxes starting with this prefix, e.g. "user.justgotspammedlots". .TP +\fB\-u \fIuserid\fR +Only find mailboxes belonging to this user, e.g. +"justgotspammedlots@example.com". +.TP \fB\-t\fR Remove any user flags which are not used by remaining (not expunged) messages. .TP
View file
cyrus-imapd.dsc
Changed
@@ -2,7 +2,7 @@ Source: cyrus-imapd Binary: cyrus-imapd Architecture: any -Version: 2.5~dev2014112701-0~kolab1 +Version: 2.5~dev2014120401-0~kolab1 Maintainer: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Uploaders: Paul Klos <kolab@klos2day.nl> Homepage: http://www.cyrusimap.org/
View file
debian.changelog
Changed
@@ -1,3 +1,9 @@ +cyrus-imapd (2.5~dev2014120401-0~kolab1) unstable; urgency=low + + * New snapshot at 7f5b99bab9641d89735a882761e4d16eca3a4068 + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Thu, 4 Dec 2014 11:30:13 +0100 + cyrus-imapd (2.5~dev2014112701-0~kolab1) unstable; urgency=low * New snapshot at 3123ee085528330cd7045a0ba4f9296be77cb5ac
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
.