Skip to content

Commit 9fda8b4

Browse files
committed
bincimap: new upstream, update to 2.0.15. Changes:
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.
1 parent 6b6cdd3 commit 9fda8b4

14 files changed

+118
-242
lines changed

mail/bincimap/DESCR

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Binc IMAP is an IMAP4rev1 server for Maildir. It strives to be stable,
2-
fast, flexible, and RFC compliant. Like qmail-pop3d, it authenticates
3-
via a checkpassword program.
2+
fast, flexible, and RFC compliant. Like qmail-pop3d, it relies on UCSPI
3+
for networking and checkpassword for authentication.

mail/bincimap/Makefile

Lines changed: 48 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,74 @@
1-
# $NetBSD: Makefile,v 1.2 2023/10/24 22:09:41 wiz Exp $
1+
# $NetBSD: Makefile,v 1.3 2024/02/28 04:14:16 schmonz Exp $
22

3-
DISTNAME= bincimap-1.2.13final
4-
PKGNAME= ${DISTNAME:S/final$//}
5-
PKGREVISION= 1
3+
DISTNAME= bincimap-2.0.15
64
CATEGORIES= mail
7-
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=bincimap/}
5+
MASTER_SITES= https://www.fehcom.de/binc/
6+
EXTRACT_SUFX= .tgz
87

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

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

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

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

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

27-
SUBST_CLASSES+= nobody
28-
SUBST_STAGE.nobody= pre-configure
29-
SUBST_FILES.nobody= conf/bincimap.conf.in
30-
SUBST_VARS.nobody= BINCIMAP_USER BINCIMAP_GROUP
31-
32-
PKG_USERS_VARS+= BINCIMAP_USER
28+
PKG_USERS_VARS+= BINCIMAP_USER BINCIMAP_LOG_USER
3329
PKG_GROUPS_VARS+= BINCIMAP_GROUP
3430
PKG_GROUPS+= ${BINCIMAP_GROUP}
3531
PKG_USERS+= ${BINCIMAP_USER}:${BINCIMAP_GROUP}
32+
PKG_USERS+= ${BINCIMAP_LOG_USER}:${BINCIMAP_GROUP}
3633

3734
EGDIR= share/examples/${PKGBASE}
38-
CONF_FILES+= ${PREFIX}/${EGDIR}/${PKGBASE}.conf \
39-
${PKG_SYSCONFDIR}/${PKGBASE}.conf
35+
36+
FILES_SUBST+= BINCIMAP_GROUP=${BINCIMAP_GROUP:Q}
37+
FILES_SUBST+= BINCIMAP_LOG_USER=${BINCIMAP_LOG_USER:Q}
38+
FILES_SUBST+= BINCIMAP_USER=${BINCIMAP_USER:Q}
39+
USE_TOOLS+= openssl:run
40+
FILES_SUBST+= OPENSSL=${OPENSSL}
41+
.include "../../security/openssl/builtin.mk"
42+
FILES_SUBST+= SSLDIR=${SSLDIR}
43+
FILES_SUBST+= UCSPI_SSL_USER=${UCSPI_SSL_USER:Q}
44+
FILES_SUBST+= UCSPI_SSL_GROUP=${UCSPI_SSL_GROUP:Q}
4045
RCD_SCRIPTS= bincimapd
4146

42-
INSTALLATION_DIRS= bin ${PKGMANDIR}/man1 ${PKGMANDIR}/man5
47+
INSTALLATION_DIRS= bin ${PKGMANDIR}/man1 ${PKGMANDIR}/man5 ${PKGMANDIR}/man7
4348
INSTALLATION_DIRS+= ${EGDIR}
4449

