Sun Feb 25 12:09:23 2024 UTC (92d)
Add vmailmgr, a virtual domain manager for qmail.

VMailMgr (short for Virtual MAIL ManaGeR) is a package of programs
designed to manage multiple domains of mail addresses and mailboxes on a
single host. It co-operates with qmail for mail delivery and program
control. It features:

- A password checking interface between qmail-popup and qmail-pop3d
  which replaces the usual checkpassword, as well as an authentication
  module for Courier IMAP, that provide access to the virtual mailboxes
  by one of three methods:
  - IP-based virtual server access (invisible to the POP3 user)
  - username-based access (username-virtualuser)
  - hostname-based access (virtualuser@virtual.host or
    virtualuser:virtual.host)
- CDB-based password tables to speed up access for domains of any size.
- Tools to setup a virtual domain, add and delete individual virtual
  users and aliases, and to change passwords.
- A separate delivery agent that automatically deals with any address
  inside a virtual domain from a single .qmail-default file.


(schmonz)
diff -r0 -r1.1 pkgsrc/mail/php-vmailmgr/DESCR
diff -r0 -r1.1 pkgsrc/mail/php-vmailmgr/Makefile
diff -r0 -r1.1 pkgsrc/mail/php-vmailmgr/PLIST
diff -r0 -r1.1 pkgsrc/mail/py-vmailmgr/DESCR
diff -r0 -r1.1 pkgsrc/mail/py-vmailmgr/Makefile
diff -r0 -r1.1 pkgsrc/mail/py-vmailmgr/PLIST
diff -r0 -r1.1 pkgsrc/mail/vmailmgr/DESCR
diff -r0 -r1.1 pkgsrc/mail/vmailmgr/Makefile
diff -r0 -r1.1 pkgsrc/mail/vmailmgr/Makefile.common
diff -r0 -r1.1 pkgsrc/mail/vmailmgr/version.mk
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/DESCR
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/Makefile
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/PLIST
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/distinfo
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/options.mk
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/patches/patch-Makefile.am
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/patches/patch-acinclude.m4
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/patches/patch-authenticate_Makefile.am
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/patches/patch-commands_Makefile.am
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/patches/patch-commands_vadduser.cc
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/patches/patch-commands_vdeliver.cc
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/patches/patch-configure.ac
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/patches/patch-daemon_Makefile.am
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/patches/patch-daemon_main.cc
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/patches/patch-doc_HOWTO.texi
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/patches/patch-doc_Makefile.am
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/patches/patch-lib_cli++_main.cc
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/patches/patch-lib_fdbuf_fdbuf.h
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/patches/patch-lib_mergelib.sh
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/patches/patch-lib_misc_crc32.cc
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/patches/patch-lib_misc_md5-crypt.c
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/patches/patch-lib_misc_md5.c
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/patches/patch-lib_misc_response.h
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/patches/patch-lib_vpwtable_cdb__write.cc
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/patches/patch-lib_vpwtable_gdbm__del.cc
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/patches/patch-lib_vpwtable_gdbm__exists.cc
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/patches/patch-lib_vpwtable_gdbm__getbyname.cc
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/patches/patch-lib_vpwtable_gdbm__put.cc
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/patches/patch-lib_vpwtable_gdbm__write.cc
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-base/patches/patch-python_Makefile.am
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-cgi/DESCR
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-cgi/Makefile
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-cgi/PLIST
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-courier-imap/DESCR
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-courier-imap/Makefile
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-courier-imap/PLIST
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-docs/DESCR
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-docs/Makefile
diff -r0 -r1.1 pkgsrc/mail/vmailmgr-docs/PLIST
Sun Feb 25 21:09:23 2024
Thu Jan 1 09:00:00 1970
pkgsrc/mail/vmailmgr-base/patches/patch-python_Makefile.am,v

anoncvs not yet been updated

File Added: pkgsrc/mail/php-vmailmgr/DESCR
This is the VMailMgr PHP library providing tools to setup a virtual
domain, add and delete individual virtual users and aliases, and to
change passwords.

File Added: pkgsrc/mail/php-vmailmgr/Makefile
# $NetBSD: Makefile,v 1.1 2024/02/25 12:09:20 schmonz Exp $

.include "../../mail/vmailmgr/Makefile.common"

PKGNAME=		php-vmailmgr-${VERSION}
CATEGORIES=		mail

MAINTAINER=		schmonz@NetBSD.org
HOMEPAGE=		https://untroubled.org/vmailmgr/
COMMENT=		Virtual domain manager for qmail (PHP bindings)
LICENSE=		gnu-gpl-v2

DEPENDS+=		php-[0-9]*:${PHPPKGSRCDIR}

CONFIGURE_ARGS+=	--enable-php

BUILD_DIRS=		php
INSTALL_DIRS=		php

post-install:
	${INSTALL_DATA} ${WRKSRC}/${INSTALL_DIRS}/vmail.features \
		${DESTDIR}${PREFIX}/share/vmailmgr/php/README

.include "../../lang/php/phpversion.mk"
.include "../../mk/bsd.pkg.mk"

File Added: pkgsrc/mail/php-vmailmgr/PLIST
@comment $NetBSD: PLIST,v 1.1 2024/02/25 12:09:20 schmonz Exp $
share/vmailmgr/php/README
share/vmailmgr/php/vmail.inc

File Added: pkgsrc/mail/py-vmailmgr/DESCR
These are the VMailMgr Python bindings.

File Added: pkgsrc/mail/py-vmailmgr/Makefile
# $NetBSD: Makefile,v 1.1 2024/02/25 12:09:21 schmonz Exp $

.include "../../mail/vmailmgr/Makefile.common"

PKGNAME=		py-vmailmgr-${VERSION}
CATEGORIES=		mail python

MAINTAINER=		schmonz@NetBSD.org
HOMEPAGE=		https://untroubled.org/vmailmgr/
COMMENT=		Virtual domain manager for qmail (Python bindings)
LICENSE=		gnu-gpl-v2

CONFIGURE_ARGS+=	--enable-python
CONFIGURE_ENV+=		PYTHONBIN=${PYTHONBIN:Q}

BUILD_DIRS=		python
INSTALL_DIRS=		python

PLIST_SUBST+=		PYSITELIB=${PYSITELIB:Q}

SUBST_CLASSES+=		pyversion
SUBST_STAGE.pyversion=	pre-configure
SUBST_FILES.pyversion=	configure.ac python/Makefile.am
SUBST_VARS.pyversion=	PYTHONBIN

PYTHON_VERSIONS_ACCEPTED=	27

.include "../../lang/python/application.mk"
.include "../../mk/bsd.pkg.mk"

File Added: pkgsrc/mail/py-vmailmgr/PLIST
@comment $NetBSD: PLIST,v 1.1 2024/02/25 12:09:21 schmonz Exp $
${PYSITELIB}/vmailmgr/__init__.py
${PYSITELIB}/vmailmgr/__init__.pyc
${PYSITELIB}/vmailmgr/__init__.pyo
${PYSITELIB}/vmailmgr/commands.py
${PYSITELIB}/vmailmgr/commands.pyc
${PYSITELIB}/vmailmgr/commands.pyo
${PYSITELIB}/vmailmgr/config.py
${PYSITELIB}/vmailmgr/config.pyc
${PYSITELIB}/vmailmgr/config.pyo
${PYSITELIB}/vmailmgr/constants.py
${PYSITELIB}/vmailmgr/constants.pyc
${PYSITELIB}/vmailmgr/constants.pyo
${PYSITELIB}/vmailmgr/daemon.py
${PYSITELIB}/vmailmgr/daemon.pyc
${PYSITELIB}/vmailmgr/daemon.pyo
${PYSITELIB}/vmailmgr/local.py
${PYSITELIB}/vmailmgr/local.pyc
${PYSITELIB}/vmailmgr/local.pyo
${PYSITELIB}/vmailmgr/types.py
${PYSITELIB}/vmailmgr/types.pyc
${PYSITELIB}/vmailmgr/types.pyo

