diff --git a/mail/courier/Makefile b/mail/courier/Makefile index 273585a902b0..85742588b14b 100644 --- a/mail/courier/Makefile +++ b/mail/courier/Makefile @@ -1,357 +1,391 @@ PORTNAME= courier -PORTVERSION= 0.65.3 -PORTREVISION= 6 +PORTVERSION= 1.1.11 CATEGORIES= mail MASTER_SITES= SF MAINTAINER= bsd@dino.sk COMMENT= Courier SMTP IMAP POP3 HTTP mail server suite WWW= https://www.Courier-MTA.org/ LICENSE= GPLv3 LICENSE_FILE= ${WRKSRC}/COPYING.GPL -BROKEN= ld: error: duplicate symbol: sqwebmail_content_charset -DEPRECATED= Broken for more than a year and fails to build on supported RELEASE -EXPIRATION_DATE= 2023-06-01 - -BUILD_DEPENDS= courierauthconfig:security/courier-authlib-base +BUILD_DEPENDS= courierauthconfig:security/courier-authlib-base \ + wget:ftp/wget LIB_DEPENDS= libidn.so:dns/libidn \ - libpcre.so:devel/pcre + libpcre.so:devel/pcre \ + libgdbm.so:databases/gdbm \ + libcourier-unicode.so:devel/courier-unicode \ + libpcre2-8.so:devel/pcre2 RUN_DEPENDS= courierauthconfig:security/courier-authlib-base \ ${LOCALBASE}/share/sysconftool/sysconftool:devel/sysconftool \ ${LOCALBASE}/etc/mime.types:misc/mime-support \ p5-Net-CIDR>=0:net-mgmt/p5-Net-CIDR \ - ca_root_nss>=3.*:security/ca_root_nss - + ca_root_nss>=3.*:security/ca_root_nss \ + ${LOCALBASE}/bin/wget:ftp/wget CONFLICTS= courier-imap-2.* couriermlm-0.* \ exim-4.* maildrop-1.* \ panda-imap-201* postfix-1.* postfix-2.* \ qmail-*-1.* qmail-1.* \ sendmail-*-8.* sendmail-8.* \ smail-3.* sqwebmail-3.* \ zmailer-2.* # # User-serviceable variables # # [ There's no need to add trailing ``/''s ] # # set IMAGEURL to where on the web server URL the images are found # set CACHEOWN to who you'd like to own the cache files # set MAILDROPDEFAULT to what you'd like the $DEFAULT in maildrop to be # recomended values are: /var/mail, ./Mailbox or ./Maildir # IMAGEURL?= /webmail CACHEOWN?= pop MAILDROPDEFAULT?=./Maildir # End of user-serviceable variables -MAILOWN= courier -MAILGRP= courier -MAILUID= 465 -MAILGID= 465 +MAILOWN?= courier +MAILGRP?= courier +MAILUID?= 465 +MAILGID?= 465 ETCDIR= ${PREFIX}/etc SYSCONFDIR= ${ETCDIR}/courier LIBEXECDIR= ${PREFIX}/libexec LOCALSTATEDIR= /var/spool/courier CACHEDIR= /var/spool/webmail CALENDIR= /var/spool/calendar MIMETYPES= ${LOCALBASE}/etc/mime.types WITH_TRANSPORT= local esmtp dsn -USES= fam gettext gmake libtool perl5 pkgconfig tar:bzip2 ssl +USES= fam gettext gmake libtool perl5 pkgconfig tar:bzip2 ssl shebangfix USE_SUBMAKE= yes USE_RC_SUBR= courier +SHEBANG_FILES= courier/filters/perlfilter/perlfilter-ratelimit.pl \ + courier/filters/perlfilter/perlfilter-wrapper.pl GNU_CONFIGURE= yes CONFIGURE_ARGS= --disable-root-check \ - --with-db=db \ + --with-db=gdbm \ --enable-syslog=1 --enable-use-flock \ --program-transform-name=s,^,, \ --enable-utf7-folder-encoding \ --enable-unicode \ --with-mailuser=${MAILOWN} \ --with-mailgroup=${MAILGRP} \ --with-mailuid=${MAILUID} \ --with-mailgid=${MAILGID} \ --with-etcdir=${ETCDIR} \ --sysconfdir=${SYSCONFDIR} \ --datadir=${DATADIR} \ --libexecdir=${LIBEXECDIR} \ --localstatedir=${LOCALSTATEDIR} \ --enable-mimetypes=${MIMETYPES} \ --enable-imageurl=${IMAGEURL} \ --with-cachedir=${CACHEDIR} \ --with-cacheowner=${CACHEOWN} \ --with-calendardir=${CALENDIR} \ - --with-certsdir=${SYSCONFDIR} \ + --with-mydatadir=${SYSCONFDIR} \ --with-transport='${WITH_TRANSPORT}' \ --with-default-maildrop=${MAILDROPDEFAULT} \ --with-paranoid-smtpext \ - --enable-workarounds-for-imap-client-bugs + --enable-workarounds-for-imap-client-bugs \ + --with-notice=unicode + CPPFLAGS+= -I${LOCALBASE}/include LIBS+= -L${LOCALBASE}/lib INSTALL_TARGET= install-strip install-perms PLIST_SUB+= BINOWN="${BINOWN}" BINGRP="${BINGRP}" \ + CACHEOWN="${CACHEOWN}" CACHEDIR="${CACHEDIR}" \ + CALENDIR="${CALENDIR}" LOCALSTATEDIR="${LOCALSTATEDIR}" \ MAILOWN="${MAILOWN}" MAILGRP="${MAILGRP}" \ MAILUID="${MAILUID}" MAILGID="${MAILGID}" \ - CACHEOWN="${CACHEOWN}" CACHEDIR="${CACHEDIR}" \ - CALENDIR="${CALENDIR}" LOCALSTATEDIR="${LOCALSTATEDIR}" + SHAREOWN="${SHAREOWN}" SHAREGRP="${SHAREGRP}" + SUB_LIST:= ${PLIST_SUB} SUB_FILES+= pkg-message crontab sharedindexupdate -#SUB_FILES+= pkg-install pkg-message crontab sharedindexupdate -OPTIONS_DEFINE= LDAP PROCMAIL SENDFAX UUCP IPV6 MAILDROPFLAGS DOCS +OPTIONS_DEFINE= LDAP PROCMAIL SENDFAX UUCP IPV6 DOCS CERTSDIR OPTIONS_GROUP= WEBMAIL -#OPTIONS_GROUP= SYSTEM WEBMAIL -#OPTIONS_GROUP_SYSTEM= RCCONF MAILCONF PERIODIC OPTIONS_GROUP_WEBMAIL= GNUPG WEBMAILRSENT WEBMAILFLAGS WEBMAILXFACE OPTIONS_RADIO= ALIASES SPELL OPTIONS_RADIO_ALIASES= SYSTEMALIASES EMPTYALIASES OPTIONS_RADIO_SPELL= ASPELL ISPELL OPTIONS_DEFAULT=WEBMAILRSENT SYSTEMALIASES LDAP_DESC= LDAP-based mail aliasing support GNUPG_DESC= GNU Privacy Guard support for WebMail ASPELL_DESC= ASpell support for WebMail ISPELL_DESC= ISpell support for WebMail PROCMAIL_DESC= Procmail local delivery support SENDFAX_DESC= mgetty+sendfax support UUCP_DESC= UUCP support -MAILDROPFLAGS_DESC= maildrop set flags patch +CERTSDIR_DESC= separate .pem directory for certificates WEBMAILRSENT_DESC= enable Autorename Sent folder WEBMAILFLAGS_DESC= webmail show flags patch WEBMAILXFACE_DESC= experimental webmail X-Face patch SYSTEMALIASES_DESC= symlink system /etc/aliases EMPTYALIASES_DESC= create empty aliases file RCCONF_DESC= modify rc.conf to enable courier/disable sendmail MAILCONF_DESC= modify mailer.conf to use courier instead of sendmail PERIODIC_DESC= modify/create periodic.conf .include .include "${.CURDIR}/Makefile.doc" -.include "${.CURDIR}/Makefile.own" .if ${PORT_OPTIONS:MLDAP} USES+= ldap WITH_AUTH_LDAP= yes RUN_DEPENDS+= ${LOCALBASE}/lib/courier-authlib/libauthldap.so:net/courier-authlib-ldap CONFIGURE_ARGS+=--with-ldapaliasd PLIST_SUB+= WITHLDAP="" SUB_LIST+= WITHLDAP="" .else CONFIGURE_ARGS+=--without-ldapaliasd PLIST_SUB+= WITHLDAP="@comment " SUB_LIST+= WITHLDAP="@comment " .endif .if ${PORT_OPTIONS:MSYSTEMALIASES} PLIST_SUB+= WITHSYSTEMALIASES="" SUB_LIST+= WITHSYSTEMALIASES="" .else PLIST_SUB+= WITHSYSTEMALIASES="@comment " SUB_LIST+= WITHSYSTEMALIASES="@comment " .endif .if ${PORT_OPTIONS:MEMPTYALIASES} PLIST_SUB+= WITHEMPTYALIASES="" SUB_LIST+= WITHEMPTYALIASES="" .else PLIST_SUB+= WITHEMPTYALIASES="@comment " SUB_LIST+= WITHEMPTYALIASES="@comment " .endif .if exists(${.CURDIR}/../../security/courier-authlib/Makefile.dep) .include "${.CURDIR}/../../security/courier-authlib/Makefile.dep" .endif .if ${PORT_OPTIONS:MGNUPG} BUILD_DEPENDS+= gpg:security/gnupg RUN_DEPENDS+= gpg:security/gnupg +.else +# This is a hack! But works well (at least partially) for me... +CONFIGURE_ENV+= GPG="${WRKSRC}/fakegpg" .endif .if ${PORT_OPTIONS:MASPELL} BUILD_DEPENDS+= aspell:textproc/aspell RUN_DEPENDS+= aspell:textproc/aspell CONFIGURE_ARGS+=--with-ispell=${LOCALBASE}/bin/aspell .elif ${PORT_OPTIONS:MISPELL} BUILD_DEPENDS+= ispell:textproc/aspell-ispell RUN_DEPENDS+= ispell:textproc/aspell-ispell CONFIGURE_ARGS+=--with-ispell=${LOCALBASE}/bin/ispell .else CONFIGURE_ARGS+=--without-ispell .endif .if ${PORT_OPTIONS:MPROCMAIL} BUILD_DEPENDS+= procmail:mail/procmail RUN_DEPENDS+= procmail:mail/procmail .endif .if ${PORT_OPTIONS:MSENDFAX} USES+= ghostscript SENDFAX_DEPENDS=sendfax:comms/mgetty+sendfax \ pnmscale:graphics/netpbm BUILD_DEPENDS+= ${SENDFAX_DEPENDS} RUN_DEPENDS+= ${SENDFAX_DEPENDS} WITH_TRANSPORT+=fax PLIST_SUB+= WITHFAX="" SUB_LIST+= WITHFAX="" .else PLIST_SUB+= WITHFAX="@comment " SUB_LIST+= WITHFAX="@comment " .endif .if ${PORT_OPTIONS:MUUCP} .if !exists(/usr/bin/uux) BUILD_DEPENDS+= uux:net/freebsd-uucp RUN_DEPENDS+= uux:net/freebsd-uucp .endif WITH_TRANSPORT+=uucp PLIST_SUB+= WITHUUCP="" .else PLIST_SUB+= WITHUUCP="@comment " .endif .if ${PORT_OPTIONS:MIPV6} CONFIGURE_ARGS+=--with-ipv6 .else CONFIGURE_ARGS+=--without-ipv6 .endif -.if ${PORT_OPTIONS:MMAILDROPFLAGS} -EXTRA_PATCHES+= ${FILESDIR}/extra-patch-maildrop__maildir.C -.endif - .if ${PORT_OPTIONS:MWEBMAILXFACE} -EXTRA_PATCHES+= ${FILESDIR}/extra-patch-webmail__msg2html.c +EXTRA_PATCHES+= ${FILESDIR}/extra-patch-libs__sqwebmail__msg2html.c .endif .if ${PORT_OPTIONS:MWEBMAILFLAGS} -EXTRA_PATCHES+= ${FILESDIR}/extra-patch-webmail__folder.c ${FILESDIR}/extra-patch-webmail__maildir.c -EXTRA_PATCHES+= ${FILESDIR}/extra-patch-webmail__maildir.h ${FILESDIR}/extra-patch-webmail__images__sqwebmail.css +EXTRA_PATCHES+= ${FILESDIR}/extra-patch-libs__sqwebmail__folder.c ${FILESDIR}/extra-patch-libs__sqwebmail__maildir.c +EXTRA_PATCHES+= ${FILESDIR}/extra-patch-libs__sqwebmail__maildir.h ${FILESDIR}/extra-patch-libs__sqwebmail__images__sqwebmail.css .endif .if ${PORT_OPTIONS:MWEBMAILRSENT} CONFIGURE_ARGS+=--enable-autorenamesent .else CONFIGURE_ARGS+=--disable-autorenamesent .endif .if ${PORT_OPTIONS:MMAILCONF} SUB_LIST+= MAILCONF="y" .else SUB_LIST+= MAILCONF="n" .endif .if ${PORT_OPTIONS:MRCCONF} SUB_LIST+= RCCONF="y" .else SUB_LIST+= RCCONF="n" .endif .if ${PORT_OPTIONS:MPERIODIC} SUB_LIST+= PERIODIC="y" .else SUB_LIST+= PERIODIC="n" .endif -.if ${SSL_DEFAULT} == base -BROKEN_FreeBSD_12= pkg-static: Unable to access file /wrkdirs/usr/ports/mail/courier/work/stage/usr/local/bin/couriertls -BROKEN_FreeBSD_13= pkg-static: Unable to access file /wrkdirs/usr/ports/mail/courier/work/stage/usr/local/bin/couriertls +.if ${PORT_OPTIONS:MCERTSDIR} +CONFIGURE_ARGS+=--with-certsdir=${SYSCONFDIR}/.pem +PLIST_SUB+= WITHCERTSDIR="" +SUB_LIST+= CERTSDIR="${SYSCONFDIR}/.pem" +.else +CONFIGURE_ARGS+=--with-certsdir=${SYSCONFDIR} +PLIST_SUB+= WITHCERTSDIR="@comment " +SUB_LIST+= CERTSDIR="${SYSCONFDIR}" .endif +_CNFFILES= esmtpd.cnf \ + imapd.cnf \ + pop3d.cnf + +_DISTEXFILES= courierd.dist \ + esmtpd-msa.dist \ + esmtpd-ssl.dist \ + esmtpd.dist \ + faxcoverpage.tr.dist \ + faxnotifyrc.dist \ + faxrc.dist \ + imapd-ssl.dist \ + imapd.dist \ + ldapaddressbook.dist \ + ldapaliasrc.dist \ + pop3d-ssl.dist \ + pop3d.dist \ + sqwebmaild.dist \ + webmlmrc.dist + pre-everything:: @${ECHO_MSG} "===> --------------------------------------------------------" @${ECHO_MSG} "===> Run 'make config' to (re)configure ${PKGNAME}" @${ECHO_MSG} "===> --------------------------------------------------------" pre-patch: - @${CP} ${TEMPLATES}/config.guess ${TEMPLATES}/config.sub ${WRKSRC} + ${CP} ${TEMPLATES}/config.guess ${TEMPLATES}/config.sub ${WRKSRC} post-patch: - @${REINPLACE_CMD} -i '' -e 's|#! perl|#!${PERL}|g' \ + ${REINPLACE_CMD} -i '' -e 's|#! perl|#!${PERL}|g' \ ${WRKSRC}/webadmin/*.pl \ ${WRKSRC}/webadmin/*.pl.in \ ${WRKSRC}/courier/webadmin/*.pl \ ${WRKSRC}/courier/webadmin/*.pl.in - @${REINPLACE_CMD} -e 's|^PROG=\./|PROG=exec ./|g' \ + ${REINPLACE_CMD} -e 's|^PROG=\./|PROG=exec ./|g' \ ${WRKSRC}/courier/module.*/courier.config - @${REINPLACE_CMD} -e 's|@mydatadir@|@sysconfdir@|g' \ - ${WRKSRC}/*/mk*cert.* \ + ${REINPLACE_CMD} -e 's|@mydatadir@|@sysconfdir@|g' \ ${WRKSRC}/*/*/mk*cert.* - @${REINPLACE_CMD} -e 's|^\(TLS_CERTFILE=\)@mydatadir@|\1@sysconfdir@|g' \ + ${REINPLACE_CMD} -e 's|^\(TLS_CERTFILE=\)@mydatadir@|\1@sysconfdir@|g' \ + ${WRKSRC}/*/*.dist.in \ + ${WRKSRC}/*/*/*.dist.in + ${REINPLACE_CMD} -e 's|^\(TLS_DHPARAMS=\)@mydatadir@|\1@sysconfdir@|g' \ ${WRKSRC}/*/*.dist.in \ ${WRKSRC}/*/*/*.dist.in - @${REINPLACE_CMD} -e 's|^\(RANDFILE[[:space:]]*=[[:space:]]*\)@mydatadir@|\1@sysconfdir@|g' \ - ${WRKSRC}/*/*.cnf.openssl.in \ + ${REINPLACE_CMD} -e 's|^\(RANDFILE[[:space:]]*=[[:space:]]*\)@mydatadir@|\1@sysconfdir@|g' \ ${WRKSRC}/*/*/*.cnf.openssl.in - @${REINPLACE_CMD} -e 's|$$(INSTALL_DATA) \(.$$$$file.\)|${INSTALL_MAN} \1|' \ + ${REINPLACE_CMD} -e 's|$$(INSTALL_DATA) \(.$$$$file.\)|${INSTALL_MAN} \1|' \ ${WRKSRC}/Makefile.in \ ${WRKSRC}/*/Makefile.in \ ${WRKSRC}/*/*/Makefile.in \ ${WRKSRC}/*/*/*/Makefile.in - @${REINPLACE_CMD} -e 's|^\(INSTALL_STRIP_PROGRAM=\).*$$|\1"${INSTALL_PROGRAM} -s"|' \ + ${REINPLACE_CMD} -e 's|^\(INSTALL_STRIP_PROGRAM=\).*$$|\1"${INSTALL_PROGRAM} -s"|' \ -e 's|; ldapaliasd="yes"||' \ ${WRKSRC}/configure \ ${WRKSRC}/*/configure \ ${WRKSRC}/*/*/configure \ ${WRKSRC}/*/*/*/configure - @${REINPLACE_CMD} -E -e 's/(root|bin)[[:space:]]*bin/root wheel/g' \ + ${REINPLACE_CMD} -E -e 's/(root|bin)[[:space:]]*bin/root wheel/g' \ ${WRKSRC}/courier/perms.sh.in - @${REINPLACE_CMD} '/^courieresmtp_LDADD =/s/$$/ -lcourierauth/' \ + ${REINPLACE_CMD} '/^courieresmtp_LDADD =/s/$$/ -lcourierauth/' \ ${WRKSRC}/courier/module.esmtp/Makefile.in # Avoid conflict with C++20 by adding .txt suffix - @${REINPLACE_CMD} -i .c++20 's/>version$$/&.txt/' ${WRKSRC}/configure - @${FIND} ${WRKSRC} -name configure -exec ${REINPLACE_CMD} \ + ${REINPLACE_CMD} -i .c++20 's/>version$$/&.txt/' ${WRKSRC}/configure + ${FIND} ${WRKSRC} -name configure -exec ${REINPLACE_CMD} \ -i .c++20 '/^version.*cat/s,/version,&.txt,' {} + +pre-configure: +# This is a hack! But works well (at least partially) for me... + touch ${WRKSRC}/fakegpg + chmod +x ${WRKSRC}/fakegpg + post-build: - @${PERL} -pi -e 's|^(auth)\s+(required).*|$$1\t\t$$2\tpam_unix.so\ttry_first_pass|g;' \ - -e 's|^(account)\s+(required).*|$$1 \t$$2\tpam_unix.so|g;' \ - -e 's|^(session)\s+(required).*|$$1 \t$$2\tpam_permit.so|g;' \ + ${PERL} -pi -e 's|^(auth)\s+(required).*|$$1\t\t$$2\tpam_unix.so\ttry_first_pass|g;' \ + -e 's|^(account)\s+(required).*|$$1 \t$$2\tpam_unix.so|g;' \ + -e 's|^(session)\s+(required).*|$$1 \t$$2\tpam_permit.so|g;' \ ${WRKSRC}/*/*.authpam* \ ${WRKSRC}/*/*/*.authpam* - @${LN} -f ${WRKSRC}/gpglib/README.html ${WRKSRC}/gpglib/README.gpglib.html - @${LN} -f ${WRKSRC}/imap/BUGS ${WRKSRC}/imap/BUGS.imap - @${LN} -f ${WRKSRC}/imap/BUGS.html ${WRKSRC}/imap/BUGS.imap.html - @${LN} -f ${WRKSRC}/imap/README ${WRKSRC}/imap/README.imap - @${LN} -f ${WRKSRC}/imap/README.html ${WRKSRC}/imap/README.imap.html - @${LN} -f ${WRKSRC}/maildrop/README.html ${WRKSRC}/maildrop/README.maildrop.html - @${LN} -f ${WRKSRC}/pcp/README.html ${WRKSRC}/pcp/README.pcp.html - @${LN} -f ${WRKSRC}/webmail/BUGS ${WRKSRC}/webmail/BUGS.webmail - @${LN} -f ${WRKSRC}/webmail/BUGS.html ${WRKSRC}/webmail/BUGS.webmail.html - @${LN} -f ${WRKSRC}/webmail/SECURITY ${WRKSRC}/webmail/SECURITY.webmail - @${LN} -f ${WRKSRC}/webmail/SECURITY.html ${WRKSRC}/webmail/SECURITY.webmail.html + ${INSTALL} -lrs ${WRKSRC}/libs/gpglib/README.html ${WRKSRC}/libs/gpglib/README.gpglib.html + ${INSTALL} -lrs ${WRKSRC}/libs/imap/BUGS ${WRKSRC}/libs/imap/BUGS.imap + ${INSTALL} -lrs ${WRKSRC}/libs/imap/BUGS.html ${WRKSRC}/libs/imap/BUGS.imap.html + ${INSTALL} -lrs ${WRKSRC}/libs/maildrop/README.html ${WRKSRC}/libs/maildrop/README.maildrop.html + ${INSTALL} -lrs ${WRKSRC}/libs/pcp/README.html ${WRKSRC}/libs/pcp/README.pcp.html + ${INSTALL} -lrs ${WRKSRC}/libs/sqwebmail/BUGS ${WRKSRC}/libs/sqwebmail/BUGS.sqwebmail + ${INSTALL} -lrs ${WRKSRC}/libs/sqwebmail/BUGS.html ${WRKSRC}/libs/sqwebmail/BUGS.sqwebmail.html + ${INSTALL} -lrs ${WRKSRC}/libs/sqwebmail/SECURITY ${WRKSRC}/libs/sqwebmail/SECURITY.sqwebmail + ${INSTALL} -lrs ${WRKSRC}/libs/sqwebmail/SECURITY.html ${WRKSRC}/libs/sqwebmail/SECURITY.sqwebmail.html post-install: - @${LN} -f ${STAGEDIR}${SYSCONFDIR}/maildrop ${STAGEDIR}${SYSCONFDIR}/maildropfilter - @${INSTALL_DATA} /dev/null ${STAGEDIR}${SYSCONFDIR}/locallowercase - @${INSTALL_DATA} ${WRKDIR}/crontab ${STAGEDIR}${SYSCONFDIR}/ - @${INSTALL_SCRIPT} ${WRKDIR}/sharedindexupdate ${STAGEDIR}${DATADIR}/ -.for file in ${OWNER0} - @-${CHOWN} -Rh ${BINOWN}:${BINGRP} ${STAGEDIR}${PREFIX}/${file} +.for _cfgfile in ${_CNFFILES} + -${MV} ${STAGEDIR}${SYSCONFDIR}/${_cfgfile} ${STAGEDIR}${SYSCONFDIR}/${_cfgfile:S/.cnf/.cnf.sample/g} .endfor +.for _cfgfile in ${_DISTEXFILES} + -${MV} ${STAGEDIR}${SYSCONFDIR}/${_cfgfile} ${STAGEDIR}${SYSCONFDIR}/${_cfgfile:S/.dist/.sample/g} +.endfor + ${INSTALL} -lrs ${STAGEDIR}${SYSCONFDIR}/maildrop ${STAGEDIR}${SYSCONFDIR}/maildropfilter + ${INSTALL_DATA} /dev/null ${STAGEDIR}${SYSCONFDIR}/locallowercase + ${INSTALL_DATA} ${WRKDIR}/crontab ${STAGEDIR}${SYSCONFDIR}/ + ${INSTALL_SCRIPT} ${WRKDIR}/sharedindexupdate ${STAGEDIR}${DATADIR}/ .if ${PORT_OPTIONS:MDOCS} - @${MKDIR} ${STAGEDIR}${DOCSDIR} - @${MKDIR} ${STAGEDIR}${DOCSDIR}/html + ${MKDIR} ${STAGEDIR}${DOCSDIR} + ${MKDIR} ${STAGEDIR}${DOCSDIR}/html .for f in ${DOCS} - @${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${DOCSDIR} .endfor .for f in ${HTMLDOCS} - @${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${DOCSDIR}/html + ${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${DOCSDIR}/html .endfor - @${INSTALL_DATA} ${STAGEDIR}${DATADIR}/htmldoc/* ${STAGEDIR}${DOCSDIR}/html + ${INSTALL_DATA} ${STAGEDIR}${DATADIR}/htmldoc/* ${STAGEDIR}${DOCSDIR}/html +.endif +.if ${PORT_OPTIONS:MCERTSDIR} + ${MKDIR} ${STAGEDIR}${SYSCONFDIR}/.pem .endif - @${RM} -r ${STAGEDIR}${DATADIR}/htmldoc - @-${CHOWN} -Rh ${SHAREOWN}:${SHAREGRP} ${STAGEDIR}${DATADIR} - @${CHMOD} -R a+r ${STAGEDIR}${DATADIR}/courierwebadmin - @${CHMOD} -R a-w ${STAGEDIR}${DATADIR} ${STAGEDIR}${LIBEXECDIR}/courier - @${CHMOD} 550 ${STAGEDIR}${LIBEXECDIR}/courier/modules/esmtp/courieresmtp* + ${RM} -r ${STAGEDIR}${DATADIR}/htmldoc + ${CHMOD} -R a+r ${STAGEDIR}${DATADIR}/courierwebadmin + ${CHMOD} -R a-w ${STAGEDIR}${DATADIR} ${STAGEDIR}${LIBEXECDIR}/courier + ${CHMOD} 550 ${STAGEDIR}${LIBEXECDIR}/courier/modules/esmtp/courieresmtp* .include diff --git a/mail/courier/Makefile.doc b/mail/courier/Makefile.doc index a0e0cfcc166e..d93cdb4798c9 100644 --- a/mail/courier/Makefile.doc +++ b/mail/courier/Makefile.doc @@ -1,31 +1,29 @@ DOCS= AUTHORS \ BENCHMARKS \ COPYING \ COPYING.GPL \ ChangeLog \ ChangeLog.2001 \ INSTALL \ NEWS \ README \ TODO \ - imap/BUGS.imap \ - imap/README.imap \ - imap/README.proxy \ - maildir/README.maildirquota.txt \ - maildir/README.sharedfolders.txt \ - tcpd/README.couriertls \ - webmail/BUGS.webmail \ - webmail/SECURITY.webmail + libs/imap/BUGS.imap \ + libs/imap/README.imap.proxy \ + libs/maildir/README.maildirquota.txt \ + libs/maildir/README.sharedfolders.txt \ + libs/tcpd/README.couriertls \ + libs/sqwebmail/BUGS.webmail \ + libs/sqwebmail/SECURITY.webmail HTMLDOCS=NEWS.html \ - gpglib/README.gpglib.html \ - imap/BUGS.imap.html \ - imap/README.imap.html \ - imap/README.proxy.html \ - maildir/README.maildirfilter.html \ - maildir/README.maildirquota.html \ - maildir/README.sharedfolders.html \ - maildrop/README.maildrop.html \ - pcp/README.pcp.html \ - webmail/BUGS.webmail.html \ - webmail/SECURITY.webmail.html + libs/gpglib/README.gpglib.html \ + libs/imap/BUGS.imap.html \ + libs/imap/README.imap.proxy.html \ + libs/maildir/README.maildirfilter.html \ + libs/maildir/README.maildirquota.html \ + libs/maildir/README.sharedfolders.html \ + libs/maildrop/README.maildrop.html \ + libs/pcp/README.pcp.html \ + libs/sqwebmail/BUGS.webmail.html \ + libs/sqwebmail/SECURITY.webmail.html diff --git a/mail/courier/Makefile.own b/mail/courier/Makefile.own deleted file mode 100644 index 3d1b346df0ba..000000000000 --- a/mail/courier/Makefile.own +++ /dev/null @@ -1,67 +0,0 @@ -OWNER0= bin/courier-config \ - bin/couriermlm \ - bin/couriertls \ - bin/deliverquota \ - bin/dotforward \ - bin/imapd \ - bin/lockmail \ - bin/mailbot \ - bin/maildirmake \ - bin/maildiracl \ - bin/maildirkw \ - bin/makemime \ - bin/mimegpg \ - bin/preline \ - bin/reformail \ - bin/reformime \ - bin/sendmail \ - bin/testmxlookup \ - bin/webmlmd \ - bin/webmlmd.rc \ - etc/courier/courierd.dist \ - etc/courier/enablefiltering \ - etc/courier/esmtp.authpam \ - etc/courier/esmtpd-msa.dist \ - etc/courier/esmtpd-ssl.dist \ - etc/courier/esmtpd.cnf \ - etc/courier/esmtpd.dist \ - etc/courier/imapd-ssl.dist \ - etc/courier/imapd.authpam \ - etc/courier/imapd.cnf \ - etc/courier/imapd.dist \ - etc/courier/ldapaddressbook.dist \ - etc/courier/locallowercase \ - etc/courier/maildrop \ - etc/courier/maildropfilter \ - etc/courier/pop3d-ssl.dist \ - etc/courier/pop3d.authpam \ - etc/courier/pop3d.cnf \ - etc/courier/pop3d.dist \ - etc/courier/quotawarnmsg.example \ - etc/courier/rfcerr2045.txt \ - etc/courier/rfcerr2046.txt \ - etc/courier/rfcerr2047.txt \ - etc/courier/rfcerrheader.txt \ - etc/courier/smtpaccess/default \ - etc/courier/webmail.authpam \ - etc/courier/webmlmrc.dist \ - libexec/courier/courierpop3d \ - libexec/courier/courierpop3login \ - libexec/courier/imaplogin \ - libexec/courier/makedatprog \ - libexec/courier/modules \ - libexec/courier/pcpd \ - libexec/courier/sqwebmaild \ - libexec/courier/webmail/webadmin \ - libexec/courier/webmail/webmail \ - libexec/courier/webmail/webmlm \ - libexec/filters/dupfilter \ - libexec/filters/perlfilter \ - sbin/courier \ - sbin/couriertcpd \ - sbin/showconfig \ - sbin/webmaild - -.if defined(WITH_LDAP) && !defined(WITHOUT_LDAP) -OWNER0+=sbin/courierldapaliasd -.endif diff --git a/mail/courier/distinfo b/mail/courier/distinfo index 0d76693c1c49..af6d59963b10 100644 --- a/mail/courier/distinfo +++ b/mail/courier/distinfo @@ -1,2 +1,3 @@ -SHA256 (courier-0.65.3.tar.bz2) = a743ba01137230165b00d726cf0faef3998d43edc0bfb00d8358eeefd96c7d60 -SIZE (courier-0.65.3.tar.bz2) = 7152828 +TIMESTAMP = 1686226592 +SHA256 (courier-1.1.11.tar.bz2) = 4fe3b73e7da159351ab973b52044996aa0006076f2effdcc4c004be087c5f777 +SIZE (courier-1.1.11.tar.bz2) = 7895772 diff --git a/mail/courier/files/courier.in b/mail/courier/files/courier.in index 2dcecaa786e6..45a3e5a54bf5 100644 --- a/mail/courier/files/courier.in +++ b/mail/courier/files/courier.in @@ -1,327 +1,341 @@ #!/bin/sh # # Adapted for FreeBSD from courier.sysvinit # # NOTE: The 'restart' here does a "hard" stop, and a start. Be gentle, use # "courierd restart" for a kindler, gentler, restart. # # PROVIDE: mail # REQUIRE: LOGIN courier_authdaemond # BEFORE: securelevel # KEYWORD: shutdown prefix="%%PREFIX%%" exec_prefix="${prefix}" sysconfdir="${prefix}/etc/courier" +certsdir="%%CERTSDIR%%" sbindir="${exec_prefix}/sbin" bindir="${exec_prefix}/bin" libexecdir="${prefix}/libexec" datadir="${prefix}/share/courier" # Define these courier_* variables in one of these files: # /etc/rc.conf # /etc/rc.conf.local # /etc/rc.conf.d/courier # # DO NOT CHANGE THESE DEFAULT VALUES HERE # courier_enable=${courier_enable:-"NO"} # Run Courier-MTA (YES/NO). . /etc/rc.subr name="courier" rcvar=courier_enable start_precmd="${name}_prestart" start_cmd="${name}_start" stop_cmd="${name}_stop" extra_commands="restart" courier_prestart() { # Ensure runtime directories exist with correct permissions /usr/bin/install -o %%BINOWN%% -g %%BINGRP%% -m 0755 -d %%LOCALSTATEDIR%% /usr/bin/install -o %%MAILOWN%% -g %%MAILGRP%% -m 0750 -d %%LOCALSTATEDIR%%/allfilters /usr/bin/install -o %%MAILOWN%% -g %%MAILGRP%% -m 0700 -d %%LOCALSTATEDIR%%/faxtmp /usr/bin/install -o %%MAILOWN%% -g %%MAILGRP%% -m 0750 -d %%LOCALSTATEDIR%%/filters /usr/bin/install -o %%MAILOWN%% -g %%MAILGRP%% -m 0750 -d %%LOCALSTATEDIR%%/msgq /usr/bin/install -o %%MAILOWN%% -g %%MAILGRP%% -m 0750 -d %%LOCALSTATEDIR%%/msgs /usr/bin/install -o %%MAILOWN%% -g %%MAILGRP%% -m 0770 -d %%LOCALSTATEDIR%%/tmp /usr/bin/install -o %%MAILOWN%% -g %%MAILGRP%% -m 0755 -d %%LOCALSTATEDIR%%/track /usr/bin/install -o %%MAILOWN%% -g %%MAILGRP%% -m 0400 -c /dev/null %%LOCALSTATEDIR%%/.noident /usr/bin/install -o %%BINOWN%% -g %%BINGRP%% -m 0755 -d %%CALENDIR%% /usr/bin/install -o %%CACHEOWN%% -g %%MAILGRP%% -m 0700 -d %%CALENDIR%%/localcache /usr/bin/install -o %%CACHEOWN%% -g %%MAILGRP%% -m 0750 -d %%CALENDIR%%/private /usr/bin/install -o %%CACHEOWN%% -g %%MAILGRP%% -m 0755 -d %%CALENDIR%%/public /usr/bin/install -o %%CACHEOWN%% -g mail -m 0700 -d %%CACHEDIR%% } courier_start() { # First time after install create aliases.dat and makesmtpaccess.dat echo -n "Starting" if [ -f ${sysconfdir}/crontab ]; then /usr/bin/crontab -u %%CACHEOWN%% ${sysconfdir}/crontab fi if [ ! -f ${sysconfdir}/aliases.dat \ -a -x ${sbindir}/makealiases ]; then ${sbindir}/makealiases fi esmtpdcert=0 ESMTPDSTART="" if [ -f ${sysconfdir}/esmtpd ]; then . ${sysconfdir}/esmtpd case "$ESMTPDSTART" in [Yy]*) esmtpdcert=1 ;; esac if [ ! -f ${sysconfdir}/esmtpacceptmailfor.dat \ -a -x ${sbindir}/makeacceptmailfor ]; then ${sbindir}/makeacceptmailfor fi if [ ! -f ${sysconfdir}/${ACCESSFILE}.dat \ -a -x ${sbindir}/makesmtpaccess ]; then ${sbindir}/makesmtpaccess fi fi ESMTPDSTART="" if [ -f ${sysconfdir}/esmtpd-msa ]; then . ${sysconfdir}/esmtpd-msa case "$ESMTPDSTART" in [Yy]*) esmtpdcert=1 ;; esac if [ ! -f ${sysconfdir}/${ACCESSFILE}.dat \ -a -x ${sbindir}/makesmtpaccess-msa ]; then ${sbindir}/makesmtpaccess-msa fi fi if [ -x ${sbindir}/courierfilter ]; then echo -n " courierfilter" ${sbindir}/courierfilter start fi if [ -x ${sbindir}/courierldapaliasd ]; then echo -n " courierldapaliasd" ${sbindir}/courierldapaliasd start fi if [ -x ${libexecdir}/courier/sqwebmaild \ -a -x ${sbindir}/webmaild ]; then echo -n " webmail" ${sbindir}/webmaild start fi if [ -x ${sbindir}/courier ]; then echo -n " courierd" ${sbindir}/courier start fi if [ "$esmtpdcert" = 1 ]; then # If we do not have a certificate, make one up. - if [ ! -f ${sysconfdir}/esmtpd.pem \ + if [ ! -f ${certsdir}/esmtpd.pem \ -a -x "$COURIERTLS" \ -a -x ${sbindir}/mkesmtpdcert ]; then echo -n " generating-ESMTP-SSL-certificate..." ${sbindir}/mkesmtpdcert >/dev/null 2>&1 fi fi ESMTPDSTART="" if [ -f ${sysconfdir}/esmtpd ]; then . ${sysconfdir}/esmtpd case "$ESMTPDSTART" in [Yy]*) if [ -x ${sbindir}/esmtpd ]; then echo -n " esmtpd" ${sbindir}/esmtpd start fi ;; esac fi ESMTPDSTART="" if [ -f ${sysconfdir}/esmtpd-msa ]; then . ${sysconfdir}/esmtpd-msa case "$ESMTPDSTART" in [Yy]*) if [ -x ${sbindir}/esmtpd-msa ]; then echo -n " esmtpd-msa" ${sbindir}/esmtpd-msa start fi ;; esac fi ESMTPDSSLSTART="" if [ -f ${sysconfdir}/esmtpd-ssl ]; then . ${sysconfdir}/esmtpd-ssl case "$ESMTPDSSLSTART" in [Yy]*) if [ -x "$COURIERTLS" \ -a -x ${sbindir}/esmtpd-ssl ]; then echo -n " esmtpd-ssl" ${sbindir}/esmtpd-ssl start fi ;; esac fi IMAPDSTART="" if [ -f ${sysconfdir}/imapd ]; then . ${sysconfdir}/imapd case "$IMAPDSTART" in [Yy]*) if [ -x ${sbindir}/imapd ]; then echo -n " imapd" ${sbindir}/imapd start fi ;; esac fi IMAPDSSLSTART="" if [ -f ${sysconfdir}/imapd-ssl ]; then . ${sysconfdir}/imapd-ssl case "$IMAPDSSLSTART" in [Yy]*) # If we do not have a certificate, make one up. if [ -x "$COURIERTLS" ]; then - if [ ! -f ${sysconfdir}/imapd.pem \ + if [ ! -f ${certsdir}/imapd.pem \ -a -x ${sbindir}/mkimapdcert ]; then echo -n " generating-IMAP-SSL-certificate..." ${sbindir}/mkimapdcert >/dev/null 2>&1 + # double usage - DH params need to exist + esmtpdcert=1 fi if [ -x ${sbindir}/imapd-ssl ]; then echo -n " imapd-ssl" ${sbindir}/imapd-ssl start fi fi ;; esac fi POP3DSTART="" if [ -f ${sysconfdir}/pop3d ]; then . ${sysconfdir}/pop3d case "$POP3DSTART" in [Yy]*) if [ -x ${sbindir}/pop3d ]; then echo -n " pop3d" ${sbindir}/pop3d start fi ;; esac fi POP3DSSLSTART="" if [ -f ${sysconfdir}/pop3d-ssl ]; then . ${sysconfdir}/pop3d-ssl case "$POP3DSSLSTART" in [Yy]*) # If we do not have a certificate, make one up. if [ -x "$COURIERTLS" ]; then - if [ ! -f ${sysconfdir}/pop3d.pem \ + if [ ! -f ${certsdir}/pop3d.pem \ -a -x ${sbindir}/mkpop3dcert ]; then echo -n " generating-POP3-SSL-certificate..." ${sbindir}/mkpop3dcert >/dev/null 2>&1 + # double usage - DH params need to exist + esmtpdcert=1 fi if [ -x ${sbindir}/pop3d-ssl ]; then echo -n " pop3d-ssl" ${sbindir}/pop3d-ssl start fi fi ;; esac fi + if [ "$esmtpdcert" = 1 ]; then + # If we do not have DH params, make them up. + if [ ! -f ${certsdir}/dhparams.pem \ + -a -x ${sbindir}/mkdhparams ]; then + echo -n " generating-DH-params..." + ${sbindir}/mkdhparams >/dev/null 2>&1 + fi + fi + LISTS="" if [ -f ${sysconfdir}/webmlmrc ]; then . ${sysconfdir}/webmlmrc if [ -n "$LISTS" \ -a -x ${bindir}/webmlmd \ -a -x ${bindir}/webmlmd.rc ]; then echo -n " webmlmd" ${bindir}/webmlmd.rc start ${sysconfdir}/webmlmrc fi fi echo "." } courier_stop() { # kill courier services in the reverse order of starting them echo -n "Stopping" if [ -x ${bindir}/webmlmd \ -a -x ${bindir}/webmlmd.rc ]; then echo -n " webmlmd" ${bindir}/webmlmd.rc stop ${sysconfdir}/webmlmrc fi if [ -x ${sbindir}/pop3d-ssl ]; then echo -n " pop3d-ssl" ${sbindir}/pop3d-ssl stop fi if [ -x ${sbindir}/pop3d ]; then echo -n " pop3d" ${sbindir}/pop3d stop fi if [ -x ${sbindir}/imapd-ssl ]; then echo -n " imapd-ssl" ${sbindir}/imapd-ssl stop fi if [ -x ${sbindir}/imapd ]; then echo -n " imapd" ${sbindir}/imapd stop fi if [ -x ${sbindir}/esmtpd-ssl ]; then echo -n " esmtpd-ssl" ${sbindir}/esmtpd-ssl stop fi if [ -x ${sbindir}/esmtpd-msa ]; then echo -n " esmtpd-msa" ${sbindir}/esmtpd-msa stop fi if [ -x ${sbindir}/esmtpd ]; then echo -n " esmtpd" ${sbindir}/esmtpd stop fi if [ -x ${sbindir}/courier ]; then echo -n " courierd" ${sbindir}/courier stop fi if [ -x ${sbindir}/webmaild ]; then echo -n " webmail" ${sbindir}/webmaild stop fi if [ -x ${sbindir}/courierldapaliasd ]; then echo -n " courierldapaliasd" ${sbindir}/courierldapaliasd stop fi if [ -x ${sbindir}/courierfilter ]; then echo -n " courierfilter" ${sbindir}/courierfilter stop fi echo y | /usr/bin/crontab -u %%CACHEOWN%% -r || true echo "." } load_rc_config $name run_rc_command "$1" diff --git a/mail/courier/files/extra-patch-maildrop__maildir.C b/mail/courier/files/extra-patch-maildrop__maildir.C deleted file mode 100644 index ba1d64c18051..000000000000 --- a/mail/courier/files/extra-patch-maildrop__maildir.C +++ /dev/null @@ -1,33 +0,0 @@ ---- maildrop/maildir.C.orig Thu Jan 15 04:12:13 2004 -+++ maildrop/maildir.C Thu Jul 5 00:09:38 2007 -@@ -137,7 +137,6 @@ - tmpname=createInfo.tmpname; - newname=createInfo.newname; - tmpname += '\0'; -- newname += '\0'; - maildir_tmpcreate_free(&createInfo); - - file.fd(f); -@@ -181,6 +180,22 @@ - { - if (is_open) - { -+ Buffer b; -+ -+ b="MFLAGS"; -+ -+ const char *f=GetVarStr(b); -+ -+ if (f && strlen(f) > 0) -+ { -+ newname += ':'; -+ newname += '2'; -+ newname += ','; -+ newname += f; -+ } -+ -+ newname += '\0'; -+ - Buffer keywords; - - keywords="KEYWORDS"; diff --git a/mail/courier/files/extra-patch-webmail__folder.c b/mail/courier/files/extra-patch-webmail__folder.c index d1a6139cbcd3..d62fbc5703e3 100644 --- a/mail/courier/files/extra-patch-webmail__folder.c +++ b/mail/courier/files/extra-patch-webmail__folder.c @@ -1,102 +1,102 @@ ---- webmail/folder.c.orig 2008-07-20 19:00:33.000000000 +0200 -+++ webmail/folder.c 2009-06-04 08:32:54.000000000 +0200 -@@ -247,6 +247,18 @@ - return (maildir_msgmovefile(folder, file, cgi("moveto"), pos)); +--- libs/sqwebmail/folder.c.orig 2008-07-20 19:00:33.000000000 +0200 ++++ libs/sqwebmail/folder.c 2009-06-04 08:32:54.000000000 +0200 +@@ -331,6 +331,18 @@ + return rc ? "quota":""; } +static int groupmark(const char *folder, const char *file, size_t pos) +{ + maildir_msgmarkfile(folder, file, pos); + return (0); +} + +static int groupunmark(const char *folder, const char *file, size_t pos) +{ + maildir_msgunmarkfile(folder, file, pos); + return (0); +} + void folder_delmsgs(const char *dir, size_t pos) { - int rc=0; -@@ -317,6 +329,16 @@ - rc=group_movedel( dir, &groupmove ); - maildir_savefoldermsgs(dir); + const char *status=do_folder_delmsgs(dir, pos); +@@ -392,6 +404,16 @@ + } + fclose(fp); } + else if (*cgi("cmdmark")) + { + rc=group_movedel( dir, &groupmark ); + maildir_savefoldermsgs(dir); + } + else if (*cgi("cmdunmark")) + { + rc=group_movedel( dir, &groupunmark ); + maildir_savefoldermsgs(dir); + } - maildir_cleanup(); - -@@ -441,7 +463,7 @@ - - folder_navigate(dir, pos, highend, morebefore, moreafter); + fprintf(ofp, "%s\n%s\n", maildir, path); + fclose(ofp); +@@ -510,7 +532,7 @@ + folder_navigate(dir, pos, highend, morebefore, moreafter, + last_message_searched_ptr); - printf("\n", + printf("
%s %s%s%s%s
\n", getarg("NUM"), getarg("DATE"), (strncmp(dir, INBOX "." SENT, sizeof(INBOX)+sizeof(SENT)-1) && -@@ -486,12 +508,13 @@ - if ((q=strrchr(p, '/')) != 0) - p=q+1; - -- printf(""); - puts(""); - puts(""); + puts(""); + puts("
%s   %s%s%s%s
%s%ld.%s%s%ld.%s%s!" : "", - (long) (pos+i), - (long) (pos+i)); - printf("\" onchange=\"setsel('MOVE-%ld', 'row%d', 'folder-index-bg-%d');\"%s /> %s%s%s%s", -+ printf("\" />%s%s%s%s", - folder_index_entry_start, - type, - folder_index_entry_end, -@@ -545,9 +568,9 @@ +@@ -531,9 +553,9 @@ if (found) { - puts("

 "); + puts("

 "); puts("