Skip to content

Commit

Permalink
bincimap: new upstream, update to 2.0.15. Changes:
Browse files Browse the repository at this point in the history
2.0.15  Included logging for Operator LOGIN and display of the real auth
        user rather than the virtual user in the logs. Streamlined log
        output to be close to s/qmail's.
2.0.14  Removed gethostbyname and replaced by environment variable
        'TCPLOCALHOST'. Changed default logtype to 'multilog'.
2.0.13  Logging is working now for each session at logout/disconnect/timeout.
2.0.12  CRAM-MD5 Auth should work now (given the backend allows this).
        Modularized auth operator for potential new methods.
        Improved man pages to reflect current capabilities.
2.0.11  BincInfo renamed to BincLog, added s/qmail like tags for logging.
        Added a LICENSE file (under ./doc).
        StartTLS working now after reordering reply command sequence.
2.0.10  Added CRAM-MD5 authentication. 'logged in' log includes now remote IP.
2.0.9   Added doc + man pages and finished slashpackage installation.
2.0.8   Final cleaning and integration tests.
2.0.7   Moved StartTLS support into operator-starttls.cc.
2.0.6   Added StartTLS into sesssion-initialisation-bincimap-up.cc.
2.0.5   Added operator-id.cc (RFC 2971) since Evolution requires this.
2.0.4   Removed JAIL option -> sslserver can do that as well. Trimmed log
        output.
2.0.3   Trimming of *.cc and *.h files. Removed StartTLS driver.
2.0.2   Integration tests successful for TLS and with new qmail-authuser.
2.0.1   Makefile working. First minor fixes. Initial working version.
2.0.0   Initial restart of Bincimap 1.3.4 without Autoconf tools.
  • Loading branch information
schmonz committed Feb 28, 2024
1 parent 6b6cdd3 commit 9fda8b4
Show file tree
Hide file tree
Showing 14 changed files with 118 additions and 242 deletions.
4 changes: 2 additions & 2 deletions mail/bincimap/DESCR
@@ -1,3 +1,3 @@
Binc IMAP is an IMAP4rev1 server for Maildir. It strives to be stable,
fast, flexible, and RFC compliant. Like qmail-pop3d, it authenticates
via a checkpassword program.
fast, flexible, and RFC compliant. Like qmail-pop3d, it relies on UCSPI
for networking and checkpassword for authentication.
69 changes: 48 additions & 21 deletions mail/bincimap/Makefile
@@ -1,47 +1,74 @@
# $NetBSD: Makefile,v 1.2 2023/10/24 22:09:41 wiz Exp $
# $NetBSD: Makefile,v 1.3 2024/02/28 04:14:16 schmonz Exp $

DISTNAME= bincimap-1.2.13final
PKGNAME= ${DISTNAME:S/final$//}
PKGREVISION= 1
DISTNAME= bincimap-2.0.15
CATEGORIES= mail
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=bincimap/}
MASTER_SITES= https://www.fehcom.de/binc/
EXTRACT_SUFX= .tgz

MAINTAINER= schmonz@NetBSD.org
HOMEPAGE= https://sourceforge.net/projects/bincimap/
HOMEPAGE= https://www.fehcom.de/binc/binc.html
COMMENT= IMAP server for Maildir using checkpassword
LICENSE= gnu-gpl-v2

DEPENDS+= daemontools-[0-9]*:../../sysutils/daemontools
DEPENDS+= pkg_alternatives-[0-9]*:../../pkgtools/pkg_alternatives
DEPENDS+= qmail-acceptutils-[0-9]*:../../mail/qmail-acceptutils
DEPENDS+= ucspi-ssl-[0-9]*:../../net/ucspi-ssl

USE_LANGUAGES= c c++
WRKSRC= ${WRKDIR}/mail/bincimap/${DISTNAME}

