mail/vpopmail: Resurrect MYSQL option

- Pet portclippy/portfmt
- For now I have just added MySQL 8.0 in the supported variant. If other
  variant for MySQL works please reopen this ticket.

This reverts commit e3586087ed.

PR:		257672
Reported by:	tobias.niethammer@projektb.net
This commit is contained in:
Muhammad Moinur Rahman 2024-01-10 10:44:40 +01:00
parent d595a5ba24
commit 630c8e5c14
2 changed files with 135 additions and 127 deletions

View file

@ -14,19 +14,22 @@ LICENSE_COMB= dual
BUILD_DEPENDS= ${LOCALBASE}/bin/tcprules:sysutils/ucspi-tcp BUILD_DEPENDS= ${LOCALBASE}/bin/tcprules:sysutils/ucspi-tcp
RUN_DEPENDS= ${LOCALBASE}/bin/tcprules:sysutils/ucspi-tcp RUN_DEPENDS= ${LOCALBASE}/bin/tcprules:sysutils/ucspi-tcp
USES= dos2unix qmail gmake fakeroot USES= dos2unix fakeroot gmake qmail
DOS2UNIX_FILES= doc/README.vpopmaild DOS2UNIX_FILES= doc/README.vpopmaild
GNU_CONFIGURE= YES GNU_CONFIGURE= YES
CONFIGURE_ARGS= --enable-qmaildir=${QMAIL_PREFIX} \ CONFIGURE_ARGS= --enable-logging=${LOGLEVEL} \
--enable-non-root-build \
--enable-qmaildir=${QMAIL_PREFIX} \
--enable-tcprules-prog=${LOCALBASE}/bin/tcprules \ --enable-tcprules-prog=${LOCALBASE}/bin/tcprules \
--enable-tcpserver-file=${VPOPMAIL_DIR}/etc/tcp.smtp \ --enable-tcpserver-file=${VPOPMAIL_DIR}/etc/tcp.smtp \
--enable-non-root-build \ --enable-vpopgroup=nobody \
--enable-logging=${LOGLEVEL} \ --enable-vpopuser=nobody
--enable-vpopuser=nobody \ CONFIGURE_ENV+= ACLOCAL=true \
--enable-vpopgroup=nobody AUTOCONF=true \
CONFIGURE_ENV+= VCFGDIR="${VCFGDIR}" \ AUTOHEADER=true \
AUTOCONF=true ACLOCAL=true AUTOMAKE=true AUTOHEADER=true AUTOMAKE=true \
VCFGDIR="${VCFGDIR}"
INSTALL_TARGET= install-strip INSTALL_TARGET= install-strip
@ -37,119 +40,106 @@ PATCH_STRIP= -p1
USERS= vpopmail USERS= vpopmail
GROUPS= vchkpw GROUPS= vchkpw
OPTIONS_DEFINE= DOCS \ OPTIONS_DEFINE= AUTH_LOG CLEAR_PASSWD DOCS DOMAIN_QUOTAS FILE_LOCKING \
PASSWD \ FILE_SYNC IP_ALIAS LEARN_PASSWORDS MAILDROP \
MD5_PASSWORDS \ MD5_PASSWORDS MYSQL_LIMITS MYSQL_REPLICATION \
CLEAR_PASSWD \ ONCHANGE_SCRIPT PASSWD QMAIL_EXT ROAMING SEEKABLE \
LEARN_PASSWORDS \ SINGLE_DOMAIN SMTP_AUTH_PATCH SPAMASSASSIN SPAMFOLDER \
VALIAS \ SQL_LOG SQL_LOG_TRIM SUID_VCHKPW USERS_BIG_DIR VALIAS
ROAMING \ OPTIONS_DEFAULT= AUTH_LOG CDB FILE_LOCKING MD5_PASSWORDS ROAMING \
IP_ALIAS \ SEEKABLE USERS_BIG_DIR
QMAIL_EXT \ OPTIONS_SINGLE= AUTH
FILE_LOCKING \ OPTIONS_SINGLE_AUTH= CDB LDAP MYSQL ORACLE PGSQL SYBASE
FILE_SYNC \ OPTIONS_SUB= yes
USERS_BIG_DIR \
SEEKABLE \
SPAMASSASSIN \
SUID_VCHKPW \
SMTP_AUTH_PATCH \
ONCHANGE_SCRIPT \
MAILDROP \
DOMAIN_QUOTAS \
SPAMFOLDER \
SINGLE_DOMAIN \
AUTH_LOG \
SQL_LOG \
SQL_LOG_TRIM
OPTIONS_DEFAULT=MD5_PASSWORDS \
CDB \
ROAMING \
FILE_LOCKING \
USERS_BIG_DIR \
SEEKABLE \
AUTH_LOG
OPTIONS_SINGLE= AUTH
OPTIONS_SINGLE_AUTH= CDB PGSQL LDAP ORACLE SYBASE
OPTIONS_SUB= yes
AUTH_LOG_DESC= Log auth attempts when using a DB AUTH_LOG_DESC= Log auth attempts when using a DB
CDB_DESC= Auth via CDB CDB_DESC= Auth via CDB
CLEAR_PASSWD_DESC= Store passwords in plaintext CLEAR_PASSWD_DESC= Store passwords in plaintext
DOMAIN_QUOTAS_DESC= Domain quotas support DOMAIN_QUOTAS_DESC= Domain quotas support
FILE_LOCKING_DESC= file locking support FILE_LOCKING_DESC= file locking support
FILE_SYNC_DESC= fsync support (decreases performance) FILE_SYNC_DESC= fsync support (decreases performance)
IP_ALIAS_DESC= IP alias support IP_ALIAS_DESC= IP alias support
LDAP_DESC= Auth via LDAP LDAP_DESC= Auth via LDAP
LEARN_PASSWORDS_DESC= Learn passwords during POP auth LEARN_PASSWORDS_DESC= Learn passwords during POP auth
MAILDROP_DESC= Maildrop MDA support MAILDROP_DESC= Maildrop MDA support
MD5_PASSWORDS_DESC= Store passwords in MD5 format MD5_PASSWORDS_DESC= Store passwords in MD5 format
ONCHANGE_SCRIPT_DESC= vpopmail/etc/onchange script support MYSQL_DESC= Auth via MySQL
ORACLE_DESC= Auth via Oracle MYSQL_LIMITS_DESC= MySQL mailbox limitations support
PASSWD_DESC= /etc/passwd account support MYSQL_REPLICATION_DESC= MySQL database replication support
PGSQL_DESC= Auth via PostgreSQL ONCHANGE_SCRIPT_DESC= vpopmail/etc/onchange script support
QMAIL_EXT_DESC= qmail-like user-* address support ORACLE_DESC= Auth via Oracle
ROAMING_DESC= roaming users support PASSWD_DESC= /etc/passwd account support
SEEKABLE_DESC= Make input to vdelivermail seekable PGSQL_DESC= Auth via PostgreSQL
SINGLE_DOMAIN_DESC= Optimize for a single domain setup QMAIL_EXT_DESC= qmail-like user-* address support
SMTP_AUTH_PATCH_DESC= Swap Challenge/Response for CRAM-MD5 ROAMING_DESC= roaming users support
SPAMASSASSIN_DESC= SpamAssassin support SEEKABLE_DESC= Make input to vdelivermail seekable
SPAMFOLDER_DESC= Move spam to Junk (requires SA) SINGLE_DOMAIN_DESC= Optimize for a single domain setup
SQL_LOG_DESC= Log to selected SQL database SMTP_AUTH_PATCH_DESC= Swap Challenge/Response for CRAM-MD5
SQL_LOG_TRIM_DESC= Trim logs of deleted users/domains SPAMASSASSIN_DESC= SpamAssassin support
SUID_VCHKPW_DESC= Set vchkpw setugid vpopmail:vchkpw SPAMFOLDER_DESC= Move spam to Junk (requires SA)
SYBASE_DESC= Auth via Sybase SQL_LOG_DESC= Log to selected SQL database
USERS_BIG_DIR_DESC= Hashing user directories (BIGDIR) SQL_LOG_TRIM_DESC= Trim logs of deleted users/domains
VALIAS_DESC= Store aliases in DB instead of .qmail files SUID_VCHKPW_DESC= Set vchkpw setugid vpopmail:vchkpw
SYBASE_DESC= Auth via Sybase
USERS_BIG_DIR_DESC= Hashing user directories (BIGDIR)
VALIAS_DESC= Store aliases in DB instead of .qmail files
# Compatibility with older KNOB, correctly will enable if set, # Compatibility with older KNOB, correctly will enable if set,
# but be unset if unselected in the 'config' dialog # but be unset if unselected in the 'config' dialog
.if defined(WITH_POSTGRESQL) .if defined(WITH_MYSQL_LOG)
PORT_OPTIONS+= PGSQL PORT_OPTIONS+= SQL_LOG
.endif .endif
.if defined(WITH_PGSQL_LOG) .if defined(WITH_PGSQL_LOG)
PORT_OPTIONS+= SQL_LOG PORT_OPTIONS+= SQL_LOG
.endif .endif
.if defined(WITH_POSTGRESQL)
PORT_OPTIONS+= PGSQL
.endif
.if defined(WITH_SQL_LOG_REMOVE_DELETED) .if defined(WITH_SQL_LOG_REMOVE_DELETED)
PORT_OPTIONS+= SQL_LOG_TRIM PORT_OPTIONS+= SQL_LOG_TRIM
.endif .endif
AUTH_LOG_CONFIGURE_OFF= --disable-auth-logging
CLEAR_PASSWD_CONFIGURE_OFF= --disable-clear-passwd
DOMAIN_QUOTAS_CONFIGURE_ON= --enable-domainquotas=y DOMAIN_QUOTAS_CONFIGURE_ON= --enable-domainquotas=y
DOMAIN_QUOTAS_CONFIGURE_OFF= --enable-domainquotas=n DOMAIN_QUOTAS_CONFIGURE_OFF= --enable-domainquotas=n
PASSWD_CONFIGURE_ON= --enable-passwd
MD5_PASSWORDS_CONFIGURE_OFF= --disable-md5-passwords
VALIAS_CONFIGURE_ON= --enable-valias
CLEAR_PASSWD_CONFIGURE_OFF= --disable-clear-passwd
LEARN_PASSWORDS_CONFIGURE_ON= --enable-learn-passwords
LDAP_CONFIGURE_ON= --enable-auth-module=ldap
ORACLE_CONFIGURE_ON= --enable-auth-module=oracle
SYBASE_CONFIGURE_ON= --enable-auth-module=sybase
SINGLE_DOMAIN_CONFIGURE_ON= --disable-many-domains
IP_ALIAS_CONFIGURE_ON= --enable-ip-alias-domains
QMAIL_EXT_CONFIGURE_ON= --enable-qmail-ext
FILE_LOCKING_CONFIGURE_OFF= --disable-file-locking FILE_LOCKING_CONFIGURE_OFF= --disable-file-locking
FILE_SYNC_CONFIGURE_ON= --enable-file-sync FILE_SYNC_CONFIGURE_ON= --enable-file-sync
AUTH_LOG_CONFIGURE_OFF= --disable-auth-logging IP_ALIAS_CONFIGURE_ON= --enable-ip-alias-domains
USERS_BIG_DIR_CONFIGURE_OFF= --disable-users-big-dir LDAP_CONFIGURE_ON= --enable-auth-module=ldap
SEEKABLE_CONFIGURE_OFF= --disable-make-seekable LEARN_PASSWORDS_CONFIGURE_ON= --enable-learn-passwords
ROAMING_CONFIGURE_ON= --enable-roaming-users \
--enable-relay-clear-minutes=${RELAYCLEAR}
PGSQL_CONFIGURE_ON= --enable-auth-module=pgsql
SQL_LOG_CONFIGURE_ON= --enable-sql-logging
ONCHANGE_SCRIPT_CONFIGURE_ON= --enable-onchange-script
MAILDROP_CONFIGURE_ON= --enable-maildrop=y \
--enable-maildrop-prog=${LOCALBASE}/bin/maildrop
MAILDROP_CONFIGURE_OFF= --enable-maildrop=n
MAILDROP_RUN_DEPENDS= maildrop:${MAILDROP_PORT}
MAILDROP_BUILD_DEPENDS= maildrop:${MAILDROP_PORT} MAILDROP_BUILD_DEPENDS= maildrop:${MAILDROP_PORT}
MAILDROP_RUN_DEPENDS= maildrop:${MAILDROP_PORT}
SPAMASSASSIN_CONFIGURE_ON= --enable-spamassassin \ MAILDROP_CONFIGURE_ON= --enable-maildrop-prog=${LOCALBASE}/bin/maildrop \
--enable-spamc-prog=${LOCALBASE}/bin/spamc \ --enable-maildrop=y
--enable-spam-threshold=${SPAM_THRESHOLD} MAILDROP_CONFIGURE_OFF= --enable-maildrop=n
MD5_PASSWORDS_CONFIGURE_OFF= --disable-md5-passwords
MYSQL_CONFIGURE_ON= --enable-auth-module=mysql \
--enable-incdir=${LOCALBASE}/include/mysql \
--enable-libdir=${LOCALBASE}/lib/mysql
MYSQL_CFLAGS= -fcommon
MYSQL_VARS= IGNORE_WITH_MYSQL="105m 106m 1011m 81"
MYSQL_LIMITS_CONFIGURE_ON= --enable-mysql-limits
MYSQL_REPLICATION_CONFIGURE_ON= --enable-mysql-replication
ONCHANGE_SCRIPT_CONFIGURE_ON= --enable-onchange-script
ORACLE_CONFIGURE_ON= --enable-auth-module=oracle
PASSWD_CONFIGURE_ON= --enable-passwd
PGSQL_CONFIGURE_ON= --enable-auth-module=pgsql
QMAIL_EXT_CONFIGURE_ON= --enable-qmail-ext
ROAMING_CONFIGURE_ON= --enable-relay-clear-minutes=${RELAYCLEAR} \
--enable-roaming-users
SEEKABLE_CONFIGURE_OFF= --disable-make-seekable
SINGLE_DOMAIN_CONFIGURE_ON= --disable-many-domains
SPAMASSASSIN_BUILD_DEPENDS= spamc:mail/spamassassin SPAMASSASSIN_BUILD_DEPENDS= spamc:mail/spamassassin
SPAMASSASSIN_RUN_DEPENDS= spamc:mail/spamassassin SPAMASSASSIN_RUN_DEPENDS= spamc:mail/spamassassin
SPAMASSASSIN_CONFIGURE_ON= --enable-spam-threshold=${SPAM_THRESHOLD} \
--enable-spamassassin \
--enable-spamc-prog=${LOCALBASE}/bin/spamc
SPAMFOLDER_CONFIGURE_ON= --enable-spam-junkfolder SPAMFOLDER_CONFIGURE_ON= --enable-spam-junkfolder
SQL_LOG_CONFIGURE_ON= --enable-sql-logging
SYBASE_CONFIGURE_ON= --enable-auth-module=sybase
USERS_BIG_DIR_CONFIGURE_OFF= --disable-users-big-dir
VALIAS_CONFIGURE_ON= --enable-valias
VCFGDIR?= ${WRKDIR}/vcfg VCFGDIR?= ${WRKDIR}/vcfg
VCFGFILES?= inc_deps lib_deps tcp.smtp VCFGFILES?= inc_deps lib_deps tcp.smtp
@ -157,7 +147,7 @@ VCFGFILES?= inc_deps lib_deps tcp.smtp
.include <bsd.port.options.mk> .include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MSUID_VCHKPW} .if ${PORT_OPTIONS:MSUID_VCHKPW}
VCHKPW_MODE="6711" VCHKPW_MODE= "6711"
.endif .endif
PLIST_SUB+= VCHKPW_MODE="${VCHKPW_MODE}" PLIST_SUB+= VCHKPW_MODE="${VCHKPW_MODE}"
@ -217,14 +207,14 @@ PLIST_SUB+= VCHKPW_MODE="${VCHKPW_MODE}"
# VPOPMAIL_DIR - installation area for vpopmail (see comment below) # VPOPMAIL_DIR - installation area for vpopmail (see comment below)
# #
# #
RELAYCLEAR?= 30 RELAYCLEAR?= 30
SPAM_THRESHOLD?=15 SPAM_THRESHOLD?= 15
LOGLEVEL?= y LOGLEVEL?= y
MAILDROP_PORT?= mail/maildrop MAILDROP_PORT?= mail/maildrop
WITH_COURIER_IMAPLOGIN?= ${LOCALBASE}/sbin/imaplogin WITH_COURIER_IMAPLOGIN?= ${LOCALBASE}/sbin/imaplogin
WITH_VPOPMAIL_AUTHVCHKPW?= ${VPOPMAIL_DIR}/bin/authvchkpw WITH_VPOPMAIL_AUTHVCHKPW?= ${VPOPMAIL_DIR}/bin/authvchkpw
WITH_COURIER_IMAPD?= ${LOCALBASE}/bin/imapd WITH_COURIER_IMAPD?= ${LOCALBASE}/bin/imapd
WITH_ORACLE_PROC?= proc WITH_ORACLE_PROC?= proc
VPOPMAIL_DIR?= ${PREFIX}/vpopmail VPOPMAIL_DIR?= ${PREFIX}/vpopmail
# Uncomment this, or set PREFIX to /home if you have an existing # Uncomment this, or set PREFIX to /home if you have an existing
@ -236,18 +226,38 @@ VPOPMAIL_DIR?= ${PREFIX}/vpopmail
# End of user-configurable variables # End of user-configurable variables
.if ${PORT_OPTIONS:MLDAP} .if ${PORT_OPTIONS:MLDAP}
USES+= ldap USES+= ldap
LDAP_FILES= ${WRKSRC}/doc/README.ldap \ LDAP_FILES= ${WRKSRC}/doc/README.ldap ${WRKSRC}/ldap/nsswitch.conf \
${WRKSRC}/ldap/nsswitch.conf \ ${WRKSRC}/ldap/pam_ldap.conf ${WRKSRC}/ldap/pam_ldap.secret \
${WRKSRC}/ldap/pam_ldap.conf \ ${WRKSRC}/ldap/qmailUser.schema ${WRKSRC}/ldap/slapd.conf \
${WRKSRC}/ldap/pam_ldap.secret \ ${WRKSRC}/ldap/vpopmail.ldif
${WRKSRC}/ldap/qmailUser.schema \ .endif
${WRKSRC}/ldap/slapd.conf \
${WRKSRC}/ldap/vpopmail.ldif .if ${PORT_OPTIONS:MMYSQL}
USES+= mysql
.if defined(WITH_MYSQL_USER) || defined(WITH_MYSQL_READ_USER) || \
defined(WITH_MYSQL_UPDATE_USER)
BROKEN_MYSQL_PARAMS= true
.endif
.if defined(WITH_MYSQL_SERVER) || defined(WITH_MYSQL_READ_SERVER) || \
defined(WITH_MYSQL_UPDATE_SERVER)
BROKEN_MYSQL_PARAMS= true
.endif
.if defined(WITH_MYSQL_PASSWD) || defined(WITH_MYSQL_READ_PASSWD) || \
defined(WITH_MYSQL_UPDATE_PASSWD)
BROKEN_MYSQL_PARAMS= true
.endif
.if defined(WITH_MYSQL_DB)
BROKEN_MYSQL_PARAMS= true
.endif
.if defined(BROKEN_MYSQL_PARAMS)
BROKEN= The MySQL connection parameters are no longer setup at compile time - please edit the ${VPOPMAIL_DIR}/etc/vpopmail.mysql file instead
.endif
.endif .endif
.if defined(DEFAULT_DOMAIN) .if defined(DEFAULT_DOMAIN)
BROKEN= The default vpopmail domain is no longer setup at compile time - please edit the ${VPOPMAIL_DIR}/etc/defaultdomain file instead BROKEN= The default vpopmail domain is no longer setup at compile time - please edit the ${VPOPMAIL_DIR}/etc/defaultdomain file instead
.endif .endif
.if defined(WITH_APOP) .if defined(WITH_APOP)
@ -255,7 +265,7 @@ BROKEN= The WITH_APOP option is deprecated; set WITH_CLEAR_PASSWD instead, APOP
.endif .endif
.if ${PORT_OPTIONS:MPGSQL} .if ${PORT_OPTIONS:MPGSQL}
USES+= pgsql USES+= pgsql
.endif .endif
.if ${PORT_OPTIONS:MSQL_LOG_TRIM} .if ${PORT_OPTIONS:MSQL_LOG_TRIM}
@ -267,8 +277,8 @@ EXTRA_PATCHES+= ${FILESDIR}/vchkpw-smtp-auth.patch
.endif .endif
.if ${PORT_OPTIONS:MMAILDROP} .if ${PORT_OPTIONS:MMAILDROP}
MAILDROP_FILES= ${WRKSRC}/maildrop/maildroprc.v1 \ MAILDROP_FILES= ${WRKSRC}/maildrop/maildroprc.v1 \
${WRKSRC}/maildrop/maildroprc.v2 ${WRKSRC}/maildrop/maildroprc.v2
.endif .endif
.if empty(PORT_OPTIONS:MDOCS) .if empty(PORT_OPTIONS:MDOCS)
@ -280,14 +290,11 @@ EXTRA_PATCHES+= ${FILESDIR}/Makefile.in-noportdocs.patch
# #
# #
DOCS= README README.activedirectory README.filelocking \ DOCS= README README.activedirectory README.filelocking \
README.ipaliasdomains README.ldap README.maildrop \ README.ipaliasdomains README.ldap README.maildrop README.mysql \
README.mysql \ README.onchange README.oracle README.pgsql README.qmail-default \
README.onchange README.oracle README.pgsql \ README.quotas README.roamingusers README.spamassassin \
README.qmail-default README.quotas \ README.sybase README.vdelivermail README.vlimits \
README.roamingusers README.spamassassin README.sybase \ README.vpopmaild README.vpopmaild README.vqmaillocal UPGRADE
README.vdelivermail README.vlimits \
README.vpopmaild README.vpopmaild README.vqmaillocal \
UPGRADE
# #
# This port doesn't honour PREFIX, it honours vpopmail's home directory. # This port doesn't honour PREFIX, it honours vpopmail's home directory.

View file

@ -35,6 +35,7 @@ vpopmail/etc/lib_deps
@sample vpopmail/etc/vlimits.default-dist vpopmail/etc/vlimits.default @sample vpopmail/etc/vlimits.default-dist vpopmail/etc/vlimits.default
%%LDAP%%@sample vpopmail/etc/vpopmail.ldap-dist vpopmail/etc/vpopmail.ldap %%LDAP%%@sample vpopmail/etc/vpopmail.ldap-dist vpopmail/etc/vpopmail.ldap
%%LDAP%%@preexec echo "You need to specify the LDAP connection settings in the %D/vpopmail/etc/vpopmail.ldap file" | /usr/bin/fmt %%LDAP%%@preexec echo "You need to specify the LDAP connection settings in the %D/vpopmail/etc/vpopmail.ldap file" | /usr/bin/fmt
%%MYSQL%%@sample vpopmail/etc/vpopmail.mysql-dist vpopmail/etc/vpopmail.mysql
@sample vpopmail/etc/vusagec.conf-dist vpopmail/etc/vusagec.conf @sample vpopmail/etc/vusagec.conf-dist vpopmail/etc/vusagec.conf
@owner @owner
@group @group