From 61f0dd078be2a9554010c0da29373d60616ccb23 Mon Sep 17 00:00:00 2001 From: ajacoutot Date: Sun, 12 Dec 2010 11:52:30 +0000 Subject: [PATCH] Unbreak. Thanks to cyrus developer Bron Gondwana for the huge help in debugging the issue and for actually fixing it. While here, move to pkg-readmes. --- mail/cyrus-imapd/Makefile | 8 +++---- .../patches/patch-imap_cyr_expire_c | 17 ++++++++++++++ mail/cyrus-imapd/patches/patch-imap_mailbox_c | 21 +++++++++++++++++ mail/cyrus-imapd/pkg/DESCR-main | 15 +----------- mail/cyrus-imapd/pkg/DESCR-perl | 2 +- mail/cyrus-imapd/pkg/MESSAGE-main | 3 --- mail/cyrus-imapd/pkg/PLIST-main | 3 ++- mail/cyrus-imapd/pkg/README-main | 23 +++++++++++++++++++ 8 files changed, 68 insertions(+), 24 deletions(-) create mode 100644 mail/cyrus-imapd/patches/patch-imap_cyr_expire_c create mode 100644 mail/cyrus-imapd/patches/patch-imap_mailbox_c delete mode 100644 mail/cyrus-imapd/pkg/MESSAGE-main create mode 100644 mail/cyrus-imapd/pkg/README-main diff --git a/mail/cyrus-imapd/Makefile b/mail/cyrus-imapd/Makefile index b6c462bb7dc..7b873239696 100644 --- a/mail/cyrus-imapd/Makefile +++ b/mail/cyrus-imapd/Makefile @@ -1,6 +1,4 @@ -# $OpenBSD: Makefile,v 1.49 2010/12/05 22:20:37 ajacoutot Exp $ - -BROKEN= talk to ajacoutot@ for details +# $OpenBSD: Makefile,v 1.50 2010/12/12 11:52:30 ajacoutot Exp $ COMMENT-main= Cyrus IMAP server COMMENT-perl= perl utils for the Cyrus IMAP server @@ -11,8 +9,8 @@ PKGNAME-main= ${DISTNAME} FULLPKGNAME-perl=cyrus-imapd-perl-${V} FULLPKGPATH-perl=mail/cyrus-imapd,-perl -REVISION-main= 5 -REVISION-perl= 0 +REVISION-main= 6 +REVISION-perl= 1 CATEGORIES= mail diff --git a/mail/cyrus-imapd/patches/patch-imap_cyr_expire_c b/mail/cyrus-imapd/patches/patch-imap_cyr_expire_c new file mode 100644 index 00000000000..110328a0e42 --- /dev/null +++ b/mail/cyrus-imapd/patches/patch-imap_cyr_expire_c @@ -0,0 +1,17 @@ +$OpenBSD: patch-imap_cyr_expire_c,v 1.1 2010/12/12 11:52:30 ajacoutot Exp $ + +From 48f2fab8c42716201c1f55646110df306ae750ed Mon Sep 17 00:00:00 2001 +From: Bron Gondwana +Date: Sun, 31 Oct 2010 00:22:37 +0000 +Subject: Commit mailbox after annotation based expiry + +--- imap/cyr_expire.c.orig Sun Dec 12 09:50:04 2010 ++++ imap/cyr_expire.c Sun Dec 12 09:50:26 2010 +@@ -228,6 +228,7 @@ int expire(char *name, int matchlen, int maycreate __a + } + + r = mailbox_expunge(mailbox, expire_cb, erock, NULL); ++ if (!r) r = mailbox_commit(mailbox); + if (r) { + syslog(LOG_ERR, "failed to expire old messages: %s", mailbox->name); + } diff --git a/mail/cyrus-imapd/patches/patch-imap_mailbox_c b/mail/cyrus-imapd/patches/patch-imap_mailbox_c new file mode 100644 index 00000000000..437067e4578 --- /dev/null +++ b/mail/cyrus-imapd/patches/patch-imap_mailbox_c @@ -0,0 +1,21 @@ +$OpenBSD: patch-imap_mailbox_c,v 1.4 2010/12/12 11:52:30 ajacoutot Exp $ + +From 2f2018020d9976bdbd419632328e144f7e43574c Mon Sep 17 00:00:00 2001 +From: Bron Gondwana +Date: Sun, 12 Dec 2010 11:27:25 +0000 +Subject: Bug #3370 - always map_refresh before reading index header + +--- imap/mailbox.c.orig Mon Nov 29 14:28:06 2010 ++++ imap/mailbox.c Sun Dec 12 12:34:47 2010 +@@ -1348,6 +1348,11 @@ static int mailbox_read_index_header(struct mailbox *m + if (mailbox->index_size < INDEX_HEADER_SIZE) + return IMAP_MAILBOX_BADFORMAT; + ++ /* need to make sure we're reading fresh data! */ ++ map_refresh(mailbox->index_fd, 1, &mailbox->index_base, ++ &mailbox->index_len, mailbox->index_size, ++ "index", mailbox->name); ++ + r = mailbox_buf_to_index_header(mailbox->index_base, &mailbox->i); + if (r) return r; + diff --git a/mail/cyrus-imapd/pkg/DESCR-main b/mail/cyrus-imapd/pkg/DESCR-main index 3df298cd7fa..0158163f2b0 100644 --- a/mail/cyrus-imapd/pkg/DESCR-main +++ b/mail/cyrus-imapd/pkg/DESCR-main @@ -10,18 +10,5 @@ read/write connections to the same mailbox are permitted. The server supports access control lists on mailboxes and storage quotas on mailbox hierarchies. -Because of cyrus-imapd+OpenBSD mmap incompatibility, the server runs in -compat mode incuring a performance penalty under high load. - -Following man pages have been renamed to avoid conflicts with other -packages: - fetchnews(8) -> cyrus-fetchnews(8) # conflict with news/leafnode - idled(8) -> cyrus-idled(8) # conflict with sysutils/idled - master(8) -> cyrus-master(8) # conflict with mail/postfix - imapd(8) -> cyrus-imapd(8) # conflict with mail/courier-imap - -Cyrus-imapd uses the LOG_LOCAL6 syslog facility for logging. This port -of cyrus-imapd uses idled for IMAP IDLE. - Available flavor: - drac - Build drac support (for roaming users relay) + drac - Build drac support (i.e. pop before smtp) diff --git a/mail/cyrus-imapd/pkg/DESCR-perl b/mail/cyrus-imapd/pkg/DESCR-perl index 12e8e763b6c..ae6dad88f21 100644 --- a/mail/cyrus-imapd/pkg/DESCR-perl +++ b/mail/cyrus-imapd/pkg/DESCR-perl @@ -1,2 +1,2 @@ -This package contains the perl utilities for managing the Cyrus Imap +This package contains the perl utilities for managing the Cyrus IMAP server. diff --git a/mail/cyrus-imapd/pkg/MESSAGE-main b/mail/cyrus-imapd/pkg/MESSAGE-main deleted file mode 100644 index 71a9f0a230e..00000000000 --- a/mail/cyrus-imapd/pkg/MESSAGE-main +++ /dev/null @@ -1,3 +0,0 @@ -Don't forget to edit /etc/services to include missing network services -if needed. - e.g. sieve 2000/tcp diff --git a/mail/cyrus-imapd/pkg/PLIST-main b/mail/cyrus-imapd/pkg/PLIST-main index 7e96860b947..076a0c49a16 100644 --- a/mail/cyrus-imapd/pkg/PLIST-main +++ b/mail/cyrus-imapd/pkg/PLIST-main @@ -1,4 +1,4 @@ -@comment $OpenBSD: PLIST-main,v 1.11 2010/12/03 15:37:31 ajacoutot Exp $ +@comment $OpenBSD: PLIST-main,v 1.12 2010/12/12 11:52:30 ajacoutot Exp $ @pkgpath ${BASE_PKGPATH} @pkgpath ${BASE_PKGPATH},-main,kerberos @newgroup _cyrus:543 @@ -180,6 +180,7 @@ share/doc/cyrus-imapd/text/readme share/doc/cyrus-imapd/text/sieve share/doc/cyrus-imapd/text/sieve-protocol share/doc/cyrus-imapd/text/specs +share/doc/pkg-readmes/${FULLPKGNAME} share/examples/cyrus-imapd/ share/examples/cyrus-imapd/cmu-backend.conf share/examples/cyrus-imapd/cmu-frontend.conf diff --git a/mail/cyrus-imapd/pkg/README-main b/mail/cyrus-imapd/pkg/README-main new file mode 100644 index 00000000000..4e8214ce882 --- /dev/null +++ b/mail/cyrus-imapd/pkg/README-main @@ -0,0 +1,23 @@ +$OpenBSD: README-main,v 1.1 2010/12/12 11:52:30 ajacoutot Exp $ + +Running cyrus-imapd under OpenBSD +================================= + +WARNING: mmap(2) is not fully POSIX on OpenBSD so cyrus needs to +map_refresh on every lock which will incure a performance penalty under +high load. See this bugreport for details: + http://bugzilla.cyrusimap.org/show_bug.cgi?id=3370 + +The following man pages have been renamed to avoid conflicts with other +packages: + fetchnews(8) -> cyrus-fetchnews(8) # conflict with news/leafnode + idled(8) -> cyrus-idled(8) # conflict with sysutils/idled + master(8) -> cyrus-master(8) # conflict with mail/postfix + imapd(8) -> cyrus-imapd(8) # conflict with mail/courier-imap + +cyrus-imapd uses the LOG_LOCAL6 syslog facility for logging. This +package of cyrus-imapd uses idled for IMAP IDLE. + +Don't forget to edit /etc/services to include missing network services +if needed. + e.g. sieve 2000/tcp