File Added: pkgsrc/mail/vmailmgr/DESCR
This is the meta package of VMailMgr and all its components.

File Added: pkgsrc/mail/vmailmgr/Makefile
# $NetBSD: Makefile,v 1.1 2024/02/25 12:09:21 schmonz Exp $

.include "../../mail/vmailmgr/version.mk"

PKGNAME=	vmailmgr-${VERSION}
CATEGORIES=	mail

MAINTAINER=	schmonz@NetBSD.org
HOMEPAGE=	https://untroubled.org/vmailmgr/
COMMENT=	Virtual domain manager for qmail
LICENSE=	gnu-gpl-v2

DEPENDS+=	vmailmgr-base>=${VERSION}:../../mail/vmailmgr-base
DEPENDS+=	vmailmgr-cgi>=${VERSION}:../../mail/vmailmgr-cgi
DEPENDS+=	vmailmgr-courier-imap>=${VERSION}:../../mail/vmailmgr-courier-imap
DEPENDS+=	vmailmgr-docs>=${VERSION}:../../mail/vmailmgr-docs
DEPENDS+=	php-vmailmgr>=${VERSION}:../../mail/php-vmailmgr
DEPENDS+=	py-vmailmgr>=${VERSION}:../../mail/py-vmailmgr

META_PACKAGE=	yes

.include "../../mk/bsd.pkg.mk"

File Added: pkgsrc/mail/vmailmgr/Makefile.common
# $NetBSD: Makefile.common,v 1.1 2024/02/25 12:09:21 schmonz Exp $
#
# used by mail/php-vmailmgr/Makefile
# used by mail/py-vmailmgr/Makefile
# used by mail/vmailmgr-base/Makefile
# used by mail/vmailmgr-cgi/Makefile
# used by mail/vmailmgr-courier-imap/Makefile
# used by mail/vmailmgr-docs/Makefile

.include "../../mail/vmailmgr/version.mk"

DISTNAME=		vmailmgr-${GITHUB_TAG}
MASTER_SITES=		${MASTER_SITE_GITHUB:=bruceg/}
GITHUB_TAG=		526d53c1d0e604ec29ada61b79485ceeb8b978cd

WRKSRC=			${WRKDIR}/${DISTNAME}

USE_LANGUAGES=		c c++
USE_CXX_FEATURES=	c++14
USE_TOOLS+=		autoconf automake gmake perl sh
GNU_CONFIGURE=		yes
CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFDIR:Q}
PKG_SYSCONFSUBDIR=	vmailmgr

PATCHDIR=		${.CURDIR}/../../mail/vmailmgr-base/patches
DISTINFO_FILE=		${.CURDIR}/../../mail/vmailmgr-base/distinfo

