Hi Antoine, all. For some months I was updating the cyrus-imapd port, upstreaming the upstreamable patches and working with the upstream to improve additional features of the port as follows.
Upstreamed patches [1]: * patch-configure * patch-lib_byteorder64_h * patch-imap_fud_c You already removed the first 2 patches in the latest port update and modified a bit the 3rd one. I've also upstreamed that modification. [1.1] A workaround for the lack of deflatePending in zlib was implemented [2][3] which is needed for the http component of cyrus-imapd (not yet enabled in the port). CLD2 dependency checks were removed [4]. SNMP was finally removed from cyrus-imapd [5] (metrics are implemented with Prometheus now). SSE4.2 implementation for CRC32 was removed [6]. A script that was part of the autoconf setup had a hardcoded #!/bin/bash which was preventing the rebuild of configure & co on OpenBSD. Fixed [7]. I also disabled nntp. Not sure if you know someone still using it, but it had a critical vuln some time ago, so if nobody is using it, I guess it's better to disable it. I'm including below a patch for all these changes in the port. Then there are more changes already upstreamed, that didn't make it into the 3.2.4 release, though they are already in the 3.2 branch and should be included in the next 3.2.5 release. These are related to the format specifier differences on Linux and OpenBSD, i.e. format specifiers in printf/scanf for types like time_t, off_t, etc. (%ld vs %ldd). [8] The cross-platform fixes that we implemented with the upstream [9] remove the following patches for non-http build: patch-imap_conversations_c patch-imap_mailbox_c patch-imap_mbexamine_c patch-imap_seen_db_c patch-imap_sync_support_c patch-imtest_imtest_c patch-lib_auth_pts_c patch-lib_prot_c patch-master_master_c patch-notifyd_notify_mailto_c patch-sieve_sieved_c and fix about 60 related additional issues and warnings for a http-enabled build. We have also determined the cause for the 37 "unknown attribute 'optimize' ignored" warning and fixed it upstream. The fix will be in the 3.2.5. [10] After all this, the only patches that would remain in the port would be the ones that fix the paths specific to OpenBSD in man pages and some scripts (e.g. /usr/bin vs /usr/local/bin), not sure if there's a way to upstream them too. At this moment I'm also preparing a diff for the cyrus-imapd flavors, though I'd probably wait for the 3.2.5 to have a clean base before sending the diff. The JMAP subcomponent of the http component of cyrus-imapd has a dependency on wslay-1.1.1. The wslay v1.1.0 was missing one change on which cyrus-imapd is relying [11], so I asked [12] the wslay maintainer to release a new version, which he has done about 4 months ago. Could you please update it in the ports? The current version is still 1.1.0. Regards, Anatoli [1] https://github.com/cyrusimap/cyrus-imapd/pull/3129 [1.1] https://github.com/cyrusimap/cyrus-imapd/pull/3239 [2] https://www.mail-archive.com/cyrus-devel@lists.andrew.cmu.edu/msg04440.html [3] https://github.com/cyrusimap/cyrus-imapd/pull/3061 [4] https://github.com/cyrusimap/cyrus-imapd/pull/3112 [5] https://github.com/cyrusimap/cyrus-imapd/issues/1765 [6] https://github.com/cyrusimap/cyrus-imapd/pull/3113 [7] https://github.com/cyrusimap/cyrus-imapd/issues/3143 [8] https://github.com/cyrusimap/cyrus-imapd/issues/3128 [9] https://github.com/cyrusimap/cyrus-imapd/pull/3262 [10] https://github.com/cyrusimap/cyrus-imapd/issues/3265 [11] https://www.mail-archive.com/cyrus-devel@lists.andrew.cmu.edu/msg04445.html [12] https://github.com/tatsuhiro-t/wslay/issues/57 -------------------------------------------------------------------------------- diff --git Makefile Makefile index c7fb05ebcee..bfee0b835b1 100644 --- Makefile +++ Makefile @@ -39,8 +39,7 @@ LIB_DEPENDS= databases/sqlite3 \ CONFIGURE_STYLE= gnu CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \ - LDFLAGS="-L${LOCALBASE}/lib" \ - cyrus_cv_sse42=no + LDFLAGS="-L${LOCALBASE}/lib" CONFIGURE_ARGS= --bindir=${PREFIX}/cyrus/bin \ --libexec=${PREFIX}/cyrus/libexec \ --sbindir=${PREFIX}/cyrus/sbin \ @@ -48,17 +47,12 @@ CONFIGURE_ARGS= --bindir=${PREFIX}/cyrus/bin \ --with-cyrus-user=_cyrus \ --with-syslogfacility=MAIL \ --without-chardet \ - --without-cld2 \ --without-sphinx-build \ --without-zeroskip \ --disable-gssapi \ --enable-autocreate \ --enable-idled \ - --enable-murder \ - --enable-nntp - -# XXX FLAVOR -CONFIGURE_ARGS += --without-snmp + --enable-murder # XXX notyet; FLAVOR CONFIGURE_ARGS += --without-clamav \ diff --git patches/patch-imap_conversations_c patches/patch-imap_conversations_c deleted file mode 100644 index 9eab9396e0d..00000000000 --- patches/patch-imap_conversations_c +++ /dev/null @@ -1,16 +0,0 @@ -$OpenBSD: patch-imap_conversations_c,v 1.3 2020/05/14 12:26:39 ajacoutot Exp $ - -64 bit time_t - -Index: imap/conversations.c ---- imap/conversations.c.orig -+++ imap/conversations.c -@@ -567,7 +567,7 @@ static int _conversations_set_key(struct conversations - if (i) buf_putc(&buf, ','); - buf_printf(&buf, CONV_FMT, cid); - } -- buf_printf(&buf, " %lu", stamp); -+ buf_printf(&buf, " %lld", stamp); - - r = cyrusdb_store(state->db, - key, keylen, diff --git patches/patch-imap_fud_c patches/patch-imap_fud_c deleted file mode 100644 index cc6a8f8d327..00000000000 --- patches/patch-imap_fud_c +++ /dev/null @@ -1,17 +0,0 @@ -$OpenBSD: patch-imap_fud_c,v 1.2 2020/08/28 09:53:04 ajacoutot Exp $ - -Index: imap/fud.c ---- imap/fud.c.orig -+++ imap/fud.c -@@ -96,8 +96,10 @@ static void send_reply(struct sockaddr *sfrom, socklen - - static int soc = 0; /* inetd (master) has handed us the port as stdin */ - --#ifndef MAXDOMNAME -+#ifndef MAXLOGNAME - #define MAXLOGNAME 16 /* should find out for real */ -+#endif -+#ifndef MAXDOMNAME - #define MAXDOMNAME 20 /* should find out for real */ - #endif - diff --git patches/patch-imap_mailbox_c patches/patch-imap_mailbox_c deleted file mode 100644 index 0793441fdfa..00000000000 --- patches/patch-imap_mailbox_c +++ /dev/null @@ -1,34 +0,0 @@ -$OpenBSD: patch-imap_mailbox_c,v 1.19 2020/05/30 10:09:27 ajacoutot Exp $ - -64 bit time_t - -Index: imap/mailbox.c ---- imap/mailbox.c.orig -+++ imap/mailbox.c -@@ -2899,7 +2899,7 @@ static uint32_t crc_basic(const struct mailbox *mailbo - flagcrc ^= crc32_cstring(buf); - } - -- snprintf(buf, sizeof(buf), "%u " MODSEQ_FMT " %lu (%u) %lu %s", -+ snprintf(buf, sizeof(buf), "%u " MODSEQ_FMT " %lld (%u) %lld %s", - record->uid, record->modseq, record->last_updated, - flagcrc, - record->internaldate, -@@ -2959,7 +2959,7 @@ static uint32_t crc_virtannot(struct mailbox *mailbox, - } - - if (record->savedate && mailbox->i.minor_version >= 15) { -- buf_printf(&buf, "%lu", record->savedate); -+ buf_printf(&buf, "%lld", record->savedate); - crc ^= crc_annot(record->uid, IMAP_ANNOT_NS "savedate", "", &buf); - buf_reset(&buf); - } -@@ -4520,7 +4520,7 @@ static int mailbox_index_repack(struct mailbox *mailbo - if (mailbox->i.minor_version >= 15 && repack->newmailbox.i.minor_version < 15) { - if (record->savedate) { - buf_reset(&buf); -- buf_printf(&buf, "%lu", record->savedate); -+ buf_printf(&buf, "%lld", record->savedate); - r = annotate_state_writesilent(astate, IMAP_ANNOT_NS "savedate", "", &buf); - if (r) goto done; - } diff --git patches/patch-imap_mbexamine_c patches/patch-imap_mbexamine_c deleted file mode 100644 index 2ddae7901a0..00000000000 --- patches/patch-imap_mbexamine_c +++ /dev/null @@ -1,40 +0,0 @@ -$OpenBSD: patch-imap_mbexamine_c,v 1.12 2020/05/30 10:09:27 ajacoutot Exp $ - -64 bit time_t - -Index: imap/mbexamine.c ---- imap/mbexamine.c.orig -+++ imap/mbexamine.c -@@ -231,7 +231,7 @@ static int do_examine(struct findall_data *data, void - mailbox->i.start_offset, mailbox->i.record_size); - printf(" Number of Messages: %u Mailbox Size: " QUOTA_T_FMT " bytes Annotations Size: " QUOTA_T_FMT " bytes\n", - mailbox->i.exists, mailbox->i.quota_mailbox_used, mailbox->i.quota_annot_used); -- printf(" Last Append Date: (%lu) %s", -+ printf(" Last Append Date: (%lld) %s", - mailbox->i.last_appenddate, ctime(&mailbox->i.last_appenddate)); - printf(" UIDValidity: %u Last UID: %u\n", - mailbox->i.uidvalidity, mailbox->i.last_uid); -@@ -255,8 +255,8 @@ static int do_examine(struct findall_data *data, void - } - } - printf("\n"); -- printf(" Last POP3 Login: (%ld) %s", mailbox->i.pop3_last_login, -- ctime((const long *) &mailbox->i.pop3_last_login)); -+ printf(" Last POP3 Login: (%lld) %s", mailbox->i.pop3_last_login, -+ ctime((const long long *) &mailbox->i.pop3_last_login)); - printf(" Highest Mod Sequence: " MODSEQ_FMT "\n", - mailbox->i.highestmodseq); - -@@ -277,10 +277,10 @@ static int do_examine(struct findall_data *data, void - } - - printf("%06u> UID:%08u" -- " INT_DATE:%lu SENTDATE:%lu SAVEDATE:%lu SIZE:%-6u\n", -+ " INT_DATE:%lld SENTDATE:%lld SAVEDATE:%lld SIZE:%-6u\n", - msgno, record->uid, record->internaldate, - record->sentdate, record->savedate, record->size); -- printf(" > HDRSIZE:%-6u LASTUPD :%lu SYSFLAGS:%08X", -+ printf(" > HDRSIZE:%-6u LASTUPD :%lld SYSFLAGS:%08X", - record->header_size, record->last_updated, - record->system_flags); - diff --git patches/patch-imap_seen_db_c patches/patch-imap_seen_db_c deleted file mode 100644 index 575ed495cbe..00000000000 --- patches/patch-imap_seen_db_c +++ /dev/null @@ -1,16 +0,0 @@ -$OpenBSD: patch-imap_seen_db_c,v 1.3 2018/05/18 11:16:43 ajacoutot Exp $ - -64 bit time_t - -Index: imap/seen_db.c ---- imap/seen_db.c.orig -+++ imap/seen_db.c -@@ -295,7 +295,7 @@ EXPORTED int seen_write(struct seen *seendb, const cha - seendb->user, uniqueid); - } - -- snprintf(data, sz, "%d %lu %u %lu %s", SEEN_VERSION, -+ snprintf(data, sz, "%d %lld %u %lld %s", SEEN_VERSION, - sd->lastread, sd->lastuid, - sd->lastchange, sd->seenuids); - datalen = strlen(data); diff --git patches/patch-imap_sync_support_c patches/patch-imap_sync_support_c deleted file mode 100644 index 852cb88d39f..00000000000 --- patches/patch-imap_sync_support_c +++ /dev/null @@ -1,16 +0,0 @@ -$OpenBSD: patch-imap_sync_support_c,v 1.4 2020/05/14 12:26:39 ajacoutot Exp $ - -64 bit time_t - -Index: imap/sync_support.c ---- imap/sync_support.c.orig -+++ imap/sync_support.c -@@ -4963,7 +4963,7 @@ static void log_record(const char *name, struct mailbo - struct index_record *record) - { - syslog(LOG_NOTICE, "SYNCNOTICE: %s uid:%u modseq:" MODSEQ_FMT " " -- "last_updated:%lu internaldate:%lu flags:(%s) cid:" CONV_FMT, -+ "last_updated:%lld internaldate:%lld flags:(%s) cid:" CONV_FMT, - name, record->uid, record->modseq, - record->last_updated, record->internaldate, - make_flags(mailbox, record), record->cid); diff --git patches/patch-imtest_imtest_c patches/patch-imtest_imtest_c deleted file mode 100644 index 1e0b4cf8f12..00000000000 --- patches/patch-imtest_imtest_c +++ /dev/null @@ -1,16 +0,0 @@ -$OpenBSD: patch-imtest_imtest_c,v 1.5 2020/10/09 08:47:57 ajacoutot Exp $ - -64 bit time_t - -Index: imtest/imtest.c ---- imtest/imtest.c.orig -+++ imtest/imtest.c -@@ -1980,7 +1980,7 @@ static void send_recv_test(void) - - end=time(NULL); - -- printf("took %ld seconds\n", end - start); -+ printf("took %lld seconds\n", end - start); - } - - /*********************************** POP3 ************************************/ diff --git patches/patch-lib_auth_pts_c patches/patch-lib_auth_pts_c deleted file mode 100644 index aec81dfa723..00000000000 --- patches/patch-lib_auth_pts_c +++ /dev/null @@ -1,16 +0,0 @@ -$OpenBSD: patch-lib_auth_pts_c,v 1.3 2018/05/18 11:16:43 ajacoutot Exp $ - -64 bit time_t - -Index: lib/auth_pts.c ---- lib/auth_pts.c.orig -+++ lib/auth_pts.c -@@ -400,7 +400,7 @@ static int ptload(const char *identifier, struct auth_ - - syslog(LOG_DEBUG, - "ptload(): fetched cache record (%s)" \ -- "(mark %ld, current %ld, limit %ld)", identifier, -+ "(mark %lld, current %lld, limit %lld)", identifier, - fetched->mark, now, now - timeout); - - if (fetched->mark > (now - timeout)) { diff --git patches/patch-lib_prot_c patches/patch-lib_prot_c deleted file mode 100644 index 6b4b43545b6..00000000000 --- patches/patch-lib_prot_c +++ /dev/null @@ -1,25 +0,0 @@ -$OpenBSD: patch-lib_prot_c,v 1.4 2020/05/14 12:26:39 ajacoutot Exp $ - -64 bit time_t - -Index: lib/prot.c ---- lib/prot.c.orig -+++ lib/prot.c -@@ -816,7 +816,7 @@ EXPORTED int prot_fill(struct protstream *s) - char timebuf[20]; - - time(&newtime); -- snprintf(timebuf, sizeof(timebuf), "<%ld<", newtime); -+ snprintf(timebuf, sizeof(timebuf), "<%lld<", newtime); - n = write(s->logfd, timebuf, strlen(timebuf)); - - left = s->cnt; -@@ -879,7 +879,7 @@ static void prot_flush_log(struct protstream *s) - char timebuf[20]; - - time(&newtime); -- snprintf(timebuf, sizeof(timebuf), ">%ld>", newtime); -+ snprintf(timebuf, sizeof(timebuf), ">%lld>", newtime); - n = write(s->logfd, timebuf, strlen(timebuf)); - - do { diff --git patches/patch-master_master_c patches/patch-master_master_c deleted file mode 100644 index 0ec822c4a81..00000000000 --- patches/patch-master_master_c +++ /dev/null @@ -1,23 +0,0 @@ -$OpenBSD: patch-master_master_c,v 1.2 2020/05/14 12:26:39 ajacoutot Exp $ - -warning: format specifies type 'long' but the argument has type 'rlim_t' (aka 'unsigned long long') [-Wformat] - -Index: master/master.c ---- master/master.c.orig -+++ master/master.c -@@ -1983,13 +1983,13 @@ static void limit_fds(rlim_t x) - } - - if (verbose > 1) { -- syslog(LOG_DEBUG, "set maximum file descriptors to %ld/%ld", -+ syslog(LOG_DEBUG, "set maximum file descriptors to %llu/%llu", - rl.rlim_cur, rl.rlim_max); - } - - if (setrlimit(RLIMIT_NUMFDS, &rl) < 0) { - syslog(LOG_ERR, -- "setrlimit: Unable to set file descriptors limit to %ld: %m", -+ "setrlimit: Unable to set file descriptors limit to %llu: %m", - rl.rlim_cur); - } - } diff --git patches/patch-notifyd_notify_mailto_c patches/patch-notifyd_notify_mailto_c deleted file mode 100644 index 5332bc0a04f..00000000000 --- patches/patch-notifyd_notify_mailto_c +++ /dev/null @@ -1,16 +0,0 @@ -$OpenBSD: patch-notifyd_notify_mailto_c,v 1.3 2018/05/18 11:16:43 ajacoutot Exp $ - -64 bit time_t - -Index: notifyd/notify_mailto.c ---- notifyd/notify_mailto.c.orig -+++ notifyd/notify_mailto.c -@@ -110,7 +110,7 @@ char* notify_mailto(const char *class, - return strdup("NO mailto could not spawn sendmail process"); - - t = time(NULL); -- snprintf(outmsgid, sizeof(outmsgid), "<cmu-sieve-%d-%lu-%d@%s>", -+ snprintf(outmsgid, sizeof(outmsgid), "<cmu-sieve-%d-%lld-%d@%s>", - (int) sm_pid, t, global_outgoing_count++, config_servername); - - fprintf(sm, "Message-ID: %s\r\n", outmsgid); diff --git patches/patch-sieve_sieved_c patches/patch-sieve_sieved_c deleted file mode 100644 index 5b83f02e5d7..00000000000 --- patches/patch-sieve_sieved_c +++ /dev/null @@ -1,26 +0,0 @@ -$OpenBSD: patch-sieve_sieved_c,v 1.1 2020/08/28 09:53:04 ajacoutot Exp $ - -sieve/sieved.c:161:61: warning: format specifies type 'unsigned long' but the argument has type 'unsigned long long' [-Wformat] -sieve/sieved.c:176:29: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat] - -Index: sieve/sieved.c ---- sieve/sieved.c.orig -+++ sieve/sieved.c -@@ -158,7 +158,7 @@ static void print_stringlist(const char *label, strarr - - static void print_time(uint64_t t) - { -- printf(" %02lu:%02lu:%02lu", t / 3600, (t % 3600) / 60, t % 60); -+ printf(" %02llu:%02llu:%02llu", t / 3600, (t % 3600) / 60, t % 60); - } - - static void print_vallist(const char *label, arrayu64_t *list, -@@ -173,7 +173,7 @@ static void print_vallist(const char *label, arrayu64_ - - if (!(x % 5)) printf("\n\t\t"); - if (print_cb) print_cb(i); -- else printf(" %lu", i); -+ else printf(" %llu", i); - } - printf("\n\t]"); - diff --git pkg/PLIST pkg/PLIST index 87efee63c59..06e52dfbe56 100644 --- pkg/PLIST +++ pkg/PLIST @@ -28,7 +28,6 @@ cyrus/libexec/ cyrus/libexec/lmtpproxyd @bin cyrus/libexec/master @bin cyrus/libexec/mupdate -@bin cyrus/libexec/nntpd @bin cyrus/libexec/notifyd @bin cyrus/libexec/pop3d cyrus/libexec/pop3proxyd @@ -74,7 +73,6 @@ cyrus/man/man8/ @man cyrus/man/man8/cyr_synclog.8 @man cyrus/man/man8/cyr_virusscan.8 @man cyrus/man/man8/deliver.8 -@man cyrus/man/man8/fetchnews.8 @man cyrus/man/man8/fud.8 @man cyrus/man/man8/idled.8 @man cyrus/man/man8/imapd.8 @@ -84,7 +82,6 @@ cyrus/man/man8/ @man cyrus/man/man8/mbexamine.8 @man cyrus/man/man8/mbpath.8 @man cyrus/man/man8/mbtool.8 -@man cyrus/man/man8/nntpd.8 @man cyrus/man/man8/notifyd.8 @man cyrus/man/man8/pop3d.8 @man cyrus/man/man8/quota.8 @@ -116,7 +113,6 @@ cyrus/sbin/ @bin cyrus/sbin/cyr_virusscan @bin cyrus/sbin/cyrdump @bin cyrus/sbin/deliver -@bin cyrus/sbin/fetchnews @bin cyrus/sbin/ipurge @bin cyrus/sbin/mbexamine @bin cyrus/sbin/mbpath