# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= cyrus-imapd VERSION= 3.8.2 KEYWORDS= mail VARIANTS= standard SDESC[standard]= High-performance mail store with IMAP support HOMEPAGE= https://www.cyrusimap.org/ CONTACT= nobody DOWNLOAD_GROUPS= main SITES[main]= https://github.com/cyrusimap/cyrus-imapd/releases/download/cyrus-imapd-3.8.2/ DISTFILE[1]= cyrus-imapd-3.8.2.tar.gz:main DF_INDEX= 1 SPKGS[standard]= complete primary tools dev man docs examples OPTIONS_AVAILABLE= none OPTIONS_STANDARD= none BUILD_DEPENDS= xapian-core:dev:standard libnghttp2:dev:standard icu:dev:standard brotli:dev:standard krb5:dev:standard BUILDRUN_DEPENDS= cyrus-sasl:primary:standard icu:primary:standard jansson:single:standard xapian-core:primary:standard rsync:single:standard krb5:primary:standard libnghttp2:primary:standard libical:single:standard brotli:primary:standard EXRUN[tools]= cyrus-imapd:primary:standard USERS= cyrus GROUPS= cyrus USERGROUP_SPKG= primary USES= cpe gmake libtool perl pkgconfig ssl:openssl11 shebangfix bison sqlite zlib zstd pcre mbsdfix GNOME_COMPONENTS= libxml2 LICENSE= BSD4CLAUSE:primary LICENSE_FILE= BSD4CLAUSE:{{WRKSRC}}/COPYING LICENSE_SCHEME= solo CPE_PRODUCT= imapd CPE_VENDOR= cyrus FPC_EQUIVALENT= mail/cyrus-imapd32 SHEBANG_FILES= imap/promdatagen tools/config2header tools/masssievec tools/mkimap perl/sieve/scripts/*.pl imap/cyr_cd.sh MUST_CONFIGURE= gnu CONFIGURE_ARGS= --libexecdir={{PREFIX}}/cyrus/libexec --sbindir={{PREFIX}}/cyrus/sbin --sysconfdir={{PREFIX}}/etc --with-cyrus-user=cyrus --with-sasl={{LOCALBASE}} --with-sqlite={{LOCALBASE}} --with-com_err --with-openssl={{OPENSSLBASE}} --with-perl={{PERL}} --with-gss_impl=mit --enable-autocreate --enable-idled --enable-murder --enable-squat --enable-xapian --enable-gssapi={{LOCALBASE}} --enable-http --disable-backup --disable-replication --with-mysql=no --with-pgsql=no --with-snmp=no --with-clamav=no --with-jmap=no SINGLE_JOB= yes INSTALL_TARGET= install-strip INSTALL_REQ_TOOLCHAIN= yes MANDIRS= {{PREFIX}}/cyrus/man SOVERSION= 0.0.0 RC_SUBR= imapd:primary SUB_FILES= pkg-message-primary pkg-install-primary pkg-deinstall-primary cyrus-imapd-man.conf SUB_LIST= CYRUS_USER=cyrus CYRUS_GROUP=cyrus post-patch: ${REINPLACE_CMD} -e "s|/etc/|${PREFIX}/etc/|" \ -e "s|%%CYRUS_USER%%|cyrus|g" \ -e "s|%%CYRUS_GROUP%%|cyrus|g" \ ${WRKSRC}/tools/mkimap ${REINPLACE_CMD} -e "s|/etc/|${PREFIX}/etc/|g" \ -e "s|/usr/sieve|/var/imap/sieve|g" \ ${WRKSRC}/tools/masssievec ${REINPLACE_CMD} \ -e 's|$$(mandir)/\(man[1358]\)|${PREFIX}/cyrus/man/\1|g' \ ${WRKSRC}/Makefile.in post-install: ${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/Cyrus/IMAP/IMAP.so ${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/Cyrus/SIEVE/managesieve/managesieve.so ${MKDIR} ${STAGEDIR}${STD_EXAMPLESDIR} ${MKDIR} ${STAGEDIR}${PREFIX}/etc/man.d ${INSTALL_DATA} ${FILESDIR}/imapd.conf \ ${STAGEDIR}${STD_EXAMPLESDIR} ${SED} -e 's,/run/cyrus/socket,/var/imap/socket,' \ ${WRKSRC}/doc/examples/cyrus_conf/normal.conf \ > ${STAGEDIR}${STD_EXAMPLESDIR}/cyrus.conf ${INSTALL_SCRIPT} ${WRKSRC}/tools/mkimap \ ${STAGEDIR}${PREFIX}/cyrus/sbin/mkimap ${INSTALL_SCRIPT} ${WRKSRC}/tools/masssievec \ ${STAGEDIR}${PREFIX}/cyrus/sbin/masssievec ${INSTALL_DATA} ${WRKDIR}/cyrus-imapd-man.conf \ ${STAGEDIR}${PREFIX}/etc/man.d/cyrus-imapd.conf # documentation ${MKDIR} ${STAGEDIR}${STD_DOCDIR} cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${STAGEDIR}${STD_DOCDIR} \ "! \( -path */html/_sources* -o -name .buildinfo \)" ${RM} -r ${STAGEDIR}${DOCSDIR}/rst ${STAGEDIR}${STD_DOCDIR}/source [FILE:1060:descriptions/desc.primary] The Cyrus IMAP (Internet Message Access Protocol) server provides access to personal mail and system-wide bulletin boards through the IMAP protocol. The Cyrus IMAP server is a scaleable enterprise mail system designed for use from small to large enterprise environments using standards-based technologies. A full Cyrus IMAP implementation allows a seamless mail and bulletin board environment to be set up across multiple servers. It differs from other IMAP server implementations in that it is run on "sealed" servers, where users are not normally permitted to log in. The mailbox database is stored in parts of the filesystem that are private to the Cyrus IMAP system. All user access to mail is through software using the IMAP, POP3, or KPOP protocols. The private mailbox database design gives the server large advantages in efficiency, scalability, and administratability. Multiple concurrent read/write connections to the same mailbox are permitted. The server supports access control lists on mailboxes and storage quotas on mailbox hierarchies. [FILE:57:descriptions/desc.tools] This package contains the cyrus IMAP binaries and tools. [FILE:103:distinfo] 67b17217e061096ed53dbb9005c33182d03deaf4e15025aea029fe6a62a81ff6 14394338 cyrus-imapd-3.8.2.tar.gz [FILE:311:manifests/plist.primary] lib/ libcyrus.so.%%SOMAJOR%% libcyrus.so.%%SOVERSION%% libcyrus_com_err.so.%%SOMAJOR%% libcyrus_com_err.so.%%SOVERSION%% libcyrus_imap.so.%%SOMAJOR%% libcyrus_imap.so.%%SOVERSION%% libcyrus_min.so.%%SOMAJOR%% libcyrus_min.so.%%SOVERSION%% libcyrus_sieve.so.%%SOMAJOR%% libcyrus_sieve.so.%%SOVERSION%% [FILE:1149:manifests/plist.tools] %%SITE_ARCH%%/Cyrus/IMAP.pm %%SITE_ARCH%%/Cyrus/IMAP/ Admin.pm Shell.pm %%SITE_ARCH%%/Cyrus/SIEVE/managesieve.pm %%SITE_ARCH%%/auto/Cyrus/Annotator/Daemon/.packlist %%SITE_ARCH%%/auto/Cyrus/IMAP/ .packlist IMAP.so %%SITE_ARCH%%/auto/Cyrus/SIEVE/managesieve/ .packlist managesieve.so %%SITE_PERL%%/Cyrus/Annotator/ AnnotateInlinedCIDs.pm Daemon.pm Message.pm bin/ cyradm httptest imtest installsieve lmtptest mupdatetest nntptest pop3test sieveshell sivtest smtptest synctest cyrus/libexec/ fud httpd idled imapd lmtpd lmtpproxyd master mupdate notifyd pop3d pop3proxyd promstatsd proxyd ptloader smmapd timsieved cyrus/sbin/ arbitron chk_cyrus ctl_conversationsdb ctl_cyrusdb ctl_deliver ctl_mboxlist ctl_zoneinfo cvt_cyrusdb cvt_xlist_specialuse cyr_buildinfo cyr_cd.sh cyr_dbtool cyr_deny cyr_df cyr_expire cyr_info cyr_ls cyr_pwd cyr_synclog cyr_userseen cyr_virusscan cyrdump dav_reconstruct deliver ipurge masssievec mbexamine mbpath mbtool mkimap ptdump ptexpire quota reconstruct relocate_by_id sievec sieved squatter tls_prune unexpunge etc/man.d/cyrus-imapd.conf [FILE:817:manifests/plist.dev] include/cyrus/ acl.h arrayu64.h assert.h auth.h auth_pts.h bitvector.h bloom.h bsearch.h bufarray.h charset.h chartable.h command.h crc32.h cyr_lock.h cyr_qsort_r.h cyrusdb.h dynarray.h glob.h gmtoff.h hash.h hashset.h hashu64.h imapopts.h imapurl.h imclient.h imparse.h iostat.h iptostring.h libcyr_cfg.h lsort.h map.h mappedfile.h mkgmtime.h mpool.h murmurhash2.h nonblock.h parseaddr.h procinfo.h retry.h rfc822tok.h seqset.h signals.h smallarrayu64.h sqldb.h strarray.h strhash.h stristr.h times.h tok.h vparse.h wildmat.h xmalloc.h include/cyrus/sieve/ sieve_err.h sieve_interface.h lib/ libcyrus.so libcyrus_com_err.so libcyrus_imap.so libcyrus_min.so libcyrus_sieve.so lib/pkgconfig/ libcyrus.pc libcyrus_imap.pc libcyrus_min.pc libcyrus_sieve.pc [FILE:1399:manifests/plist.man] %%PERL5_MAN1%%/cyradm.1.gz %%PERL5_MAN3%%/ Cyrus::Annotator::Daemon.3.gz Cyrus::Annotator::Message.3.gz Cyrus::IMAP.3.gz Cyrus::IMAP::Admin.3.gz Cyrus::IMAP::Shell.3.gz Cyrus::SIEVE::managesieve.3.gz cyrus/man/man1/ dav_reconstruct.1.gz httptest.1.gz imtest.1.gz installsieve.1.gz lmtptest.1.gz mupdatetest.1.gz nntptest.1.gz pop3test.1.gz sieveshell.1.gz sivtest.1.gz smtptest.1.gz synctest.1.gz cyrus/man/man3/imclient.3.gz cyrus/man/man5/ cyrus.conf.5.gz imapd.conf.5.gz krb.equiv.5.gz cyrus/man/man8/ arbitron.8.gz backupd.8.gz chk_cyrus.8.gz ctl_backups.8.gz ctl_conversationsdb.8.gz ctl_cyrusdb.8.gz ctl_deliver.8.gz ctl_mboxlist.8.gz ctl_zoneinfo.8.gz cvt_cyrusdb.8.gz cvt_xlist_specialuse.8.gz cyr_backup.8.gz cyr_buildinfo.8.gz cyr_dbtool.8.gz cyr_deny.8.gz cyr_df.8.gz cyr_expire.8.gz cyr_info.8.gz cyr_ls.8.gz cyr_synclog.8.gz cyr_userseen.8.gz cyr_virusscan.8.gz cyradm.8.gz cyrdump.8.gz deliver.8.gz fud.8.gz httpd.8.gz idled.8.gz imapd.8.gz ipurge.8.gz lmtpd.8.gz lmtpproxyd.8.gz master.8.gz mbexamine.8.gz mbpath.8.gz mbtool.8.gz mupdate.8.gz notifyd.8.gz pop3d.8.gz pop3proxyd.8.gz promstatsd.8.gz proxyd.8.gz ptdump.8.gz ptexpire.8.gz ptloader.8.gz quota.8.gz reconstruct.8.gz relocate_by_id.8.gz restore.8.gz sievec.8.gz sieved.8.gz smmapd.8.gz squatter.8.gz timsieved.8.gz tls_prune.8.gz unexpunge.8.gz [FILE:122:manifests/plist.examples] @sample share/examples/cyrus-imapd/cyrus.conf etc/cyrus.conf @sample share/examples/cyrus-imapd/imapd.conf etc/imapd.conf [FILE:1327:patches/patch-configure] Index: configure diff -u configure.orig configure --- configure.orig 2023-09-11 02:33:23 UTC +++ configure @@ -26032,7 +26032,7 @@ if ${ac_cv_lib_gssapi_gss_unwrap+:} fals $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lgssapi ${GSSAPIBASE_LIBS} -lgssapi -lkrb5 -lasn1 -lroken ${LIB_CRYPT} ${LIB_DES} -lcom_err ${LIB_SOCKET} $LIBS" +LIBS="-lgssapi ${GSSAPIBASE_LIBS} -lgssapi -lkrb5 -lasn1 -lroken ${LIB_CRYPT} ${LIB_DES} -lcom_err ${LIB_SOCKET} -lhx509 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -26334,7 +26334,7 @@ fi GSSAPIBASE_STATIC_LIBS="$GSSAPIBASE_LIBS $gssapi_dir/libgssapi_krb5.a $gssapi_dir/libkrb5.a $gssapi_dir/libk5crypto.a $gssapi_dir/libcom_err.a ${K5SUPSTATIC}" elif test "$gss_impl" = "heimdal"; then CPPFLAGS="$CPPFLAGS -DKRB5_HEIMDAL" - GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgssapi -lkrb5 -lasn1 -lroken ${LIB_CRYPT} ${LIB_DES} -lcom_err" + GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgssapi -lkrb5 -lasn1 -lroken ${LIB_CRYPT} ${LIB_DES} -lcom_err -lhx509" GSSAPIBASE_STATIC_LIBS="$GSSAPIBASE_STATIC_LIBS $gssapi_dir/libgssapi.a $gssapi_dir/libkrb5.a $gssapi_dir/libasn1.a $gssapi_dir/libroken.a $gssapi_dir/libcom_err.a ${LIB_CRYPT}" elif test "$gss_impl" = "cybersafe03"; then # Version of CyberSafe with two libraries [FILE:1917:patches/patch-fix-libxml2-2.12] From 37ceb82f0641b03d25d9a158423abbb270fe3867 Mon Sep 17 00:00:00 2001 From: David King Date: Mon, 27 Nov 2023 10:34:40 +0000 Subject: [PATCH] Add libxml/parser.h include This is required for libxml2 2.12.0 and above. --- imap/ctl_zoneinfo.c | 1 + imap/http_dav.c | 1 + imap/http_dav_sharing.c | 2 ++ imap/http_ischedule.c | 2 ++ imap/vcard_support.c | 1 + imap/xcal.c | 1 + 6 files changed, 8 insertions(+) --- imap/ctl_zoneinfo.c.orig 2023-09-11 01:23:52 UTC +++ imap/ctl_zoneinfo.c @@ -57,6 +57,7 @@ #include #include +#include #include #include "annotate.h" /* for strlist functionality */ --- imap/http_dav.c.orig 2023-09-11 01:23:52 UTC +++ imap/http_dav.c @@ -93,6 +93,7 @@ #include "imap/imap_err.h" #include +#include #include static const struct dav_namespace_t { --- imap/http_dav_sharing.c.orig 2023-09-11 01:23:52 UTC +++ imap/http_dav_sharing.c @@ -59,6 +59,8 @@ #include "imap/http_err.h" #include "imap/imap_err.h" +#include + #define DAVNOTIFICATION_CONTENT_TYPE \ "application/davnotification+xml; charset=utf-8" --- imap/http_ischedule.c.orig 2023-09-11 01:23:52 UTC +++ imap/http_ischedule.c @@ -52,6 +52,8 @@ #include +#include + #include "global.h" #include "httpd.h" #include "http_caldav_sched.h" --- imap/vcard_support.c.orig 2023-09-11 01:23:52 UTC +++ imap/vcard_support.c @@ -42,6 +42,7 @@ */ #include +#include #include #include "vcard_support.h" --- imap/xcal.c.orig 2023-09-11 00:04:18 UTC +++ imap/xcal.c @@ -47,6 +47,7 @@ #include /* for offsetof() macro */ #include +#include #include #include "httpd.h" [FILE:505:patches/patch-imap__http_client.h] --- imap/http_client.h.orig 2023-08-30 01:28:01 UTC +++ imap/http_client.h @@ -58,7 +58,7 @@ struct body_t { unsigned char framing; /* Message framing */ unsigned char te; /* Transfer-Encoding */ unsigned max; /* Max allowed len */ - ulong len; /* Content-Length */ + unsigned long len; /* Content-Length */ struct buf payload; /* Payload */ }; [FILE:452:patches/patch-imap__httpd.h] --- imap/httpd.h.orig 2023-09-11 01:23:52 UTC +++ imap/httpd.h @@ -289,7 +289,7 @@ typedef int (*encode_proc_t)(struct tran /* Meta-data for response body (payload & representation headers) */ struct resp_body_t { - ulong len; /* Content-Length */ + unsigned long len; /* Content-Length */ struct range *range; /* Content-Range */ struct { const char *fname; [FILE:1367:patches/patch-imap_tls.c] --- imap/tls.c.orig 2023-09-11 01:23:52 UTC +++ imap/tls.c @@ -782,12 +782,14 @@ EXPORTED int tls_init_serverengine(c off |= SSL_OP_ALL; /* Work around all known bugs */ off |= SSL_OP_NO_SSLv2; /* Disable insecure SSLv2 */ off |= SSL_OP_NO_SSLv3; /* Disable insecure SSLv3 */ +#if (OPENSSL_VERSION_NUMBER >= 0x1000000fL) off |= SSL_OP_NO_COMPRESSION; /* Disable TLS compression */ +#endif // (OPENSSL_VERSION_NUMBER >= 0x1000000fL) const char *tls_versions = config_getstring(IMAPOPT_TLS_VERSIONS); if (strstr(tls_versions, "tls1_3") == NULL) { -#if (OPENSSL_VERSION_NUMBER >= 0x1010100fL) +#if (OPENSSL_VERSION_NUMBER >= 0x1010100fL) && !defined(LIBRESSL_VERSION_NUMBER) //syslog(LOG_DEBUG, "TLS server engine: Disabled TLSv1.3"); off |= SSL_OP_NO_TLSv1_3; #else @@ -1568,7 +1570,9 @@ HIDDEN int tls_init_clientengine(int ver off |= SSL_OP_ALL; /* Work around all known bugs */ off |= SSL_OP_NO_SSLv2; /* Disable insecure SSLv2 */ off |= SSL_OP_NO_SSLv3; /* Disable insecure SSLv3 */ +#if (OPENSSL_VERSION_NUMBER >= 0x1000000fL) off |= SSL_OP_NO_COMPRESSION; /* Disable TLS compression */ +#endif // (OPENSSL_VERSION_NUMBER >= 0x1000000fL) SSL_CTX_set_options(c_ctx, off); SSL_CTX_set_info_callback(c_ctx, apps_ssl_info_callback); [FILE:594:patches/patch-imtest__imtest.c] --- imtest/imtest.c.orig 2023-09-11 01:23:52 UTC +++ imtest/imtest.c @@ -511,7 +511,9 @@ static int tls_init_clientengine(int ver off |= SSL_OP_ALL; /* Work around all known bugs */ off |= SSL_OP_NO_SSLv2; /* Disable insecure SSLv2 */ off |= SSL_OP_NO_SSLv3; /* Disable insecure SSLv3 */ +#if (OPENSSL_VERSION_NUMBER >= 0x1000000fL) off |= SSL_OP_NO_COMPRESSION; /* Disable TLS compression */ +#endif // (OPENSSL_VERSION_NUMBER >= 0x1000000fL) SSL_CTX_set_options(tls_ctx, off); SSL_CTX_set_info_callback(tls_ctx, apps_ssl_info_callback); [FILE:819:patches/patch-lib__cyr_qsort_r.c] --- lib/cyr_qsort_r.c.orig 2023-08-30 01:28:01 UTC +++ lib/cyr_qsort_r.c @@ -20,14 +20,14 @@ EXPORTED void cyr_qsort_r(void *base, si // NOTE: this is kinda ugly, but it's OK if you're not multithreaded static void *qsort_r_thunk; -static int (*qsort_r_compar)(const void *, const void *, void *); +static int (*qsort_r_compar)QSORT_R_COMPAR_ARGS(const void *, const void *, void *); static int qsort_r_compar_func(const void *a, const void *b) { return qsort_r_compar(a, b, qsort_r_thunk); } EXPORTED void cyr_qsort_r(void *base, size_t nmemb, size_t size, - int (*compar)(const void *, const void *, void *), + int (*compar)QSORT_R_COMPAR_ARGS(const void *, const void *, void *), void *thunk) { qsort_r_thunk = thunk; [FILE:863:patches/patch-lib__imapoptions] --- lib/imapoptions.orig 2023-09-11 01:23:52 UTC +++ lib/imapoptions @@ -2477,7 +2477,7 @@ If all partitions are over that limit, t { "seenstate_db", "twoskip", STRINGLIST("flat", "skiplist", "twoskip", "zeroskip"), "3.1.6" } /* The cyrusdb backend to use for the seen state. */ -{ "sendmail", "/usr/lib/sendmail", STRING, "2.3.17" } +{ "sendmail", "/usr/sbin/sendmail", STRING, "2.3.17" } /* The pathname of the sendmail executable. Sieve invokes sendmail for sending rejections, redirects and vacation responses. */ @@ -2616,7 +2616,7 @@ product version in the capabilities For backward compatibility, if no unit is specified, seconds is assumed. */ -{ "sievedir", "/usr/sieve", STRING, "2.3.17" } +{ "sievedir", "/var/imap/sieve", STRING, "2.3.17" } /* If sieveusehomedir is false, this directory is searched for Sieve scripts. */ [FILE:435:patches/patch-lib__libcyr_cfg.c] Index: lib/libcyr_cfg.c diff -u -p lib/libcyr_cfg.c.orig lib/libcyr_cfg.c --- lib/libcyr_cfg.c.orig 2023-08-30 01:28:01 UTC +++ lib/libcyr_cfg.c @@ -52,7 +52,7 @@ #include "xmalloc.h" #include "util.h" -#if defined(__GNUC__) && __GNUC__ > 1 +#if defined(__GNUC__) && __GNUC__ > 1 && !defined(__INTEL_COMPILER) /* We can use the GCC union constructor extension */ #define CFGVAL(t,v) (union cyrus_config_value)((t)(v)) #else [FILE:325:patches/patch-lib_byteorder.h] --- lib/byteorder.h.orig 2023-08-30 01:28:01 UTC +++ lib/byteorder.h @@ -49,7 +49,7 @@ #if defined(__linux__) || defined(__OpenBSD__) # include -#elif defined(__FreeBSD__) || defined(__NetBSD__) +#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) # include #endif [FILE:272:patches/patch-lib_cyr__qsort__r.h] --- lib/cyr_qsort_r.h.orig 2023-08-30 01:28:01 UTC +++ lib/cyr_qsort_r.h @@ -33,7 +33,7 @@ #endif #if !defined(HAVE_GLIBC_QSORT_R) && \ - (defined(__FreeBSD__) || defined(__DragonFly__) || defined(__APPLE__)) + (defined(__APPLE__)) #define HAVE_BSD_QSORT_R #endif [FILE:338:patches/patch-lib_cyrusdb__twoskip.c] --- lib/cyrusdb_twoskip.c.orig 2023-09-11 00:04:18 UTC +++ lib/cyrusdb_twoskip.c @@ -449,6 +449,7 @@ static int recovery2(struct dbengine *db #define SIZE(db) mappedfile_size((db)->mf) #define FNAME(db) mappedfile_fname((db)->mf) +#undef roundup /* calculate padding size */ static size_t roundup(size_t record_size, int howfar) { [FILE:308:patches/patch-lib_util.c] --- lib/util.c.orig 2023-09-11 01:23:52 UTC +++ lib/util.c @@ -1055,6 +1055,7 @@ EXPORTED int parsehex(const char *p, con /* buffer handling functions */ +#undef roundup #ifdef HAVE_DECLARE_OPTIMIZE static inline size_t roundup(size_t size) __attribute__((pure, always_inline, optimize("-O3"))); [FILE:1207:patches/patch-tools__mkimap] Index: tools/mkimap diff -u tools/mkimap.orig tools/mkimap --- tools/mkimap.orig 2023-08-30 01:28:01 UTC +++ tools/mkimap @@ -75,6 +75,9 @@ sub read_conf { $imapdconf = shift || "/etc/imapd.conf"; +$cyrus_user = $ENV{CYRUS_USER} || "%%CYRUS_USER%%"; +$cyrus_group = $ENV{CYRUS_GROUP} || "%%CYRUS_GROUP%%"; + push @configs, $imapdconf; while ($conf = shift @configs) { @@ -87,6 +90,7 @@ $d = $confdir; print "configuring $d...\n"; +mkdir $d, 0755; chdir $d or die "couldn't change to $d"; mkdir "proc", 0755 || warn "can't create $d/proc: $!"; @@ -97,12 +101,15 @@ mkdir "msg", 0755 || warn "can't create mkdir "ptclient", 0755 || warn "can't create $d/ptclient: $!"; mkdir "sync", 0755 || warn "can't create $d/sync: $!"; +system "/usr/sbin/chown -R $cyrus_user:$cyrus_group ."; + while ($part = shift @parts) { print "creating $part...\n"; mkdir $part, 0755 || warn "can't create $part: $!"; chdir $part or die "couldn't change to partition $part"; mkdir "stage.", 0755 || warn "can't create $part/stage.: $!"; mkdir "sync.", 0755 || warn "can't create $part/sync.: $!"; + system "/usr/sbin/chown -R $cyrus_user:$cyrus_group $part"; } print "done\n"; [FILE:29:files/cyrus-imapd-man.conf.in] MANPATH %%PREFIX%%/cyrus/man [FILE:11294:files/imapd.conf] # # $FreeBSD: head/mail/cyrus-imapd32/files/imapd.conf 435817 2017-03-10 02:05:01Z ume $ # # Sample configurations file for Cyrus IMAPd # Most lines in this file are commented; in this case the default is used. # The commented lines (usually) contain the default value # The pathname of the IMAP configuration directory # configdirectory: /var/imap # The partition name used by default for new mailboxes # #defaultpartition: default # The directory for the different partitions # partition-default: /var/spool/imap # Use the UNIX separator character '/' for delimiting levels of # mailbox hierarchy. The default is to use the netnews separator # character '.'. #unixhierarchysep: yes # Use the alternate IMAP namespace, where personal folders reside at # the same level in the hierarchy as INBOX. # #altnamespace: yes # If using the alternate IMAP namespace, the prefix for the other # users namespace. The hierarchy delimiter will be automatically # appended. # #userprefix: Other Users # If using the alternate IMAP namespace, the prefix for the shared # namespace. The hierarchy delimiter will be automatically appended. # #sharedprefix: Shared Folders # The umask value used by various Cyrus IMAP programs # #umask: 077 # This is the hostname visible in the greeting messages of the POP, # IMAP and LMTP daemons. If it is unset, then the result returned from # gethostname(2) is used. # #servername: # Whether to allow anonymous logins # #allowanonymouslogin: no # Allow the use of cleartext passwords on the wire. # #allowplaintext: yes # The percent of quota utilization over which the server generates # warnings. # #quotawarn: 90 # The length of the IMAP server's inactivity autologout timer, in minutes. # The minimum value is 30, the default. # #timeout: 30 # The interval (in seconds) for polling the mailbox for changes while # running the IDLE command. This option is used when idled can not be # contacted or when polling is used exclusively. The minimum value is # 1. A value of 0 will disable polling (and disable IDLE if polling # is the only method available). # #imapidlepoll: 60 # If enabled, the server responds to an ID command with a parameter # list containing: version, vendor, support-url, os, os-version, # command, arguments, environment. Otherwise the server returns NIL. # #imapidresponse: yes # Set the length of the POP server's inactivity autologout timer, in # minutes. The minimum value is 10, the default. # #poptimeout: 10 # Set the minimum amount of time the server forces users to wait between # successive POP logins, in minutes. The default is 0. # #popminpoll: 0 # The number of days advertised as being the minimum a message may be # left on the POP server before it is deleted (via the CAPA command, # defined in the POP3 Extension Mechanism, which some clients may # support). "NEVER", the default, may be specified with a negative # number. The Cyrus POP3 server never deletes mail, no matter what # the value of this parameter is. However, if a site implements a # less liberal policy, it needs to change this parameter accordingly. # #popexpiretime: 0 # The list of userids with administrative rights. Separate each userid # with a space. We recommend that administrator userids be separate from # standard userids. Sites using Kerberos authentication may use separate # "admin" instances. # #admins: # A list of users and groups that are allowed to proxy for other # users, seperated by spaces. Any user listed in this will be allowed # to login for any other user: use with caution. # #proxyservers: # The Access Control List (ACL) placed on a newly-created (non-user) # mailbox that does not have a parent mailbox. # #defaultacl: anyone lrs # The pathname of the news spool directory. Only used if the partition-news # configuration option is set. # #newsspool: # Prefix to be prepended to newsgroup names to make the corresponding IMAP # mailbox names. # #newsprefix: # If set to a value of zero or higher, users have their INBOX folders # created upon a successful login event or upon lmtpd(8) message # delivery if autocreate_post is enabled, provided their INBOX did # not yet already exist. # # The user's quota is set to the value if it is greater than zero, # otherwise the user has unlimited quota. # # Note that quota is specified in kilobytes. # #autocreate_quota: -1 # Include notations in the protocol telemetry logs indicating the number # of seconds since the last command or response. # #logtimestamps: no # Number of seconds to pause after a successful plaintext login. For systems # that support strong authentication, this permits users to perceive a cost # of using plaintext passwords. # #plaintextloginpause: 0 # The pathname of srvtab file containing the server's private key. # This option is passed to the SASL library and overrides its default # setting. # #srvtab: /etc/srvtab # The list of remote realms whose users may log in using cross-realm # authentications. Seperate each realm name by a space. This option is # only used when the server is compiled with Kerberos authentication. # #loginrealms: # If enabled, any authentication identity which has a rights on a user's # INBOX may log in as that user. This option is only used when the server # is compiled with Kerberos authentication. # #loginuseacl: no # If enabled, lmtpd attempts to only write one copy of a message per # partition and create hard links, resulting in a potentially large # disk savings. # #singleinstancestore: yes # If enabled, lmtpd will suppress delivery of a message to a mailbox # if a message with the same message-id (or resent-message-id) is # recorded as having already been delivered to the mailbox. Records # the mailbox and message-id/resent-message-id of all successful # deliveries. # #duplicatesuppression: yes # If enabled, lmtpd rejects messages with 8-bit characters in the # headers. Otherwise, 8-bit characters are changed to `X'. (A proper # soultion to non-ASCII characters in headers is offered by RFC 2047 # and its predecessors.) # #reject8bit: no # Maximum incoming LMTP message size. If set, lmtpd will reject # messages larger than maxmessagesize bytes. The default is to allow # messages of any size. # #maxmessagesize: # Userid used to deliver messages to shared folders. For example, if # set to "bb", email sent to "bb+shared.blah" would be delivered to # the "shared.blah" folder. By default, an email address of # "+shared.blah" would be used. #postuser: # If enabled at compile time, this specifies a URL to reply when # Netscape asks the server where the mail administration HTTP server # is. The default is a site at CMU with a hopefully informative # message; administrators should set this to a local resource with # some information of greater use. # #netscapeurl: http://andrew2.andrew.cmu.edu/cyrus/imapd/netscapeadmin.html # Notifyd(8) method to use for "MAIL" notifications. If not set, # "MAIL" notifications are disabled. # #mailnotifier: # Notifyd(8) method to use for "SIEVE" notifications. If not set, # "SIEVE" notifications are disabled. # # This method is only used when no method is specified in the script. # #sievenotifier: # If enabled, lmtpd will look for Sieve scripts in user's home # directories: ~user/.sieve. # sieveusehomedir: false # If sieveusehomedir is false, this directory is searched for Sieve scripts. # The active Sieve script is s called "default", placed in the users sieve # sieve directory (ie. /var/imap/sieve/u/user). # sievedir: /var/imap/sieve # The pathname of the sendmail executable. Sieve uses sendmail for # sending rejections, redirects and vaca- tion responses. # #sendmail: /usr/sbin/sendmail # Username that is used as the 'From' address in rejection MDNs # produced by sieve. # #postmaster: postmaster # If enabled, the partitions will also be hashed, in addition to the hashing # done on configuration directories. This is recommended if one partition has # a very bushy mailbox tree. # #hashimapspool: false # Maximum size (in kilobytes) any sieve script can be, enforced at # submission by timsieved(8). # #sieve_maxscriptsize: 32 # Maximum number of sieve scripts any user may have, enforced at # submission by timsieved(8). # #sieve_maxscripts: 5 # The cyrusdb backend to use for mailbox annotations. # Allowed values: skiplist, twoskip # #annotation_db: twoskip # The cyrusdb backend to use for the duplicate delivery suppression # and sieve. # Allowed values: skiplist, sql, twoskip # #duplicate_db: twoskip # The cyrusdb backend to use for the mailbox list. # Allowed values: skiplist, twoskip # #mboxlist_db: twoskip # The cyrusdb backend to use for the pts cache. # Allowed values: skiplist, twoskip # #ptscache_db: twoskip # The cyrusdb backend to use for the seen state. # Allowed values: flat, skiplist, twoskip # #seenstate_db: twoskip # The cyrusdb backend to use for the imap status cache. # Allowed values: skiplist, sql, twoskip # #statuscache_db: twoskip # The cyrusdb backend to use for the subscriptions list. # Allowed values: flat, skiplist, twoskip # #subscription_db: flat # Maximum SSF (security strength factor) that the server will allow a # client to negotiate. # #sasl_maximum_layer: 256 # The minimum SSF that the server will allow a client to negotiate. A # value of 1 requires integrity protection; any higher value requires # some amount of encryption. # #sasl_minimum_layer: 0 # The mechanism used by the server to verify plaintext passwords. Possible # values include "auxprop" or "saslauthd" # sasl_pwcheck_method: auxprop # If enabled, the SASL library will automatically create authentication # secrets when given a plaintext password. See the SASL documentation. # #sasl_auto_transition: no # Whitespace separated list of mechanisms to allow (e.g. 'plain otp'). # Used to restrict the mechanisms to a subset of the installed # plugins. The default is all available. # #sasl_mech_list: cram-md5 digest-md5 # Location of the opiekeys file # #sasl_opiekeys: /etc/opiekeys # File containing the global certificate used for ALL services (imap, # pop3, lmtp). # #tls_server_cert: # File containing the private key belonging to the global server # certificate. # #tls_server_key: # File containing one or more Certificate Authority (CA) certificates. # #tls_client_ca_file: # Path to directory with certificates of CAs. # #tls_client_ca_dir: # The cyrusdb backend to use for the TLS cache. # Allowed values: skiplist, sql, twoskip # #tls_sessions_db: twoskip # The length of time (in minutes) that a TLS session will be cached # for later reuse. The maximum value is 1440 (24 hours), the default. # A value of 0 will disable session caching. # #tls_session_timeout: 1440 # The right that a user needs to delete a mailbox. # #deleteright: c # Unix domain socket that lmtpd listens on, used by deliver(8). # #lmtpsocket: /var/imap/socket/lmtp # Unix domain socket that idled listens on. # #idlesocket: /var/imap/socket/idle # Unix domain socket that the new mail notification daemon listens on. # #notifysocket: /var/imap/socket/notify # # EOF [FILE:966:files/imapd.in] #!/bin/sh # Start or stop cyrus-imapd # $FreeBSD: head/mail/cyrus-imapd32/files/imapd.in 472520 2018-06-16 06:42:34Z ume $ # PROVIDE: cyrus_imapd imap # REQUIRE: DAEMON # BEFORE: mail # KEYWORD: shutdown # Define these cyrus_imapd_* variables in one of these files: # /etc/rc.conf # /etc/rc.conf.local # /etc/rc.conf.d/cyrus_imapd # # DO NOT CHANGE THESE DEFAULT VALUES HERE # [ -z "$cyrus_imapd_enable" ] && cyrus_imapd_enable="NO" # Enable imapd #cyrus_imapd_program="%%PREFIX%%/cyrus/libexec/master" # Location of imapd [ -z "$cyrus_imapd_flags" ] && cyrus_imapd_flags="-d" # Flags to imapd program . /etc/rc.subr name="cyrus_imapd" rcvar=cyrus_imapd_enable command="%%PREFIX%%/cyrus/libexec/master" pidfile="/var/run/cyrus-master.pid" required_files="%%PREFIX%%/etc/cyrus.conf %%PREFIX%%/etc/imapd.conf" stop_postcmd="cyrus_imapd_poststop" extra_commands="reload" cyrus_imapd_poststop() { /bin/rm -f ${pidfile} } load_rc_config $name run_rc_command "$1" [FILE:744:files/pkg-deinstall-primary.in] #!/bin/sh # # $FreeBSD: head/mail/cyrus-imapd32/files/pkg-deinstall.in 411341 2016-03-18 11:39:18Z ume $ # Created by: hetzels@westbend.net #set -vx PKG_BATCH=${BATCH:=NO} CYRUS_USER=${CYRUS_USER:=%%CYRUS_USER%%} # # Modify the 'cyrus' user created from the cyrus-sasl port # modify_cyrus_user() { USER=${CYRUS_USER} PW=/usr/sbin/pw if [ -x /usr/sbin/nologin ]; then shell=/usr/sbin/nologin elif [ -x /sbin/nologin ]; then shell=/sbin/nologin else shell=/nonexistent fi uhome=/nonexistent if ! ${PW} mod user ${USER} -d "${uhome}" -s "${shell}"; then echo "*** Failed to update user \`${USER}'." else echo "*** Updated user \`${USER}'." fi } case $2 in DEINSTALL) ;; POST-DEINSTALL) modify_cyrus_user ;; esac [FILE:791:files/pkg-install-primary.in] #!/bin/sh # # $FreeBSD: head/mail/cyrus-imapd32/files/pkg-install.in 411341 2016-03-18 11:39:18Z ume $ #set -vx PKG_BATCH=${BATCH:=NO} PKG_PREFIX=${PKG_PREFIX:=%%PREFIX%%} CYRUS_USER=${CYRUS_USER:=%%CYRUS_USER%%} # # Modify the 'cyrus' user created from the cyrus-sasl port # modify_cyrus_user() { USER=${CYRUS_USER} PW=/usr/sbin/pw shell=/bin/csh uhome=${PKG_PREFIX}/cyrus if ! ${PW} mod user ${USER} -d "${uhome}" -s "${shell}"; then echo "*** Failed to update user \`${USER}'." else echo "*** Updated user \`${USER}'." fi } case $2 in PRE-INSTALL) ;; POST-INSTALL) modify_cyrus_user if grep 'sieve' /etc/services; then echo else echo echo "** Please add an entry for the sieve protocol (4190/tcp)" echo " to /etc/services" echo fi ;; esac [FILE:192:files/pkg-message-primary.in] To setup mail spool, modify %%PREFIX%%/etc/imapd.conf appropriately, then run %%PREFIX%%/cyrus/sbin/mkimap. To run Cyrus IMAPd from startup, add cyrus_imapd_enable="YES" in your /etc/rc.conf.