REPLACE_PERL=		lib/cli++/*.pl doc/*.pl

SUBST_CLASSES+=		version
SUBST_STAGE.version=	pre-configure
SUBST_FILES.version=	configure.ac
SUBST_VARS.version=	PKGVERSION

SUBST_CLASSES+=		prefix
SUBST_STAGE.prefix=	pre-configure
SUBST_FILES.prefix=	authenticate/checkvpw.pod doc/HOWTO.texi
SUBST_SED.prefix=	-e 's|/usr/bin|${PREFIX}/bin|g'

SUBST_CLASSES+=		unused
SUBST_STAGE.unused=	pre-configure
SUBST_FILES.unused=	lib/courier-authlib/*.c lib/courier-authlib/*.h
SUBST_SED.unused=	-e 's|\(.*rcsid\[]=.*;\)$$|// \1|g'

SUBST_CLASSES+=		sysconf
SUBST_STAGE.sysconf=	pre-configure
SUBST_FILES.sysconf=	php/vmail.inc scripts/vmailmgrd.run
SUBST_FILES.sysconf+=	lib/config/configrc.h.in lib/config/configrc.h
SUBST_FILES.sysconf+=	doc/FAQ.texi doc/HOWTO.texi doc/configuration.texi
SUBST_SED.sysconf=	-e 's|/etc/vmailmgr|${PKG_SYSCONFDIR}|g'

BUILD_DEFS+=		PKG_SYSCONFBASE
SUBST_CLASSES+=		courier
SUBST_STAGE.courier=	pre-configure
SUBST_FILES.courier=	doc/FAQ.texi doc/HOWTO.texi
SUBST_SED.courier=	-e 's|/usr/lib/courier-imap/etc/imapd\.config|${PKG_SYSCONFBASE}/courier/imapd.cnf|g'
SUBST_SED.courier+=	-e 's|/usr/lib/courier-imap/libexec/authlib|${PREFIX}/libexec/courier-authlib|g'

BUILD_DEFS+=		QMAILDIR
SUBST_CLASSES+=		qmaildir
SUBST_STAGE.qmaildir=	pre-configure
SUBST_FILES.qmaildir=	lib/config/configrc.in lib/config/_qmail_root.cc
SUBST_FILES.qmaildir+=	doc/FAQ.texi doc/HOWTO.texi doc/configuration.texi
SUBST_FILES.qmaildir+=	authenticate/checkvpw.pod
SUBST_SED.qmaildir=	-e 's|/var/qmail|${QMAILDIR}|g'
SUBST_SED.qmaildir+=	-e 's|/etc/qmail|${QMAILDIR}|g'

BUILD_DEFS+=		VARBASE
SUBST_CLASSES+=		varbase
SUBST_STAGE.varbase=	pre-configure
SUBST_FILES.varbase=	lib/config/_error_maildir.cc lib/config/_global_bulletin_dir.cc
SUBST_FILES.varbase+=	lib/config/configrc.in doc/configuration.texi
SUBST_SED.varbase=	-e 's|/var/lib/vmailmgr|${VARBASE}/vmailmgr|g'
SUBST_SED.varbase+=	-e 's|/var/spool|${VARBASE}/spool|g'

post-extract:
	cd ${WRKSRC}/lib/config && ${SH} build-config.sh

pre-configure:
	cd ${WRKSRC} && autoreconf -i

File Added: pkgsrc/mail/vmailmgr/version.mk
# $NetBSD: version.mk,v 1.1 2024/02/25 12:09:21 schmonz Exp $
#
# used by wip/vmailmgr/Makefile
# used by wip/vmailmgr/Makefile.common

VERSION=		0.97.0.20150901

File Added: pkgsrc/mail/vmailmgr-base/DESCR
VMailMgr (short for Virtual MAIL ManaGeR) is a package of programs
designed to manage multiple domains of mail addresses and mailboxes on a
single host. It co-operates with qmail for mail delivery and program
control. It features:

- A password checking interface between qmail-popup and qmail-pop3d
  which replaces the usual checkpassword, as well as an authentication
  module for Courier IMAP, that provide access to the virtual mailboxes
  by one of three methods:
  - IP-based virtual server access (invisible to the POP3 user)
  - username-based access (username-virtualuser)
  - hostname-based access (virtualuser@virtual.host or
    virtualuser:virtual.host)
- CDB-based password tables to speed up access for domains of any size.
- Tools to setup a virtual domain, add and delete individual virtual
  users and aliases, and to change passwords.
- A separate delivery agent that automatically deals with any address
  inside a virtual domain from a single .qmail-default file.

File Added: pkgsrc/mail/vmailmgr-base/Makefile
# $NetBSD: Makefile,v 1.1 2024/02/25 12:09:21 schmonz Exp $

.include "../../mail/vmailmgr/Makefile.common"

PKGNAME=		vmailmgr-base-${VERSION}
CATEGORIES=		mail

MAINTAINER=		schmonz@NetBSD.org
HOMEPAGE=		https://untroubled.org/vmailmgr/
COMMENT=		Virtual domain manager for qmail (base package)
LICENSE=		gnu-gpl-v2

CONFIGURE_ARGS+=	--disable-cgi
CONFIGURE_ARGS+=	--disable-courier-imap
CONFIGURE_ARGS+=	--disable-php
CONFIGURE_ARGS+=	--disable-python

.include "options.mk"

# for vmailmgr.7, without building the heavier docs
# copy-paste-changed from ../../mk/build/build.mk:
post-build:
.for dir in doc
	${RUN}${_ULIMIT_CMD}						\
	cd ${WRKSRC} && cd ${dir} &&					\
	${BUILD_MAKE_CMD} man
.endfor

# copy-paste-changed from ../../mk/install/install.mk:
post-install:
.for dir in doc
	${RUN} ${_ULIMIT_CMD}						\
	cd ${WRKSRC} && cd ${dir} &&					\
	${PKGSRC_SETENV} ${INSTALL_ENV} ${MAKE_ENV} 			\
		${MAKE_PROGRAM} ${MAKE_FLAGS} ${INSTALL_MAKE_FLAGS}	\
			-f ${MAKE_FILE} install-man
.endfor

.include "../../mk/bsd.pkg.mk"

File Added: pkgsrc/mail/vmailmgr-base/PLIST
@comment $NetBSD: PLIST,v 1.1 2024/02/25 12:09:21 schmonz Exp $
bin/checkvpw
bin/dumpvuser
bin/listvdomain
bin/showvconfig
bin/vaddalias
bin/vadduser
bin/vaddusers
bin/vauthenticate
bin/vchattr
bin/vchforwards
bin/vconf2dir
bin/vdeliver
bin/vdeluser
bin/vpasswd
bin/vpasswds
bin/vrehash
bin/vsetup
bin/vupgrade
man/man1/checkvpw.1
man/man1/dumpvuser.1
man/man1/listvdomain.1
man/man1/vadduser.1
man/man1/vaddusers.1
man/man1/vauthenticate.1
man/man1/vchattr.1
man/man1/vchforwards.1
man/man1/vdeliver.1
man/man1/vdeluser.1
man/man1/vpasswd.1
man/man1/vpasswds.1
man/man1/vrehash.1
man/man1/vsetup.1
man/man1/vupgrade.1
man/man7/vmailmgr.7
man/man8/vmailmgrd.8
sbin/vmailmgrd

File Added: pkgsrc/mail/vmailmgr-base/distinfo
$NetBSD: distinfo,v 1.1 2024/02/25 12:09:21 schmonz Exp $

BLAKE2s (vmailmgr-526d53c1d0e604ec29ada61b79485ceeb8b978cd-526d53c1d0e604ec29ada61b79485ceeb8b978cd.tar.gz) = 6e83ecea2a0defebd20323fbe9833dc1d4e63e8e2d4c6d904c9558ba32cc9a59
SHA512 (vmailmgr-526d53c1d0e604ec29ada61b79485ceeb8b978cd-526d53c1d0e604ec29ada61b79485ceeb8b978cd.tar.gz) = 9d717b4b9ae763509d8192c40167606acdc56622d8f9351c763140f5b2573d6c2c1364c33003e1649d2b0d628aadab03690ade20f9e3210c5b44a89237bdd62b
Size (vmailmgr-526d53c1d0e604ec29ada61b79485ceeb8b978cd-526d53c1d0e604ec29ada61b79485ceeb8b978cd.tar.gz) = 191933 bytes
SHA1 (patch-Makefile.am) = e78f4db1430c54b6a7a7db4020a4d5169b1b9d22
SHA1 (patch-acinclude.m4) = 950092d07a7021fb92e4fd4716107a7988a21d22
SHA1 (patch-authenticate_Makefile.am) = 3529853104846d64882d64be39597cacb0bc6e98
SHA1 (patch-commands_Makefile.am) = 0fc9881f76fefad7648ecde4bb230278237e33b5
SHA1 (patch-commands_vadduser.cc) = 425ff956c716b443af4749412dd87e72e9be8af6
SHA1 (patch-commands_vdeliver.cc) = ddf90a5adefd646872d59591e03f0feeb7f72167
SHA1 (patch-configure.ac) = d1a9fad59f076debcdeb6fd352a9b691aad9eec6
SHA1 (patch-daemon_Makefile.am) = 4a0a2bbcc25371ae412c5b64b577a2194a84f2e4
SHA1 (patch-daemon_main.cc) = e93f2b06b26920ec9dd8aaf8e4029792b9042284
SHA1 (patch-doc_HOWTO.texi) = 29a8e8413d653e6901c520ecf38d4febfe7a9845
SHA1 (patch-doc_Makefile.am) = cd16ee93a4209411fdd478d66401dd00fa765013
SHA1 (patch-lib_cli++_main.cc) = cfa961d73e61fa5bd6ef20efefe77d773f8ef951
SHA1 (patch-lib_fdbuf_fdbuf.h) = 2607bb82c4d9123df0a94b30fc5930db6429010d
SHA1 (patch-lib_mergelib.sh) = 59cdc1e5896331195f1d693a7cad4f7f6f7ec8e4
SHA1 (patch-lib_misc_crc32.cc) = 06c57d2fb85d8e216b9e961aa949d2c7a12d1d3a
SHA1 (patch-lib_misc_md5-crypt.c) = 34b45a7b10b07bea9a1b64958d8b31b807d75083
SHA1 (patch-lib_misc_md5.c) = 44a8bdfb8db3861f4e3ca5631f40ab47e4092901
SHA1 (patch-lib_misc_response.h) = 36b3366b718118139d86121b2473e7f2f6d04c92
SHA1 (patch-lib_vpwtable_cdb__write.cc) = 68e159457a1c6dd152c9d33abeb4457078a4e666
SHA1 (patch-lib_vpwtable_gdbm__del.cc) = 9eb35e3d6daaf55aaefdaf7fec33a500e51d7856
SHA1 (patch-lib_vpwtable_gdbm__exists.cc) = c819d6fb8d410b83faf113d639620dcb44d7ba2d
SHA1 (patch-lib_vpwtable_gdbm__getbyname.cc) = 6a74f8a8398b6344116d1ded1553a0e795dc809c
SHA1 (patch-lib_vpwtable_gdbm__put.cc) = 26e9c45bba56cb22fcf17d4a61daef3803ddc752
SHA1 (patch-lib_vpwtable_gdbm__write.cc) = 5d5bbdc6369292aab87225ba525e81a194aa0d70
SHA1 (patch-python_Makefile.am) = b1991252f66714b31709a50029fb8c85cd277d79

File Added: pkgsrc/mail/vmailmgr-base/options.mk
# $NetBSD: options.mk,v 1.1 2024/02/25 12:09:21 schmonz Exp $

PKG_OPTIONS_VAR=		PKG_OPTIONS.vmailmgr-base

PKG_OPTIONS_REQUIRED_GROUPS=	db
PKG_OPTIONS_GROUP.db=		cdb gdbm

PKG_SUPPORTED_OPTIONS=		kerberos # XXX or gssapi?
PKG_SUGGESTED_OPTIONS=		cdb

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

.if !empty(PKG_OPTIONS:Mcdb)
# enabled by default
.endif

.if !empty(PKG_OPTIONS:Mgdbm)
CONFIGURE_ARGS+=		--with-vpwtable=gdbm
.include "../../databases/gdbm/buildlink3.mk"
.endif

.if !empty(PKG_OPTIONS:Mkerberos)
CONFIGURE_ARGS+=		--with-krb5
.include "../../security/openssl/buildlink3.mk"
.include "../../mk/krb5.buildlink3.mk"
.endif

File Added: pkgsrc/mail/vmailmgr-base/patches/patch-Makefile.am
$NetBSD: patch-Makefile.am,v 1.1 2024/02/25 12:09:21 schmonz Exp $

Build cgi, php, and python as their own packages.

--- Makefile.am.orig	2015-09-01 16:03:21.000000000 +0000
+++ Makefile.am
@@ -1,7 +1,12 @@
+SUBDIRS = lib authenticate commands daemon scripts
+if WANTCGI
+SUBDIRS += cgi
+endif
+if WANTPHP
+SUBDIRS += php
+endif
 if WANTPYTHON
-SUBDIRS = python php lib authenticate commands daemon cgi doc scripts
-else
-SUBDIRS = php lib authenticate commands daemon cgi doc scripts
+SUBDIRS += python
 endif
 
 dist-hook:

File Added: pkgsrc/mail/vmailmgr-base/patches/patch-acinclude.m4
$NetBSD: patch-acinclude.m4,v 1.1 2024/02/25 12:09:21 schmonz Exp $

Fix autoreconf warnings.

--- acinclude.m4.orig	2024-02-21 15:45:31.387684310 +0000
+++ acinclude.m4
@@ -1,5 +1,5 @@
 dnl TRY_CXX_FLAG(FLAG,[ACTION-IF-FOUND[,ACTION-IF-NOT-FOUND]])
-AC_DEFUN(TRY_CXX_FLAG,
+AC_DEFUN([TRY_CXX_FLAG],
 [echo >conftest.cc
 if ${CXX-g++} ${CXXFLAGS} -c [$1] conftest.cc >/dev/null 2>&1; then
   ifelse([$2], , :, [rm -f conftest*
@@ -10,7 +10,7 @@ else
 fi
 rm -f conftest*])
 
-AC_DEFUN(CXX_NO_RTTI,
+AC_DEFUN([CXX_NO_RTTI],
 [AC_CACHE_CHECK(whether ${CXX-g++} accepts -fno-rtti,
 	local_cv_flag_NO_RTTI,
 	TRY_CXX_FLAG(-fno-rtti,
@@ -19,7 +19,7 @@ AC_DEFUN(CXX_NO_RTTI,
 test "$local_cv_flag_NO_RTTI" = yes && CXXFLAGS="$CXXFLAGS -fno-rtti"
 ])
 
-AC_DEFUN(CXX_NO_EXCEPTIONS,
+AC_DEFUN([CXX_NO_EXCEPTIONS],
 [AC_CACHE_CHECK(whether ${CXX-g++} accepts -fno-exceptions,
 	local_cv_flag_NO_EXCEPTIONS,
 	TRY_CXX_FLAG(-fno-exceptions,

File Added: pkgsrc/mail/vmailmgr-base/patches/patch-authenticate_Makefile.am
$NetBSD: patch-authenticate_Makefile.am,v 1.1 2024/02/25 12:09:21 schmonz Exp $

Build Courier IMAP authenticator as a separate package.

Avoid "warning: ignoring prerequisites on suffix rule definition"

--- authenticate/Makefile.am.orig	2015-09-01 16:03:21.000000000 +0000
+++ authenticate/Makefile.am
@@ -1,6 +1,8 @@
 bin_PROGRAMS = checkvpw vauthenticate
+if WANTCOURIER
 authlib_PROGRAMS = authvmailmgr
-authlibdir = ${prefix}/lib/courier-imap/libexec/authlib/
+authlibdir = ${prefix}/libexec/courier-authlib/
+endif
 
 noinst_PODS = checkvpw.pod vauthenticate.pod
 noinst_HTMLS = $(noinst_PODS:.pod=.html)
@@ -17,9 +19,9 @@ docs: $(noinst_HTMLS) $(man_MANS)
 dist-hook:
 	touch $(distdir)/*.html $(distdir)/*.[123456789]
 
-.pod.1: ../configure.ac
+.pod.1:
 	$(POD2MAN) --section=1 $< >$@
-.pod.html: ../configure.ac
+.pod.html:
 	$(POD2HTML) $< >$@
 
 AM_CPPFLAGS = -I../lib
@@ -27,8 +29,10 @@ AM_CPPFLAGS = -I../lib
 checkvpw_SOURCES = checkvpw.cc authvlib.cc authvlib.h
 checkvpw_LDADD = ../lib/libvmailmgr.a
 
+if WANTCOURIER
 authvmailmgr_SOURCES = authvmailmgr.cc authvlib.cc authvlib.h
 authvmailmgr_LDADD = ../lib/libvmailmgr.a -L../lib/courier-authlib -lauthmod
+endif
 
 vauthenticate_SOURCES = vauthenticate.cc authvlib.cc authvlib.h
 vauthenticate_LDADD = ../lib/libvmailmgr.a

File Added: pkgsrc/mail/vmailmgr-base/patches/patch-commands_Makefile.am
$NetBSD: patch-commands_Makefile.am,v 1.1 2024/02/25 12:09:21 schmonz Exp $

Fix typo in list of .pod files, spotted on Ubuntu via "install: will not
overwrite just-created vadduser.1"

Avoid "warning: ignoring prerequisites on suffix rule definition"

--- commands/Makefile.am.orig	2015-09-01 16:03:21.000000000 +0000
+++ commands/Makefile.am
@@ -4,7 +4,7 @@ bin_SCRIPTS = vaddalias vconf2dir
 noinst_HEADERS = vcommand.h
 
 noinst_PODS = \
-	dumpvuser.pod listvdomain.pod vadduser.pod vadduser.pod vchattr.pod \
+	dumpvuser.pod listvdomain.pod vadduser.pod vaddusers.pod vchattr.pod \
 	vchforwards.pod vdeliver.pod vdeluser.pod \
 	vpasswd.pod vpasswds.pod vrehash.pod vsetup.pod vupgrade.pod
 noinst_HTMLS = $(noinst_PODS:.pod=.html)
@@ -23,11 +23,11 @@ docs: $(noinst_HTMLS) $(man_MANS)
 dist-hook:
 	touch $(distdir)/*.html $(distdir)/*.[123456789]
 
-.cc.pod: ../configure.ac ../lib/cli++/cli++topod.pl
+.cc.pod:
 	perl ../lib/cli++/cli++topod.pl $< >$@
-.pod.1: ../configure.ac
+.pod.1:
 	$(POD2MAN) --section=1 $< >$@
-.pod.html: ../configure.ac
+.pod.html:
 	$(POD2HTML) $< >$@
 
 AM_CPPFLAGS = -I../lib -DBINDIR=\"@bindir@\"

File Added: pkgsrc/mail/vmailmgr-base/patches/patch-commands_vadduser.cc
$NetBSD: patch-commands_vadduser.cc,v 1.1 2024/02/25 12:09:22 schmonz Exp $

Avoid dangling else.

--- commands/vadduser.cc.orig	2024-02-22 18:36:02.894040336 +0000
+++ commands/vadduser.cc
@@ -190,16 +190,18 @@ void add_alias(mystring user, mystring a
   if(!domain.exists(alias)) {
     vpwentry vpw(alias, "*", domain.userdir(alias), user, false);
     response resp = domain.set(&vpw, true);
-    if(!resp)
+    if(!resp) {
       if(!o_quiet)
 	ferr << argv0base << ": warning: adding the alias '"
 	     << alias
 	     << "' failed:\n  "
 	     << resp.msg << endl;
-    else
+    }
+    else {
       if(!o_quiet)
 	fout << argv0base << ": alias '" << alias << "' successfully added"
 	     << endl;
+    }
   }
   else
     if(!o_quiet)

File Added: pkgsrc/mail/vmailmgr-base/patches/patch-commands_vdeliver.cc
$NetBSD: patch-commands_vdeliver.cc,v 1.1 2024/02/25 12:09:22 schmonz Exp $

Patch from FreeBSD ports.

--- commands/vdeliver.cc.orig	2015-09-01 16:03:21.000000000 +0000
+++ commands/vdeliver.cc
@@ -262,7 +262,7 @@ void inject(mystring sender, mystring re
     close(pipe2[1]);
     if((dup2(pipe1[0], 0) != 0) || (dup2(pipe2[0], 1) != 1))
       exit(111);
-    execl(qq.c_str(), qq.c_str(), 0);
+    execl(qq.c_str(), qq.c_str(), (char *)0);
     die_temp("Exec of qmail-queue failed.");
   default:
     close(pipe1[0]);
@@ -335,11 +335,12 @@ int cli_main(int, char*[])
 
   if (run_predeliver) {
     int r = execute("vdeliver-predeliver");
-    if(r)
+    if(r) {
       if(r == 99)
-	return 99;
+        return 99;
       else
-	exit_msg("Execution of vdeliver-predeliver failed", r);
+        exit_msg("Execution of vdeliver-predeliver failed", r);
+    }
   }
 
   if(do_delivery) {

File Added: pkgsrc/mail/vmailmgr-base/patches/patch-configure.ac
$NetBSD: patch-configure.ac,v 1.1 2024/02/25 12:09:22 schmonz Exp $

Don't build courier-imap, cgi, php, or python by default.
Remove unused text-browser checks.

--- configure.ac.orig	2015-09-01 16:03:21.000000000 +0000
+++ configure.ac
@@ -1,4 +1,4 @@
-AC_INIT([vmailmgr], [0.97.1])
+AC_INIT([vmailmgr], [@PKGVERSION@])
 AC_CONFIG_SRCDIR([lib/mergelib.sh])
 AM_INIT_AUTOMAKE
 
@@ -55,38 +55,48 @@ AC_PATH_PROG(RM, rm)
 AC_PATH_PROG(MKDIR, mkdir)
 AC_PATH_PROG(LN, ln)
 
-AC_PATH_PROG(PYTHON, python2)
+USE_PYTHON=no
+AC_ARG_ENABLE(python,
+[  --enable-python         Install Python bindings.],
+USE_PYTHON=$enableval)
+PYTHON=@PYTHONBIN@
 AC_CACHE_CHECK(Python library path, local_cv_python_lib_dir,
 [[if test -x "$PYTHON"; then
-  local_cv_python_lib_dir=`$PYTHON -c "import sys;print sys.path[1]"`
+  local_cv_python_lib_dir=`$PYTHON -c "import sys;print(sys.path[2])"`/site-packages
 else
   local_cv_python_lib_dir=NONE
 fi]])
 pythonlibdir="$local_cv_python_lib_dir/vmailmgr"
 AC_SUBST(pythonlibdir)
-AM_CONDITIONAL(WANTPYTHON, test x$local_cv_python_lib_dir != xNONE)
+AM_CONDITIONAL(WANTPYTHON, test "$USE_PYTHON" != no)
 
-phpdir="/home/httpd/php"
+USE_PHP=no
+AC_ARG_ENABLE(php,
+[  --enable-php            Install PHP bindings.],
+USE_PHP=$enableval)
+phpdir='${prefix}/share/vmailmgr/php'
 AC_SUBST(phpdir)
+AM_CONDITIONAL(WANTPHP, test "$USE_PHP" != no)
 
-AC_PATH_PROG(W3M, w3m)
-AC_PATH_PROG(LYNX, lynx)
-if test "x$W3M" != x; then
-  echo Using w3m to format html pages.
-  HTML2TXT="w3m -dump"
-elif test "x$LYNX" != x; then
-  echo Using lynx to format html pages.
-  HTML2TXT="lynx -dump -nolist"
-else
-  echo "Can't find either w3m or lynx, building the plain text"
-  echo "documentation files will fail."
-  HTML2TXT="false"
-fi
-AC_SUBST(HTML2TXT)
+USE_COURIER=no
+AC_ARG_ENABLE(courier-imap,
+[  --enable-courier-imap   Install Courier-IMAP authenticator.],
+USE_COURIER=$enableval)
+AM_CONDITIONAL(WANTCOURIER, test "$USE_COURIER" != no)
+
+USE_CGI=no
+AC_ARG_ENABLE(cgi,
+[  --enable-cgi            Install CGI programs.],
+USE_CGI=$enableval)
+cgidir='${prefix}/libexec/cgi-bin'
+AC_SUBST(cgidir)
+AM_CONDITIONAL(WANTCGI, test "$USE_CGI" != no)
 
 TODAY=`date +%Y-%m-%d`
-POD2MAN="pod2man --release='vmailmgr ${VERSION}' --center='VMailMgr Tools Documentation' --date='${TODAY}'"
-POD2HTML="pod2html --noindex"
+AC_PATH_PROG(POD2MAN,pod2man)
+POD2MAN="$POD2MAN --release='vmailmgr ${VERSION}' --center='VMailMgr Tools Documentation' --date='${TODAY}'"
+AC_PATH_PROG(POD2HTML,pod2html)
+POD2HTML="$POD2HTML --noindex"
 SUFFIXES="$SUFFIXES .1 .5 .7 .8 .pod .html .texi .txt .ps .fig .sgml .py .pyc .pyo"
 AC_SUBST(POD2MAN)
 AC_SUBST(POD2HTML)
@@ -117,9 +127,6 @@ dnl Checks for library functions.
 AC_CHECK_FUNCS(gethostname gettimeofday mkdir putenv rmdir socket)
 AC_CHECK_FUNCS(srandom random crypt strcasestr)
 
-cgidir='${prefix}/cgi-bin'
-AC_SUBST(cgidir)
-
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_FILES(Makefile
 	cgi/Makefile

File Added: pkgsrc/mail/vmailmgr-base/patches/patch-daemon_Makefile.am
$NetBSD: patch-daemon_Makefile.am,v 1.1 2024/02/25 12:09:22 schmonz Exp $

Avoid "warning: ignoring prerequisites on suffix rule definition"

--- daemon/Makefile.am.orig	2015-09-01 16:03:21.000000000 +0000
+++ daemon/Makefile.am
@@ -15,11 +15,11 @@ docs: $(noinst_HTMLS) $(noinst_TXTS)
 dist-hook:
 	touch $(distdir)/*.html $(distdir)/*.[123456789]
 
-vmailmgrd.pod: main.cc ../configure.ac ../lib/cli++/cli++topod.pl
-	perl ../lib/cli++/cli++topod.pl $< >$@
-.pod.8: ../configure.ac
+vmailmgrd.pod:
+	perl ../lib/cli++/cli++topod.pl main.cc >$@
+.pod.8:
 	$(POD2MAN) --section=8 $< >$@
-.pod.html: ../configure.ac
+.pod.html:
 	$(POD2HTML) $< >$@
 
 AM_CPPFLAGS = -I../lib

File Added: pkgsrc/mail/vmailmgr-base/patches/patch-daemon_main.cc
$NetBSD: patch-daemon_main.cc,v 1.1 2024/02/25 12:09:22 schmonz Exp $

Remove unused function.

--- daemon/main.cc.orig	2024-02-22 18:32:57.270441623 +0000
+++ daemon/main.cc
@@ -61,12 +61,6 @@ cli_option cli_options[] = {
 
 #define TIMEOUT 1
 
-static inline void die(const char* msg)
-{
-  perror(msg);
-  exit(1);
-}
-
 static void finishreq()
 {
   alarm(0);

File Added: pkgsrc/mail/vmailmgr-base/patches/patch-doc_HOWTO.texi
$NetBSD: patch-doc_HOWTO.texi,v 1.1 2024/02/25 12:09:22 schmonz Exp $

Avoid encoding error for umlaut-laden character.

--- doc/HOWTO.texi.orig	2024-02-21 20:15:30.534197736 +0000
+++ doc/HOWTO.texi
@@ -1,5 +1,6 @@
 \input texinfo @c -*-texinfo-*-
 @c %**start of header
+@documentencoding ISO-8859-1
 @setfilename HOWTO.info
 @settitle VMailMgr HOWTO
 @setchapternewpage off

File Added: pkgsrc/mail/vmailmgr-base/patches/patch-doc_Makefile.am
$NetBSD: patch-doc_Makefile.am,v 1.1 2024/02/25 12:09:22 schmonz Exp $

Avoid "warning: ignoring prerequisites on suffix rule definition"

--- doc/Makefile.am.orig	2015-09-01 16:03:21.000000000 +0000
+++ doc/Makefile.am
@@ -7,10 +7,10 @@ noinst_TXTS = HOWTO.txt FAQ.txt \
 	record-format.txt
 noinst_PODS = vmailmgr.pod
 noinst_MISC = FAQ.info FAQ.pdf HOWTO.info HOWTO.pdf \
-	configuration.info translation.pdf translation.ps
+	configuration.info
 EXTRA_DIST = ChangeLog-pre-vmailmgr ChangeLog-pre-0.70 \
 	changelog2html.pl news2html.pl \
-	YEAR2000 translation.fig \
+	YEAR2000 \
 	$(man_MANS) \
 	$(noinst_PODS) \
 	$(noinst_TEXINFOS) \
@@ -31,6 +31,7 @@ TEXI2INFO = texi2any --info --no-split -
 TEXI2TXT = texi2any --plaintext
 
 all: $(noinst_HTMLS) $(noinst_PDFS) $(noinst_TXTS) $(noinst_MISC)
+man: $(man_MANS)
 
 dist-hook:
 	touch $(distdir)/*.html
@@ -43,15 +44,15 @@ ChangeLog.html: ../ChangeLog
 NEWS.html: ../NEWS
 	$(NEWS2HTML) $< >$@
 
-.pod.1: ../configure.ac; $(POD2MAN) --section=1 $< >$@
-.pod.5: ../configure.ac; $(POD2MAN) --section=5 $< >$@
-.pod.7: ../configure.ac; $(POD2MAN) --section=7 $< >$@
-.pod.8: ../configure.ac; $(POD2MAN) --section=8 $< >$@
-.pod.html: ../configure.ac; $(POD2HTML) $< >$@
-.texi.html: ../configure.ac; $(TEXI2HTML) $< >$@
-.texi.txt: ../configure.ac; $(TEXI2TXT) $< >$@
-.texi.pdf: ../configure.ac; $(TEXI2PDF) $<
-.texi.info: ../configure.ac; $(TEXI2INFO) $<
+.pod.1: ; $(POD2MAN) --section=1 $< >$@
+.pod.5: ; $(POD2MAN) --section=5 $< >$@
+.pod.7: ; $(POD2MAN) --section=7 $< >$@
+.pod.8: ; $(POD2MAN) --section=8 $< >$@
+.pod.html: ; $(POD2HTML) $< >$@
+.texi.html: ; $(TEXI2HTML) $< >$@
+.texi.txt: ; $(TEXI2TXT) $< >$@
+.texi.pdf: ; $(TEXI2PDF) $<
+.texi.info: ; $(TEXI2INFO) $<
 
-.fig.pdf: ../configure.ac; $(FIG2PDF) $< $@
-.fig.ps: ../configure.ac; $(FIG2PS) $< $@
+.fig.pdf: ; $(FIG2PDF) $< $@
+.fig.ps: ; $(FIG2PS) $< $@

File Added: pkgsrc/mail/vmailmgr-base/patches/patch-lib_cli++_main.cc
$NetBSD: patch-lib_cli++_main.cc,v 1.1 2024/02/25 12:09:22 schmonz Exp $

Remove unused function.

--- lib/cli++/main.cc.orig	2024-02-22 18:32:27.213171111 +0000
+++ lib/cli++/main.cc
@@ -49,11 +49,6 @@ static void build_options()
   options[optionc-1] = &help_option;
 }
 
-static inline unsigned max(unsigned a, unsigned b)
-{
-  return (a>b) ? a : b;
-}
-
 static const char* fill(unsigned i)
 {
   static unsigned lastlen = 0;

File Added: pkgsrc/mail/vmailmgr-base/patches/patch-lib_fdbuf_fdbuf.h
$NetBSD: patch-lib_fdbuf_fdbuf.h,v 1.1 2024/02/25 12:09:22 schmonz Exp $

Fix warnings.

--- lib/fdbuf/fdbuf.h.orig	2024-02-20 03:19:48.448432259 +0000
+++ lib/fdbuf/fdbuf.h
@@ -21,6 +21,7 @@
 #include "config.h"
 #include <string.h>
 #include <fcntl.h>
+#include <unistd.h>
 
 #ifdef _REENTRANT
 #include <pthread.h>

File Added: pkgsrc/mail/vmailmgr-base/patches/patch-lib_mergelib.sh
$NetBSD: patch-lib_mergelib.sh,v 1.1 2024/02/25 12:09:22 schmonz Exp $

Fix macOS "ld: multiple SYMDEF member files found in an archive".

--- lib/mergelib.sh.orig	2015-09-01 16:03:21.000000000 +0000
+++ lib/mergelib.sh
@@ -10,6 +10,7 @@ for input in "$@"; do
 	mkdir "$dir"
 	cd "$dir"
 	ar x ../../"$input"
+	rm -f __.SYMDEF*
 	cd ..
 done
 ar rc ../"$archive" */*