50+
BUILD_DEFS+= BINCIMAP_LOG_USER UCSPI_SSL_USER UCSPI_SSL_GROUP
51+
BUILD_DEFS+= QMAILDIR SSLDIR
52+
53+
post-build:
54+
cd ${WRKSRC}/man; for f in *.9; do \
55+
${MAKE} $$(${BASENAME} $${f} .9).1; \
56+
done
57+
58+
do-install:
59+
for f in ${WRKSRC}/command/*; do \
60+
${INSTALL_PROGRAM} $${f} ${DESTDIR}${PREFIX}/bin; \
61+
done
62+
for f in ${WRKSRC}/scripts/*.pl; do \
63+
${INSTALL_SCRIPT} $${f} \
64+
${DESTDIR}${PREFIX}/${EGDIR}/$$(${BASENAME} $${f} .pl); \
65+
done
66+
for f in ${WRKSRC}/man/*.[1-8]; do \
67+
${INSTALL_MAN} $${f} \
68+
${DESTDIR}${PREFIX}/${PKGMANDIR}/man$$(${ECHO} $${f} | ${AWK} -F. '{print $$NF}'); \
69+
done
70+
4571
.include "options.mk"
4672

73+
.include "../../mk/djbware.mk"
4774
.include "../../mk/bsd.pkg.mk"

mail/bincimap/PLIST

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
@comment $NetBSD: PLIST,v 1.1 2021/01/15 19:50:25 schmonz Exp $
1+
@comment $NetBSD: PLIST,v 1.2 2024/02/28 04:14:16 schmonz Exp $
22
bin/bincimap-up
3+
bin/bincimap-updatecache
34
bin/bincimapd
45
man/man1/bincimap-up.1
6+
man/man1/bincimap.1
57
man/man1/bincimapd.1
6-
man/man5/bincimap.conf.5
7-
share/doc/bincimap/README
8-
share/doc/bincimap/bincimap-faq.html
9-
share/doc/bincimap/bincimap-goals.html
10-
share/doc/bincimap/bincimap-imapdir.html
11-
share/doc/bincimap/bincimap-manual.ps
12-
share/doc/bincimap/bincimap-tech.html
13-
share/doc/bincimap/bincimap.css
14-
share/examples/bincimap/bincimap.conf
15-
share/examples/bincimap/checkpassword.pl
8+
man/man7/bincimap-updatecache.7
9+
share/examples/bincimap/IMAPdir2Maildir++
10+
share/examples/bincimap/Maildir++2IMAPdir
11+
share/examples/bincimap/checkpassword
1612
share/examples/bincimap/toimapdir
1713
share/examples/bincimap/tomaildir++
14+
@pkgdir man/man5

mail/bincimap/distinfo

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
1-
$NetBSD: distinfo,v 1.4 2021/10/26 10:53:55 nia Exp $
1+
$NetBSD: distinfo,v 1.5 2024/02/28 04:14:16 schmonz Exp $
22

3-
BLAKE2s (bincimap-1.2.13final.tar.gz) = e8524101f1bdf230cc2b1262343f087c1ffa2f5f6075ca1339170a491c081a65
4-
SHA512 (bincimap-1.2.13final.tar.gz) = 53c4df3b46a433fae5dd441f1613dd1a0f73de43c25a56e1aa210f45b9d0b0201a0fdeb050f0b37646ce3b571d835b06cd6b1a566078aab8a61f352fc718e584
5-
Size (bincimap-1.2.13final.tar.gz) = 511059 bytes
6-
SHA1 (patch-Makefile.in) = ddcf628576a3c62c4eecda48899a5820fed912c5
7-
SHA1 (patch-conf_Makefile.in) = 8a979b150aff3c08a9be255be893cbe28094f7f7
8-
SHA1 (patch-conf_bincimap.conf.in) = d1083ebf2b12704545de8797d07c02c309f1ddfa
9-
SHA1 (patch-doc_manual_Makefile.in) = 713308a43bfdfc408de368692ae50b159a7db298
10-
SHA1 (patch-man_bincimap-up.1) = e052a7575754a6df7904d61718ad433d2d00eb0f
11-
SHA1 (patch-src_convert.h) = 5425eefd9511746639c5ec9d428bb3dd2356402f
12-
SHA1 (patch-src_greeting.cc) = 99466bd65eadf734dbe84800639cdc25a2f1eaa7
13-
SHA1 (patch-src_tools.cc) = ead7735ee234b2324c59d55bd4a7ca20a306971f
3+
BLAKE2s (bincimap-2.0.15.tgz) = 885216804bcacee41cf345df3928a5e73f8400c2c00dc90b8d9d5a7897ba80fd
4+
SHA512 (bincimap-2.0.15.tgz) = 6b6dec279d4c5d835b7468542004e754cef58238c3f80bf89715a4f7cfb00dc1450d0c1c8ae78286a7e8eb6eaac0215944e0a8fdbe637f17f24a5de9af80bdde
5+
Size (bincimap-2.0.15.tgz) = 153600 bytes

mail/bincimap/files/bincimapd.sh

Lines changed: 54 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,92 @@
11
#!@RCD_SCRIPTS_SHELL@
22
#
3-
# $NetBSD: bincimapd.sh,v 1.1 2021/01/15 19:50:25 schmonz Exp $
3+
# $NetBSD: bincimapd.sh,v 1.2 2024/02/28 04:14:16 schmonz Exp $
44
#
55

66
# PROVIDE: bincimapd mail
77

88
name="bincimapd"
99

1010
# User-settable rc.conf variables and their default values:
11-
: ${bincimapd_postenv:=""}
11+
: ${bincimapd_postenv:="VERBOSE_GREETING=yes"}
1212
: ${bincimapd_datalimit:="180000000"}
1313
: ${bincimapd_pretcpserver:=""}
14-
: ${bincimapd_tcpserver:="@PREFIX@/bin/tcpserver"}
15-
: ${bincimapd_tcpflags:="-R -H"}
14+
: ${bincimapd_tcpserver:="@PREFIX@/bin/sslserver"}
15+
: ${bincimapd_tcpflags:="-ne -vRl0"}
1616
: ${bincimapd_tcphost:=":0"}
17-
: ${bincimapd_tcpport:="143"}
18-
: ${bincimapd_precheckpassword:="@PREFIX@/bin/bincimap-up --conf=@PKG_SYSCONFDIR@/bincimap.conf --"}
17+
: ${bincimapd_tcpport:="993"}
18+
: ${bincimapd_precheckpassword:="@PREFIX@/bin/bincimap-up --"}
1919
: ${bincimapd_checkpassword:="@PREFIX@/bin/nbcheckpassword"}
2020
: ${bincimapd_preimapd:="@PREFIX@/bin/checknotroot"}
2121
: ${bincimapd_imapdcmd:="@PREFIX@/bin/bincimapd"}
22-
: ${bincimapd_postimapd:=""}
22+
: ${bincimapd_postimapd:="Maildir"}
23+
: ${bincimapd_log:="YES"}
24+
: ${bincimapd_logcmd:="logger -t bincimap -p mail.info"}
25+
: ${bincimapd_nologcmd:="@PREFIX@/bin/multilog -*"}
26+
: ${bincimapd_tls:="YES"}
27+
: ${bincimapd_tls_dhparams:="@PKG_SYSCONFDIR@/certs/dh2048.pem"}
28+
: ${bincimapd_tls_cert:="@PKG_SYSCONFDIR@/certs/servercert.pem"}
29+
: ${bincimapd_tls_key:="@PKG_SYSCONFDIR@/certs/serverkey.pem"}
2330

2431
if [ -f /etc/rc.subr ]; then
2532
. /etc/rc.subr
2633
fi
2734

2835
rcvar=${name}
29-
required_files="@PKG_SYSCONFDIR@/bincimap.conf"
3036
command="${bincimapd_tcpserver}"
3137
procname=nb${name}
3238
start_precmd="bincimapd_precmd"
3339

40+
bincimapd_configure_tls() {
41+
if [ "auto" = "${bincimapd_tls}" ]; then
42+
if [ -f "${bincimapd_tls_cert}" ]; then
43+
bincimapd_enable_tls
44+
else
45+
bincimapd_disable_tls
46+
fi
47+
elif [ -f /etc/rc.subr ] && checkyesno bincimapd_tls; then
48+
bincimapd_enable_tls
49+
else
50+
bincimapd_disable_tls
51+
fi
52+
}
53+
54+
bincimapd_disable_tls() {
55+
bincimapd_postenv="ALLOW_NONSSL_PLAINTEXT_LOGINS=yes ${bincimapd_postenv}"
56+
}
57+
58+
bincimapd_enable_tls() {
59+
bincimapd_postenv="CADIR=@SSLDIR@/certs ${bincimapd_postenv}"
60+
bincimapd_postenv="SSL_UID=$(@ID@ -u @UCSPI_SSL_USER@) ${bincimapd_postenv}"
61+
bincimapd_postenv="SSL_GID=$(@ID@ -g @UCSPI_SSL_GROUP@) ${bincimapd_postenv}"
62+
bincimapd_postenv="DHFILE=${bincimapd_tls_dhparams} ${bincimapd_postenv}"
63+
bincimapd_postenv="CERTFILE=${bincimapd_tls_cert} ${bincimapd_postenv}"
64+
if [ -n "${bincimapd_tls_key}" -a ! -f "${bincimapd_tls_key}" ]; then
65+
@OPENSSL@ rsa -in ${bincimapd_tls_cert} -out ${bincimapd_tls_key}
66+
@CHMOD@ 640 ${bincimapd_tls_key}
67+
fi
68+
bincimapd_postenv="KEYFILE=${bincimapd_tls_key} ${bincimapd_postenv}"
69+
}
70+
71+
3472
bincimapd_precmd() {
73+
if [ -f /etc/rc.subr ] && ! checkyesno bincimapd_log; then
74+
bincimapd_logcmd=${bincimapd_nologcmd}
75+
fi
76+
bincimapd_configure_tls
3577
# tcpserver(1) is akin to inetd(8), but runs one service per process.
3678
# We want to signal only the tcpserver process responsible for this
3779
# service. Use argv0(1) to set procname to "nbbincimapd".
3880
command="@PREFIX@/bin/pgrphack @SETENV@ - ${bincimapd_postenv} \
3981
@PREFIX@/bin/softlimit -m ${bincimapd_datalimit} ${bincimapd_pretcpserver} \
4082
@PREFIX@/bin/argv0 ${bincimapd_tcpserver} ${procname} \
4183
${bincimapd_tcpflags} \
84+
-u @BINCIMAP_USER@ -g @BINCIMAP_GROUP@ \
4285
${bincimapd_tcphost} ${bincimapd_tcpport} \
4386
${bincimapd_precheckpassword} ${bincimapd_checkpassword} \
44-
${bincimapd_preimapd} ${bincimapd_imapdcmd} ${bincimapd_postimapd}"
87+
${bincimapd_preimapd} ${bincimapd_imapdcmd} ${bincimapd_postimapd} \
88+
2>&1 | \
89+
@PREFIX@/bin/pgrphack @PREFIX@/bin/setuidgid @BINCIMAP_LOG_USER@ ${bincimapd_logcmd}"
4590
command_args="&"
4691
rc_flags=""
4792
}

mail/bincimap/options.mk

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,12 @@
1-
# $NetBSD: options.mk,v 1.1 2021/01/15 19:50:25 schmonz Exp $
1+
# $NetBSD: options.mk,v 1.2 2024/02/28 04:14:16 schmonz Exp $
22

33
PKG_OPTIONS_VAR= PKG_OPTIONS.bincimap
4-
PKG_SUPPORTED_OPTIONS+= inet6 pam tls
5-
PKG_SUGGESTED_OPTIONS+= inet6 tls
4+
PKG_SUPPORTED_OPTIONS+= pam
65

76
.include "../../mk/bsd.options.mk"
87

9-
.if !empty(PKG_OPTIONS:Minet6)
10-
DEPENDS+= ucspi-tcp6>=1.10.7nb1:../../net/ucspi-tcp6
11-
.else
12-
DEPENDS+= {ucspi-tcp6>=1.10.7nb1,ucspi-tcp-[0-9]*}:../../net/ucspi-tcp
13-
.endif
14-
158
.if !empty(PKG_OPTIONS:Mpam)
169
DEPENDS+= checkpassword-pam>=0.99nb1:../../sysutils/checkpassword-pam
1710
.else
1811
DEPENDS+= checkpassword>=0.90nb1:../../sysutils/checkpassword
1912
.endif
20-
21-
.if !empty(PKG_OPTIONS:Mtls)
22-
. include "../../security/openssl/buildlink3.mk"
23-
SUBST_CLASSES+= paths
24-
SUBST_STAGE.paths= pre-configure
25-
SUBST_FILES.paths= src/io-ssl.cc doc/bincimap-faq.html \
26-
doc/manual/bincimap-manual.ps conf/bincimap.conf.in
27-
SUBST_SED.paths= -e 's|/usr/share/ssl/certs|${SSLDIR}/certs|g'
28-
.else
29-
CONFIGURE_ARGS+= --without-ssl
30-
.endif

mail/bincimap/patches/patch-Makefile.in

Lines changed: 0 additions & 15 deletions
This file was deleted.

mail/bincimap/patches/patch-conf_Makefile.in

Lines changed: 0 additions & 17 deletions
This file was deleted.

mail/bincimap/patches/patch-conf_bincimap.conf.in

Lines changed: 0 additions & 43 deletions
This file was deleted.

mail/bincimap/patches/patch-doc_manual_Makefile.in

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)