GNU_CONFIGURE= yes
CONFIGURE_ARGS+= --libexecdir=${PREFIX:Q}/${EGDIR:Q}
CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR:Q}
INSTALL_MAKE_FLAGS= sysconfdir=${PREFIX:Q}/${EGDIR:Q}
USE_LANGUAGES= c++
USE_TOOLS+= mandoc
REPLACE_PERL= scripts/*.pl
PKG_SYSCONFSUBDIR= ${PKGBASE}

REPLACE_PERL= conf/checkpassword.pl conf/toimapdir conf/tomaildir++
DJB_SLASHPACKAGE= YES
DJB_CONFIG_DIR= ${WRKSRC}

SUBST_CLASSES+= nobody
SUBST_STAGE.nobody= pre-configure
SUBST_FILES.nobody= conf/bincimap.conf.in
SUBST_VARS.nobody= BINCIMAP_USER BINCIMAP_GROUP

PKG_USERS_VARS+= BINCIMAP_USER
PKG_USERS_VARS+= BINCIMAP_USER BINCIMAP_LOG_USER
PKG_GROUPS_VARS+= BINCIMAP_GROUP
PKG_GROUPS+= ${BINCIMAP_GROUP}
PKG_USERS+= ${BINCIMAP_USER}:${BINCIMAP_GROUP}
PKG_USERS+= ${BINCIMAP_LOG_USER}:${BINCIMAP_GROUP}

EGDIR= share/examples/${PKGBASE}
CONF_FILES+= ${PREFIX}/${EGDIR}/${PKGBASE}.conf \
${PKG_SYSCONFDIR}/${PKGBASE}.conf

FILES_SUBST+= BINCIMAP_GROUP=${BINCIMAP_GROUP:Q}
FILES_SUBST+= BINCIMAP_LOG_USER=${BINCIMAP_LOG_USER:Q}
FILES_SUBST+= BINCIMAP_USER=${BINCIMAP_USER:Q}
USE_TOOLS+= openssl:run
FILES_SUBST+= OPENSSL=${OPENSSL}
.include "../../security/openssl/builtin.mk"
FILES_SUBST+= SSLDIR=${SSLDIR}
FILES_SUBST+= UCSPI_SSL_USER=${UCSPI_SSL_USER:Q}
FILES_SUBST+= UCSPI_SSL_GROUP=${UCSPI_SSL_GROUP:Q}
RCD_SCRIPTS= bincimapd

INSTALLATION_DIRS= bin ${PKGMANDIR}/man1 ${PKGMANDIR}/man5
INSTALLATION_DIRS= bin ${PKGMANDIR}/man1 ${PKGMANDIR}/man5 ${PKGMANDIR}/man7
INSTALLATION_DIRS+= ${EGDIR}

BUILD_DEFS+= BINCIMAP_LOG_USER UCSPI_SSL_USER UCSPI_SSL_GROUP
BUILD_DEFS+= QMAILDIR SSLDIR

post-build:
cd ${WRKSRC}/man; for f in *.9; do \
${MAKE} $$(${BASENAME} $${f} .9).1; \
done

do-install:
for f in ${WRKSRC}/command/*; do \
${INSTALL_PROGRAM} $${f} ${DESTDIR}${PREFIX}/bin; \
done
for f in ${WRKSRC}/scripts/*.pl; do \
${INSTALL_SCRIPT} $${f} \
${DESTDIR}${PREFIX}/${EGDIR}/$$(${BASENAME} $${f} .pl); \
done
for f in ${WRKSRC}/man/*.[1-8]; do \
${INSTALL_MAN} $${f} \
${DESTDIR}${PREFIX}/${PKGMANDIR}/man$$(${ECHO} $${f} | ${AWK} -F. '{print $$NF}'); \
done

.include "options.mk"

.include "../../mk/djbware.mk"
.include "../../mk/bsd.pkg.mk"
19 changes: 8 additions & 11 deletions mail/bincimap/PLIST
@@ -1,17 +1,14 @@
@comment $NetBSD: PLIST,v 1.1 2021/01/15 19:50:25 schmonz Exp $
@comment $NetBSD: PLIST,v 1.2 2024/02/28 04:14:16 schmonz Exp $
bin/bincimap-up
bin/bincimap-updatecache
bin/bincimapd
man/man1/bincimap-up.1
man/man1/bincimap.1
man/man1/bincimapd.1
man/man5/bincimap.conf.5
share/doc/bincimap/README
share/doc/bincimap/bincimap-faq.html
share/doc/bincimap/bincimap-goals.html
share/doc/bincimap/bincimap-imapdir.html
share/doc/bincimap/bincimap-manual.ps
share/doc/bincimap/bincimap-tech.html
share/doc/bincimap/bincimap.css
share/examples/bincimap/bincimap.conf
share/examples/bincimap/checkpassword.pl
man/man7/bincimap-updatecache.7
share/examples/bincimap/IMAPdir2Maildir++
share/examples/bincimap/Maildir++2IMAPdir
share/examples/bincimap/checkpassword
share/examples/bincimap/toimapdir
share/examples/bincimap/tomaildir++
@pkgdir man/man5
16 changes: 4 additions & 12 deletions mail/bincimap/distinfo
@@ -1,13 +1,5 @@
$NetBSD: distinfo,v 1.4 2021/10/26 10:53:55 nia Exp $
$NetBSD: distinfo,v 1.5 2024/02/28 04:14:16 schmonz Exp $

BLAKE2s (bincimap-1.2.13final.tar.gz) = e8524101f1bdf230cc2b1262343f087c1ffa2f5f6075ca1339170a491c081a65
SHA512 (bincimap-1.2.13final.tar.gz) = 53c4df3b46a433fae5dd441f1613dd1a0f73de43c25a56e1aa210f45b9d0b0201a0fdeb050f0b37646ce3b571d835b06cd6b1a566078aab8a61f352fc718e584
Size (bincimap-1.2.13final.tar.gz) = 511059 bytes
SHA1 (patch-Makefile.in) = ddcf628576a3c62c4eecda48899a5820fed912c5
SHA1 (patch-conf_Makefile.in) = 8a979b150aff3c08a9be255be893cbe28094f7f7
SHA1 (patch-conf_bincimap.conf.in) = d1083ebf2b12704545de8797d07c02c309f1ddfa
SHA1 (patch-doc_manual_Makefile.in) = 713308a43bfdfc408de368692ae50b159a7db298
SHA1 (patch-man_bincimap-up.1) = e052a7575754a6df7904d61718ad433d2d00eb0f
SHA1 (patch-src_convert.h) = 5425eefd9511746639c5ec9d428bb3dd2356402f
SHA1 (patch-src_greeting.cc) = 99466bd65eadf734dbe84800639cdc25a2f1eaa7
SHA1 (patch-src_tools.cc) = ead7735ee234b2324c59d55bd4a7ca20a306971f
BLAKE2s (bincimap-2.0.15.tgz) = 885216804bcacee41cf345df3928a5e73f8400c2c00dc90b8d9d5a7897ba80fd
SHA512 (bincimap-2.0.15.tgz) = 6b6dec279d4c5d835b7468542004e754cef58238c3f80bf89715a4f7cfb00dc1450d0c1c8ae78286a7e8eb6eaac0215944e0a8fdbe637f17f24a5de9af80bdde
Size (bincimap-2.0.15.tgz) = 153600 bytes
63 changes: 54 additions & 9 deletions mail/bincimap/files/bincimapd.sh
@@ -1,47 +1,92 @@
#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: bincimapd.sh,v 1.1 2021/01/15 19:50:25 schmonz Exp $
# $NetBSD: bincimapd.sh,v 1.2 2024/02/28 04:14:16 schmonz Exp $
#

# PROVIDE: bincimapd mail

name="bincimapd"

# User-settable rc.conf variables and their default values:
: ${bincimapd_postenv:=""}
: ${bincimapd_postenv:="VERBOSE_GREETING=yes"}
: ${bincimapd_datalimit:="180000000"}
: ${bincimapd_pretcpserver:=""}
: ${bincimapd_tcpserver:="@PREFIX@/bin/tcpserver"}
: ${bincimapd_tcpflags:="-R -H"}
: ${bincimapd_tcpserver:="@PREFIX@/bin/sslserver"}
: ${bincimapd_tcpflags:="-ne -vRl0"}
: ${bincimapd_tcphost:=":0"}
: ${bincimapd_tcpport:="143"}
: ${bincimapd_precheckpassword:="@PREFIX@/bin/bincimap-up --conf=@PKG_SYSCONFDIR@/bincimap.conf --"}
: ${bincimapd_tcpport:="993"}
: ${bincimapd_precheckpassword:="@PREFIX@/bin/bincimap-up --"}
: ${bincimapd_checkpassword:="@PREFIX@/bin/nbcheckpassword"}
: ${bincimapd_preimapd:="@PREFIX@/bin/checknotroot"}
: ${bincimapd_imapdcmd:="@PREFIX@/bin/bincimapd"}
: ${bincimapd_postimapd:=""}
: ${bincimapd_postimapd:="Maildir"}
: ${bincimapd_log:="YES"}
: ${bincimapd_logcmd:="logger -t bincimap -p mail.info"}
: ${bincimapd_nologcmd:="@PREFIX@/bin/multilog -*"}
: ${bincimapd_tls:="YES"}
: ${bincimapd_tls_dhparams:="@PKG_SYSCONFDIR@/certs/dh2048.pem"}
: ${bincimapd_tls_cert:="@PKG_SYSCONFDIR@/certs/servercert.pem"}
: ${bincimapd_tls_key:="@PKG_SYSCONFDIR@/certs/serverkey.pem"}

if [ -f /etc/rc.subr ]; then
. /etc/rc.subr
fi

rcvar=${name}
required_files="@PKG_SYSCONFDIR@/bincimap.conf"
command="${bincimapd_tcpserver}"
procname=nb${name}
start_precmd="bincimapd_precmd"

bincimapd_configure_tls() {
if [ "auto" = "${bincimapd_tls}" ]; then
if [ -f "${bincimapd_tls_cert}" ]; then
bincimapd_enable_tls
else
bincimapd_disable_tls
fi
elif [ -f /etc/rc.subr ] && checkyesno bincimapd_tls; then
bincimapd_enable_tls
else
bincimapd_disable_tls
fi
}

bincimapd_disable_tls() {
bincimapd_postenv="ALLOW_NONSSL_PLAINTEXT_LOGINS=yes ${bincimapd_postenv}"
}

bincimapd_enable_tls() {
bincimapd_postenv="CADIR=@SSLDIR@/certs ${bincimapd_postenv}"
bincimapd_postenv="SSL_UID=$(@ID@ -u @UCSPI_SSL_USER@) ${bincimapd_postenv}"
bincimapd_postenv="SSL_GID=$(@ID@ -g @UCSPI_SSL_GROUP@) ${bincimapd_postenv}"
bincimapd_postenv="DHFILE=${bincimapd_tls_dhparams} ${bincimapd_postenv}"
bincimapd_postenv="CERTFILE=${bincimapd_tls_cert} ${bincimapd_postenv}"
if [ -n "${bincimapd_tls_key}" -a ! -f "${bincimapd_tls_key}" ]; then
@OPENSSL@ rsa -in ${bincimapd_tls_cert} -out ${bincimapd_tls_key}
@CHMOD@ 640 ${bincimapd_tls_key}
fi
bincimapd_postenv="KEYFILE=${bincimapd_tls_key} ${bincimapd_postenv}"
}


bincimapd_precmd() {
if [ -f /etc/rc.subr ] && ! checkyesno bincimapd_log; then
bincimapd_logcmd=${bincimapd_nologcmd}
fi
bincimapd_configure_tls
# tcpserver(1) is akin to inetd(8), but runs one service per process.
# We want to signal only the tcpserver process responsible for this
# service. Use argv0(1) to set procname to "nbbincimapd".
command="@PREFIX@/bin/pgrphack @SETENV@ - ${bincimapd_postenv} \
@PREFIX@/bin/softlimit -m ${bincimapd_datalimit} ${bincimapd_pretcpserver} \
@PREFIX@/bin/argv0 ${bincimapd_tcpserver} ${procname} \
${bincimapd_tcpflags} \
-u @BINCIMAP_USER@ -g @BINCIMAP_GROUP@ \
${bincimapd_tcphost} ${bincimapd_tcpport} \
${bincimapd_precheckpassword} ${bincimapd_checkpassword} \
${bincimapd_preimapd} ${bincimapd_imapdcmd} ${bincimapd_postimapd}"
${bincimapd_preimapd} ${bincimapd_imapdcmd} ${bincimapd_postimapd} \
2>&1 | \
@PREFIX@/bin/pgrphack @PREFIX@/bin/setuidgid @BINCIMAP_LOG_USER@ ${bincimapd_logcmd}"
command_args="&"
rc_flags=""
}
Expand Down
22 changes: 2 additions & 20 deletions mail/bincimap/options.mk
@@ -1,30 +1,12 @@
# $NetBSD: options.mk,v 1.1 2021/01/15 19:50:25 schmonz Exp $
# $NetBSD: options.mk,v 1.2 2024/02/28 04:14:16 schmonz Exp $

PKG_OPTIONS_VAR= PKG_OPTIONS.bincimap
PKG_SUPPORTED_OPTIONS+= inet6 pam tls
PKG_SUGGESTED_OPTIONS+= inet6 tls
PKG_SUPPORTED_OPTIONS+= pam

.include "../../mk/bsd.options.mk"

.if !empty(PKG_OPTIONS:Minet6)
DEPENDS+= ucspi-tcp6>=1.10.7nb1:../../net/ucspi-tcp6
.else
DEPENDS+= {ucspi-tcp6>=1.10.7nb1,ucspi-tcp-[0-9]*}:../../net/ucspi-tcp
.endif

.if !empty(PKG_OPTIONS:Mpam)
DEPENDS+= checkpassword-pam>=0.99nb1:../../sysutils/checkpassword-pam
.else
DEPENDS+= checkpassword>=0.90nb1:../../sysutils/checkpassword
.endif

.if !empty(PKG_OPTIONS:Mtls)
. include "../../security/openssl/buildlink3.mk"
SUBST_CLASSES+= paths
SUBST_STAGE.paths= pre-configure
SUBST_FILES.paths= src/io-ssl.cc doc/bincimap-faq.html \
doc/manual/bincimap-manual.ps conf/bincimap.conf.in
SUBST_SED.paths= -e 's|/usr/share/ssl/certs|${SSLDIR}/certs|g'
.else
CONFIGURE_ARGS+= --without-ssl
.endif
15 changes: 0 additions & 15 deletions mail/bincimap/patches/patch-Makefile.in

This file was deleted.

17 changes: 0 additions & 17 deletions mail/bincimap/patches/patch-conf_Makefile.in

This file was deleted.

43 changes: 0 additions & 43 deletions mail/bincimap/patches/patch-conf_bincimap.conf.in

This file was deleted.

14 changes: 0 additions & 14 deletions mail/bincimap/patches/patch-doc_manual_Makefile.in

This file was deleted.

15 changes: 0 additions & 15 deletions mail/bincimap/patches/patch-man_bincimap-up.1

This file was deleted.

0 comments on commit 9fda8b4

Please sign in to comment.