File Added: pkgsrc/mail/vmailmgr-base/patches/patch-lib_misc_crc32.cc
$NetBSD: patch-lib_misc_crc32.cc,v 1.1 2024/02/25 12:09:22 schmonz Exp $

Remove unsupported keyword.

--- lib/misc/crc32.cc.orig	2024-02-22 18:31:14.384171118 +0000
+++ lib/misc/crc32.cc
@@ -132,7 +132,7 @@ const crc32_t crc32tab[] = { /* a table
 crc32_t crc32_c::update (const unsigned char *s, int len)
 /* update running CRC calculation with contents of a buffer */
 {
-	register crc32_t a = val;
+	crc32_t a = val;
 	while(len-- > 0)
 		a = crc32_update (a, *s++);
 	return (val = a) ^ CRC32INIT;

File Added: pkgsrc/mail/vmailmgr-base/patches/patch-lib_misc_md5-crypt.c
$NetBSD: patch-lib_misc_md5-crypt.c,v 1.1 2024/02/25 12:09:22 schmonz Exp $

Provide modern prototypes.

--- lib/misc/md5-crypt.c.orig	2024-02-22 18:33:20.895490263 +0000
+++ lib/misc/md5-crypt.c
@@ -53,11 +53,7 @@ extern char *md5_crypt __P ((const char
 /* This entry point is equivalent to the `crypt' function in Unix
    libcs.  */
 char *
-md5_crypt_r (key, salt, buffer, buflen)
-     const char *key;
-     const char *salt;
-     char *buffer;
-     int buflen;
+md5_crypt_r (const char *key, const char *salt, char *buffer, int buflen)
 {
   unsigned char alt_result[16];
   struct md5_ctx ctx;
@@ -213,9 +209,7 @@ md5_crypt_r (key, salt, buffer, buflen)
 
 
 char *
-md5_crypt (key, salt)
-     const char *key;
-     const char *salt;
+md5_crypt (const char *key, const char *salt)
 {
   /* We don't want to have an arbitrary limit in the size of the
      password.  We can compute the size of the result in advance and

File Added: pkgsrc/mail/vmailmgr-base/patches/patch-lib_misc_md5.c
$NetBSD: patch-lib_misc_md5.c,v 1.1 2024/02/25 12:09:22 schmonz Exp $

Provide modern prototypes.

--- lib/misc/md5.c.orig	2015-09-01 16:03:21.000000000 +0000
+++ lib/misc/md5.c
@@ -69,8 +69,7 @@ static const unsigned char fillbuf[64] =
 /* Initialize structure containing state of computation.
    (RFC 1321, 3.3: Step 3)  */
 void
-md5_init_ctx (ctx)
-     struct md5_ctx *ctx;
+md5_init_ctx (struct md5_ctx *ctx)
 {
   ctx->A = 0x67452301;
   ctx->B = 0xefcdab89;
@@ -87,9 +86,7 @@ md5_init_ctx (ctx)
    IMPORTANT: On some systems it is required that RESBUF is correctly
    aligned for a 32 bits value.  */
 void *
-md5_read_ctx (ctx, resbuf)
-     const struct md5_ctx *ctx;
-     void *resbuf;
+md5_read_ctx (const struct md5_ctx *ctx, void *resbuf)
 {
   ((md5_uint32 *) resbuf)[0] = SWAP (ctx->A);
   ((md5_uint32 *) resbuf)[1] = SWAP (ctx->B);
@@ -105,9 +102,7 @@ md5_read_ctx (ctx, resbuf)
    IMPORTANT: On some systems it is required that RESBUF is correctly
    aligned for a 32 bits value.  */
 void *
-md5_finish_ctx (ctx, resbuf)
-     struct md5_ctx *ctx;
-     void *resbuf;
+md5_finish_ctx (struct md5_ctx *ctx, void *resbuf)
 {
   /* Take yet unprocessed bytes into account.  */
   md5_uint32 bytes = ctx->buflen;
@@ -136,9 +131,7 @@ md5_finish_ctx (ctx, resbuf)
    resulting message digest number will be written into the 16 bytes
    beginning at RESBLOCK.  */
 int
-md5_stream (stream, resblock)
-     FILE *stream;
-     void *resblock;
+md5_stream (FILE *stream, void *resblock)
 {
   /* Important: BLOCKSIZE must be a multiple of 64.  */
 #define BLOCKSIZE 4096
@@ -193,10 +186,7 @@ md5_stream (stream, resblock)
    output yields to the wanted ASCII representation of the message
    digest.  */
 void *
-md5_buffer (buffer, len, resblock)
-     const char *buffer;
-     size_t len;
-     void *resblock;
+md5_buffer (const char *buffer, size_t len, void *resblock)
 {
   struct md5_ctx ctx;
 
@@ -212,10 +202,7 @@ md5_buffer (buffer, len, resblock)
 
 
 void
-md5_process_bytes (buffer, len, ctx)
-     const void *buffer;
-     size_t len;
-     struct md5_ctx *ctx;
+md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx)
 {
   /* When we already have some bits in our internal buffer concatenate
      both inputs first.  */
@@ -270,10 +257,7 @@ md5_process_bytes (buffer, len, ctx)
    It is assumed that LEN % 64 == 0.  */
 
 void
-md5_process_block (buffer, len, ctx)
-     const void *buffer;
-     size_t len;
-     struct md5_ctx *ctx;
+md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx)
 {
   md5_uint32 correct_words[16];
   const md5_uint32 *words = buffer;

File Added: pkgsrc/mail/vmailmgr-base/patches/patch-lib_misc_response.h
$NetBSD: patch-lib_misc_response.h,v 1.1 2024/02/25 12:09:22 schmonz Exp $

Avoid operator precedence warning.

--- lib/misc/response.h.orig	2024-02-22 18:26:09.457292318 +0000
+++ lib/misc/response.h
@@ -19,7 +19,7 @@ struct response
   mystring message() const;
   mystring codestr() const;
 
-  static const unsigned long maxsize = 1<<16-1;
+  static const unsigned long maxsize = (1<<16)-1;
 };
 
 #define RETURN(CODE,STR) return response(response::CODE, STR)

File Added: pkgsrc/mail/vmailmgr-base/patches/patch-lib_vpwtable_cdb__write.cc
$NetBSD: patch-lib_vpwtable_cdb__write.cc,v 1.1 2024/02/25 12:09:22 schmonz Exp $

Fix warnings.

--- lib/vpwtable/cdb_write.cc.orig	2024-02-20 03:14:13.278367363 +0000
+++ lib/vpwtable/cdb_write.cc
@@ -23,8 +23,8 @@
 class cdb_vpwtable_writer : public vpwtable_writer
 {
 private:
-  const mystring& tmpname;
-  const mystring& cdbname;
+  const mystring tmpname;
+  const mystring cdbname;
   cdb_writer out;
   bool opened;
 public:

File Added: pkgsrc/mail/vmailmgr-base/patches/patch-lib_vpwtable_gdbm__del.cc
$NetBSD: patch-lib_vpwtable_gdbm__del.cc,v 1.1 2024/02/25 12:09:22 schmonz Exp $

Patch from FreeBSD ports.

--- lib/vpwtable/gdbm_del.cc.orig	2024-02-20 03:20:54.978827529 +0000
+++ lib/vpwtable/gdbm_del.cc
@@ -23,7 +23,7 @@ bool vpwtable::del(const mystring& name)
   GDBM_FILE db = gdbm_open((char*)filename.c_str(), 0, GDBM_WRITER, 0, 0);
   if(!db)
     return false;
-  datum key = { (char*)name.c_str(), name.length() };
+  datum key = { (char*)name.c_str(), static_cast<int>(name.length()) };
   bool result = gdbm_delete(db, key) == 0;
   gdbm_close(db);
   return result;

File Added: pkgsrc/mail/vmailmgr-base/patches/patch-lib_vpwtable_gdbm__exists.cc
$NetBSD: patch-lib_vpwtable_gdbm__exists.cc,v 1.1 2024/02/25 12:09:22 schmonz Exp $

Patch from FreeBSD ports.

--- lib/vpwtable/gdbm_exists.cc.orig	2024-02-20 03:21:16.821104286 +0000
+++ lib/vpwtable/gdbm_exists.cc
@@ -23,7 +23,7 @@ bool vpwtable::exists(const mystring& na
   GDBM_FILE db = gdbm_open((char*)filename.c_str(), 0, GDBM_READER, 0, 0);
   if(!db)
     return false;
-  datum key = { (char*)name.c_str(), name.length() };
+  datum key = { (char*)name.c_str(), static_cast<int>(name.length()) };
   bool result = gdbm_exists(db, key);
   gdbm_close(db);
   return result;

File Added: pkgsrc/mail/vmailmgr-base/patches/patch-lib_vpwtable_gdbm__getbyname.cc
$NetBSD: patch-lib_vpwtable_gdbm__getbyname.cc,v 1.1 2024/02/25 12:09:22 schmonz Exp $

Patch from FreeBSD ports.

--- lib/vpwtable/gdbm_getbyname.cc.orig	2024-02-20 03:21:36.626537464 +0000
+++ lib/vpwtable/gdbm_getbyname.cc
@@ -24,7 +24,7 @@ vpwentry* vpwtable::getbyname(const myst
   if(!db)
     return 0;
   mystring lower = name.lower();
-  datum key = { (char*)lower.c_str(), lower.length() };
+  datum key = { (char*)lower.c_str(), static_cast<int>(lower.length()) };
   datum result = gdbm_fetch(db, key);
   gdbm_close(db);
   return vpwentry::new_from_record(name, mystring(result.dptr, result.dsize));

File Added: pkgsrc/mail/vmailmgr-base/patches/patch-lib_vpwtable_gdbm__put.cc
$NetBSD: patch-lib_vpwtable_gdbm__put.cc,v 1.1 2024/02/25 12:09:22 schmonz Exp $

Patch from FreeBSD ports.

--- lib/vpwtable/gdbm_put.cc.orig	2024-02-20 03:21:52.065572565 +0000
+++ lib/vpwtable/gdbm_put.cc
@@ -25,9 +25,9 @@ bool vpwtable::put(const vpwentry* vpw,
   if(!db)
     return false;
   mystring name = vpw->name.lower();
-  datum key = { (char*)name.c_str(), name.length() };
+  datum key = { (char*)name.c_str(), static_cast<int>(name.length()) };
   mystring binary = vpw->to_record();
-  datum data = { (char*)binary.c_str(), binary.length() };
+  datum data = { (char*)binary.c_str(), static_cast<int>(binary.length()) };
   bool result = gdbm_store(db, key, data,
 			   onlyadd ? GDBM_INSERT : GDBM_REPLACE) == 0;
   gdbm_close(db);

File Added: pkgsrc/mail/vmailmgr-base/patches/patch-lib_vpwtable_gdbm__write.cc
$NetBSD: patch-lib_vpwtable_gdbm__write.cc,v 1.1 2024/02/25 12:09:22 schmonz Exp $

Patch from FreeBSD ports.

--- lib/vpwtable/gdbm_write.cc.orig	2015-09-01 16:03:21.000000000 +0000
+++ lib/vpwtable/gdbm_write.cc
@@ -16,14 +16,15 @@
 
 #include <config.h>
 #include <errno.h>
+#include <unistd.h>
 #include "vpwtable.h"
 #include <gdbm.h>
 
 class gdbm_vpwtable_writer : public vpwtable_writer
 {
 private:
-  const mystring& tmpname;
-  const mystring& destname;
+  const mystring tmpname;
+  const mystring destname;
   GDBM_FILE out;
   bool opened;
 public:
@@ -59,10 +60,10 @@ bool gdbm_vpwtable_writer::operator!() c
 
 bool gdbm_vpwtable_writer::put(const vpwentry& vpw)
 {
-  mystring name = vpw->name.lower();
-  datum key = { (char*)name.c_str(), name.length() };
-  mystring binary = vpw->to_record();
-  datum data = { (char*)binary.c_str(), binary.length() };
+  mystring name = vpw.name.lower();
+  datum key = { (char*)name.c_str(), static_cast<int>(name.length()) };
+  mystring binary = vpw.to_record();
+  datum data = { (char*)binary.c_str(), static_cast<int>(binary.length()) };
   return gdbm_store(out, key, data, GDBM_INSERT) == 0;
 }
 

File Added: pkgsrc/mail/vmailmgr-base/patches/patch-python_Makefile.am

File Added: pkgsrc/mail/vmailmgr-cgi/DESCR
These are the VMailMgr CGI programs to setup a virtual domain, add and
delete individual virtual users and aliases, and to change passwords.

File Added: pkgsrc/mail/vmailmgr-cgi/Makefile
# $NetBSD: Makefile,v 1.1 2024/02/25 12:09:22 schmonz Exp $

.include "../../mail/vmailmgr/Makefile.common"

PKGNAME=		vmailmgr-cgi-${VERSION}
CATEGORIES=		mail www

MAINTAINER=		schmonz@NetBSD.org
HOMEPAGE=		https://untroubled.org/vmailmgr/
COMMENT=		Virtual domain manager for qmail (cgi programs)
LICENSE=		gnu-gpl-v2

CONFIGURE_ARGS+=	--enable-cgi

BUILD_DIRS=		lib cgi
INSTALL_DIRS=		cgi

.include "../../mk/bsd.pkg.mk"

File Added: pkgsrc/mail/vmailmgr-cgi/PLIST
@comment $NetBSD: PLIST,v 1.1 2024/02/25 12:09:22 schmonz Exp $
libexec/cgi-bin/listvdomain
libexec/cgi-bin/vaddalias
libexec/cgi-bin/vadduser
libexec/cgi-bin/vchattr
libexec/cgi-bin/vchforwards
libexec/cgi-bin/vdeluser
libexec/cgi-bin/vpasswd

File Added: pkgsrc/mail/vmailmgr-courier-imap/DESCR
This is the VMailMgr authentication module for Courier IMAP.

File Added: pkgsrc/mail/vmailmgr-courier-imap/Makefile
# $NetBSD: Makefile,v 1.1 2024/02/25 12:09:23 schmonz Exp $

.include "../../mail/vmailmgr/Makefile.common"

PKGNAME=		vmailmgr-courier-imap-${VERSION}
CATEGORIES=		mail security

MAINTAINER=		schmonz@NetBSD.org
HOMEPAGE=		https://untroubled.org/vmailmgr/
COMMENT=		Virtual domain manager for qmail (Courier authentication)
LICENSE=		gnu-gpl-v2

CONFIGURE_ARGS+=	--enable-courier-imap

BUILD_DIRS=		lib authenticate
INSTALL_DIRS=		authenticate
INSTALL_TARGET=		install-authlibPROGRAMS

.include "../../mk/bsd.pkg.mk"

File Added: pkgsrc/mail/vmailmgr-courier-imap/PLIST
@comment $NetBSD: PLIST,v 1.1 2024/02/25 12:09:23 schmonz Exp $
libexec/courier-authlib/authvmailmgr

File Added: pkgsrc/mail/vmailmgr-docs/DESCR
This is additional documentation for VMailMgr.

File Added: pkgsrc/mail/vmailmgr-docs/Makefile
# $NetBSD: Makefile,v 1.1 2024/02/25 12:09:23 schmonz Exp $

.include "../../mail/vmailmgr/Makefile.common"

PKGNAME=		vmailmgr-docs-${VERSION}
CATEGORIES=		mail

MAINTAINER=		schmonz@NetBSD.org
HOMEPAGE=		https://untroubled.org/vmailmgr/
COMMENT=		Virtual domain manager for qmail (docs)
LICENSE=		gnu-gpl-v2

BUILD_TARGET=		docs
BUILD_DIRS+=		. authenticate

TOOL_DEPENDS+=		gtexinfo-[0-9]*:../../devel/gtexinfo
TOOL_DEPENDS+=		tex-texinfo-[0-9]*:../../print/tex-texinfo

INSTALLATION_DIRS=	share/doc/vmailmgr

do-install:
	cd ${WRKSRC}; \
	for f in AUTHORS ChangeLog COPYING NEWS TODO \
		doc/ChangeLog* doc/YEAR2000 doc/*.txt doc/*.html \
		commands/*.html authenticate/*.html daemon/*.html \
		scripts/autoresponder.sh; do \
		${INSTALL_DATA} $$f ${DESTDIR}${PREFIX}/share/doc/vmailmgr/`basename $$f`; \
	done

.include "../../lang/php/phpversion.mk"
.include "../../mk/bsd.pkg.mk"

File Added: pkgsrc/mail/vmailmgr-docs/PLIST
@comment $NetBSD: PLIST,v 1.1 2024/02/25 12:09:23 schmonz Exp $
share/doc/vmailmgr/AUTHORS
share/doc/vmailmgr/COPYING
share/doc/vmailmgr/ChangeLog
share/doc/vmailmgr/ChangeLog-pre-0.70
share/doc/vmailmgr/ChangeLog-pre-vmailmgr
share/doc/vmailmgr/ChangeLog.html
share/doc/vmailmgr/FAQ.html
share/doc/vmailmgr/FAQ.txt
share/doc/vmailmgr/HOWTO.html
share/doc/vmailmgr/HOWTO.txt
share/doc/vmailmgr/NEWS
share/doc/vmailmgr/NEWS.html
share/doc/vmailmgr/TODO
share/doc/vmailmgr/YEAR2000
share/doc/vmailmgr/autoresponder.sh
share/doc/vmailmgr/checkvpw.html
share/doc/vmailmgr/configuration.html
share/doc/vmailmgr/configuration.txt
share/doc/vmailmgr/dumpvuser.html
share/doc/vmailmgr/listvdomain.html
share/doc/vmailmgr/protocol-new.txt
share/doc/vmailmgr/protocol.txt
share/doc/vmailmgr/record-format.txt
share/doc/vmailmgr/vadduser.html
share/doc/vmailmgr/vaddusers.html
share/doc/vmailmgr/vauthenticate.html
share/doc/vmailmgr/vchattr.html
share/doc/vmailmgr/vchforwards.html
share/doc/vmailmgr/vdeliver.html
share/doc/vmailmgr/vdeluser.html
share/doc/vmailmgr/vmailmgr-cgi.html
share/doc/vmailmgr/vmailmgr-cgi.txt
share/doc/vmailmgr/vmailmgr.html
share/doc/vmailmgr/vmailmgrd.html
share/doc/vmailmgr/vpasswd.html
share/doc/vmailmgr/vpasswds.html
share/doc/vmailmgr/vrehash.html
share/doc/vmailmgr/vsetup.html
share/doc/vmailmgr/vupgrade.html