diff options
author | Peter Pentchev <roam@FreeBSD.org> | 2007-10-09 13:27:24 +0000 |
---|---|---|
committer | Peter Pentchev <roam@FreeBSD.org> | 2007-10-09 13:27:24 +0000 |
commit | e9bbf68245cc4f7d015e463b5c0c95008fd382e3 (patch) | |
tree | 4e554e277b9e2d6553310aafc50c4d3cda2e3fb7 /mail/vpopmail | |
parent | - unbreak option FIDOGATE_RUNAS (diff) |
Update vpopmail to 5.4.20 after a long delay, mostly due to wondering
how to handle the database upgrade and the SpamAssassin patch partial
integration.
There are several important changes that may affect your vpopmail
installation and may need you to handle manually:
- THE MYSQL CONNECTION INFORMATION IS NO LONGER DEFINED AT COMPILE-TIME!
The WITH_MYSQL_{USER,PASSWD,SERVER,DB} variables should NOT be defined
when you build the port; place that information in the vpopmail.mysql
file after vpopmail has been installed!
- the default domain is also no longer defined at compile time - you need
to place it in the defaultdomain file after the installation.
- the defaultdomain and vpopmail.mysql files are no longer blindly removed
on deinstallation, they are only removed if they have not been modified
- in vpopmail 5.4.18, the database schema was changed - some fields were
extended from 64 to 96 characters. If you do not apply those changes
to your database, as explained in the vpopmail/doc/UPGRADE file, your
vpopmail installation may silently fail or lose the trailing portions
of domain names and usernames.
- in vpopmail 5.4.19, the upstream authors integrated large parts of
Alex Dupre's SpamAssassin support, without the SPAM_THRESHOLD part.
If you use vpopmail along with the SpamAssassin FreeBSD port support,
take extra care to ensure that your installation still processes
e-mail messages in the same way.
- vpopmail 5.4.19 added support for maildrop as a mail delivery agent.
This is available in the FreeBSD port if WITH_MAILDROP is defined.
There is also a new user-limit flag for maildrop delivery.
- vpopmail 5.4.19 added support for MySQL connections via Unix sockets
instead of TCP sockets to the server. To do that, change the second
value (the port number) in vpopmail.mysql to the full pathname of
the MySQL socket (e.g. /tmp/mysql.sock).
- vpopmail 5.4.20 extended the LDAP support; please see README.ldap for
more information, and specify the LDAP connection information in
the vpopmail/etc/vpopmail.ldap file after the installation.
Notes
Notes:
svn path=/head/; revision=201173
Diffstat (limited to 'mail/vpopmail')
-rw-r--r-- | mail/vpopmail/Makefile | 124 | ||||
-rw-r--r-- | mail/vpopmail/distinfo | 6 | ||||
-rw-r--r-- | mail/vpopmail/files/Makefile.in-noportdocs.patch | 15 | ||||
-rw-r--r-- | mail/vpopmail/files/patch-Makefile.in | 44 | ||||
-rw-r--r-- | mail/vpopmail/files/patch-README.onchange | 12 | ||||
-rw-r--r-- | mail/vpopmail/files/patch-README.vdelivermail | 12 | ||||
-rw-r--r-- | mail/vpopmail/files/patch-README.vpopmaild | 106 | ||||
-rw-r--r-- | mail/vpopmail/files/patch-config.h.in | 15 | ||||
-rw-r--r-- | mail/vpopmail/files/patch-configure | 115 | ||||
-rw-r--r-- | mail/vpopmail/files/patch-vchangepw.c | 31 | ||||
-rw-r--r-- | mail/vpopmail/files/patch-vchkpw.c | 19 | ||||
-rw-r--r-- | mail/vpopmail/files/patch-vdeldomain.c | 12 | ||||
-rw-r--r-- | mail/vpopmail/files/patch-vdelivermail.c | 341 | ||||
-rw-r--r-- | mail/vpopmail/files/patch-vpalias.c | 116 | ||||
-rw-r--r-- | mail/vpopmail/files/patch-vpgsql.c | 16 | ||||
-rw-r--r-- | mail/vpopmail/files/patch-vpopmail.c | 237 | ||||
-rw-r--r-- | mail/vpopmail/files/patch-vqmaillocal.c | 12 | ||||
-rw-r--r-- | mail/vpopmail/pkg-plist | 24 |
18 files changed, 283 insertions, 974 deletions
diff --git a/mail/vpopmail/Makefile b/mail/vpopmail/Makefile index 84fc1dfec134..9ba7579674aa 100644 --- a/mail/vpopmail/Makefile +++ b/mail/vpopmail/Makefile @@ -6,8 +6,7 @@ # PORTNAME= vpopmail -PORTVERSION= 5.4.17 -PORTREVISION= 1 +PORTVERSION= 5.4.20 CATEGORIES= mail MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= ${PORTNAME} @@ -29,10 +28,12 @@ USE_PERL5= YES VCFGDIR?= ${WRKDIR}/vcfg VCFGFILES?= inc_deps lib_deps tcp.smtp -CONFIGURE_ENV+= VCFGDIR="${VCFGDIR}" +CONFIGURE_ENV+= VCFGDIR="${VCFGDIR}" \ + AUTOCONF=true ACLOCAL=true AUTOMAKE=true AUTOHEADER=true CONFIGURE_ARGS= --enable-qmaildir=${QMAIL_PREFIX} \ --enable-tcprules-prog=${LOCALBASE}/bin/tcprules \ - --enable-tcpserver-file=${PREFIX}/vpopmail/etc/tcp.smtp + --enable-tcpserver-file=${PREFIX}/vpopmail/etc/tcp.smtp \ + --enable-non-root-build CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL} # @@ -62,7 +63,11 @@ CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL} # WITH_SPAMASSASSIN - enable SpamAssassin checks before Maildir delivery # WITH_SUID_VCHKPW - set the setuid bit on the vchkpw program # WITH_SMTP_AUTH_PATCH - apply an SMTP authentcation fix +# WITH_ONCHANGE_SCRIPT - enable the use of the $PREFIX/vpopmail/etc/onchange +# script, see README.onchange for more information. # WITHOUT_FPIC - do not add -fPIC to the C compiler flags +# WITH_MAILDROP - enable maildrop as an MDA (see README.maildrop) +# MAILDROP_PORT - the port that provides the bin/maildrop program # # Set these to the values you'd prefer # @@ -83,20 +88,6 @@ CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL} # VCHKPW_GID - the group ID of the new vchkpw group (89) # VPOPMAIL_UID - the user ID of the new vpopmail user (89) # -# MySQL database configuration options -# -# WITH_MYSQL_SERVER - the hostname of the MySQL server (localhost) -# WITH_MYSQL_USER - the username for connecting to the MySQL server (root) -# WITH_MYSQL_PASSWD - the password for connecting to the MySQL server (secret) -# WITH_MYSQL_DB - the name of the MySQL database to use (vpopmail) -# The server, user and password variables may be defined separately -# for read and update access, allowing you to set up a less-priviledged -# MySQL connection account with read-only access, and another one which -# is used for administrative purposes: -# WITH_MYSQL_READ_SERVER, WITH_MYSQL_READ_USER, WITH_MYSQL_READ_PASSWD -# WITH_MYSQL_UPDATE_SERVER, WITH_MYSQL_UPDATE_USER, WITH_MYSQL_UPDATE_PASSWD -# Those variables, if defined, override WITH_MYSQL_{SERVER,USER,PASSWD} -# # PostgreSQL database configuration options # # WITH_PGSQL_USER - the username for connecting to the PostgreSQL server (postgres) @@ -131,6 +122,7 @@ CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL} RELAYCLEAR?= 30 SPAM_THRESHOLD?=15 LOGLEVEL?= y +MAILDROP_PORT?= mail/maildrop .if defined(WITH_LDAP) USE_OPENLDAP= yes @@ -139,6 +131,9 @@ WANT_OPENLDAP_SASL= yes .endif CONFIGURE_ARGS+= --enable-auth-module=ldap LDAP_FILES= ${WRKSRC}/README.ldap \ + ${WRKSRC}/ldap/nsswitch.conf \ + ${WRKSRC}/ldap/pam_ldap.conf \ + ${WRKSRC}/ldap/pam_ldap.secret \ ${WRKSRC}/ldap/qmailUser.schema \ ${WRKSRC}/ldap/slapd.conf \ ${WRKSRC}/ldap/vpopmail.ldif @@ -162,16 +157,25 @@ WITH_SQL_LOG= yes CONFIGURE_ARGS+= --enable-mysql-limits .endif -WITH_MYSQL_SERVER?= localhost -WITH_MYSQL_READ_SERVER?= ${WITH_MYSQL_SERVER} -WITH_MYSQL_UPDATE_SERVER?= ${WITH_MYSQL_SERVER} -WITH_MYSQL_USER?= vpopmail -WITH_MYSQL_READ_USER?= ${WITH_MYSQL_USER} -WITH_MYSQL_UPDATE_USER?= ${WITH_MYSQL_USER} -WITH_MYSQL_PASSWD?= secret -WITH_MYSQL_READ_PASSWD?= ${WITH_MYSQL_PASSWD} -WITH_MYSQL_UPDATE_PASSWD?= ${WITH_MYSQL_PASSWD} -WITH_MYSQL_DB?= vpopmail +.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 ${PREFIX}/vpopmail/etc/vpopmail.mysql file instead +.endif +.endif + +.if defined(DEFAULT_DOMAIN) +BROKEN= The default vpopmail domain is no longer setup at compile time - please edit the ${PREFIX}/vpopmail/etc/defaultdomain file instead .endif .if defined(WITH_POSTGRESQL) @@ -198,6 +202,22 @@ EXTRA_PATCHES+= ${FILESDIR}/sql-remove-deleted.patch EXTRA_PATCHES+= ${FILESDIR}/vchkpw-smtp-auth.patch .endif +.if defined(WITH_ONCHANGE_SCRIPT) +CONFIGURE_ARGS+= --enable-onchange-script +.endif + +.if defined(WITH_MAILDROP) +CONFIGURE_ARGS+= --enable-maildrop=y \ + --enable-maildrop-prog=${LOCALBASE}/bin/maildrop +RUN_DEPENDS+= maildrop:${PORTSDIR}/${MAILDROP_PORT} +MAILDROP_FILES= ${WRKSRC}/maildrop/maildroprc.v1 \ + ${WRKSRC}/maildrop/maildroprc.v2 +PLIST_SUB+= MAILDROP="" +.else +CONFIGURE_ARGS+= --enable-maildrop=n +PLIST_SUB+= MAILDROP="@comment " +.endif + .if defined(NOPORTDOCS) EXTRA_PATCHES+= ${FILESDIR}/Makefile.in-noportdocs.patch .endif @@ -294,15 +314,20 @@ CONFIGURE_ARGS+= --disable-make-seekable .if defined(WITH_SPAMASSASSIN) BUILD_DEPENDS+= spamc:${PORTSDIR}/mail/p5-Mail-SpamAssassin -CONFIGURE_ARGS+= --enable-spamassassin=${LOCALBASE}/bin/spamc \ +CONFIGURE_ARGS+= --enable-spamassassin \ + --enable-spamc-prog=${LOCALBASE}/bin/spamc \ --enable-spam-threshold=${SPAM_THRESHOLD} .endif -DOCS= README README.filelocking \ - README.ipaliasdomains README.ldap README.mysql \ - README.oracle README.pgsql README.quotas \ - README.roamingusers README.sybase README.vlimits \ - README.vpopmaild README.vpopmaild README.vqmaillocal +DOCS= README README.activedirectory README.filelocking \ + README.ipaliasdomains README.ldap README.maildrop \ + README.mysql \ + README.onchange README.oracle README.pgsql \ + README.qmail-default README.quotas \ + README.roamingusers README.spamassassin README.sybase \ + README.vdelivermail README.vlimits \ + README.vpopmaild README.vpopmaild README.vqmaillocal \ + UPGRADE # # This port doesn't honour PREFIX, it honours vpopmail's home directory. @@ -364,14 +389,27 @@ post-install: else \ ${TOUCH} ${PREFIX}/vpopmail/etc/tcp.smtp-dist; \ fi; -.if defined(DEFAULT_DOMAIN) - ${ECHO_CMD} ${DEFAULT_DOMAIN} > ${PREFIX}/vpopmail/etc/defaultdomain -.endif + if [ ! -f ${PREFIX}/vpopmail/etc/tcp.smtp ]; then \ + ${INSTALL_DATA} ${PREFIX}/vpopmail/etc/tcp.smtp-dist ${PREFIX}/vpopmail/etc/tcp.smtp; \ + fi + if [ ! -f ${PREFIX}/vpopmail/etc/vlimits.default ]; then \ + ${INSTALL_DATA} ${PREFIX}/vpopmail/etc/vlimits.default-dist ${PREFIX}/vpopmail/etc/vlimits.default; \ + fi .if defined(WITH_MYSQL) - ${ECHO_CMD} "${WITH_MYSQL_READ_SERVER}|0|${WITH_MYSQL_READ_USER}|${WITH_MYSQL_READ_PASSWD}|${WITH_MYSQL_DB}" \ - >> ${PREFIX}/vpopmail/etc/vpopmail.mysql - ${ECHO_CMD} "${WITH_MYSQL_UPDATE_SERVER}|0|${WITH_MYSQL_UPDATE_USER}|${WITH_MYSQL_UPDATE_PASSWD}|${WITH_MYSQL_DB}" \ - >> ${PREFIX}/vpopmail/etc/vpopmail.mysql + if [ ! -f ${PREFIX}/vpopmail/etc/vpopmail.mysql ]; then \ + ${CP} ${PREFIX}/vpopmail/etc/vpopmail.mysql-dist ${PREFIX}/vpopmail/etc/vpopmail.mysql; \ + fi +.endif + ${TOUCH} ${PREFIX}/vpopmail/etc/defaultdomain +.if defined(WITH_LDAP) + @${ECHO_CMD} "# LDAP CONNECTION SETTINGS FOR VPOPMAIL" > ${PREFIX}/vpopmail/etc/vpopmail.ldap-dist + @${ECHO_CMD} "# Line format:" >> ${PREFIX}/vpopmail/etc/vpopmail.ldap-dist + @${ECHO_CMD} "# host|port|user|password|basedn" >> ${PREFIX}/vpopmail/etc/vpopmail.ldap-dist + @${ECHO_CMD} "localhost|389|cn=vpopmailuser, o=vpopmail|vpoppasswd|o=vpopmail" >> ${PREFIX}/vpopmail/etc/vpopmail.ldap-dist + if [ ! -f ${PREFIX}/vpopmail/etc/vpopmail.ldap ]; then \ + ${CP} ${PREFIX}/vpopmail/etc/vpopmail.ldap-dist ${PREFIX}/vpopmail/etc/vpopmail.ldap; \ + fi + @${ECHO_CMD} "You need to specify the LDAP connection settings in the ${PREFIX}/vpopmail/etc/vpopmail.ldap file" .endif ${CHOWN} -R vpopmail:vchkpw ${PREFIX}/vpopmail/bin/ ${PREFIX}/vpopmail/etc/ .if defined(WITH_SPAMASSASSIN) @@ -384,6 +422,10 @@ post-install: ${MKDIR} ${PREFIX}/vpopmail/ldap ${INSTALL_DATA} ${LDAP_FILES} ${PREFIX}/vpopmail/ldap .endif +.if defined(WITH_MAILDROP) + ${MKDIR} ${PREFIX}/vpopmail/maildrop + ${INSTALL_DATA} ${MAILDROP_FILES} ${PREFIX}/vpopmail/maildrop +.endif .if defined(WITH_SUID_VCHKPW) ${CHMOD} ug+s ${PREFIX}/vpopmail/bin/vchkpw .endif diff --git a/mail/vpopmail/distinfo b/mail/vpopmail/distinfo index de7179e08edc..ac16d848410a 100644 --- a/mail/vpopmail/distinfo +++ b/mail/vpopmail/distinfo @@ -1,3 +1,3 @@ -MD5 (vpopmail-5.4.17.tar.gz) = 4e4d815109ba7b8c38edad1afc7cc73a -SHA256 (vpopmail-5.4.17.tar.gz) = 5cb004c9ca911c0e20dac3dfdb9069fa491b617146907e60dc900bd8349ca956 -SIZE (vpopmail-5.4.17.tar.gz) = 454437 +MD5 (vpopmail-5.4.20.tar.gz) = c56e9c42cdb35860b25586fba088967f +SHA256 (vpopmail-5.4.20.tar.gz) = fa564a73007acbf81092c030329eac1394e981484c195a51a5c8bfbf7ed3f97e +SIZE (vpopmail-5.4.20.tar.gz) = 500268 diff --git a/mail/vpopmail/files/Makefile.in-noportdocs.patch b/mail/vpopmail/files/Makefile.in-noportdocs.patch index 8330444cb76b..79c6a88e2acb 100644 --- a/mail/vpopmail/files/Makefile.in-noportdocs.patch +++ b/mail/vpopmail/files/Makefile.in-noportdocs.patch @@ -1,7 +1,6 @@ -Index: Makefile.in -=================================================================== ---- Makefile.in (revision 548) -+++ Makefile.in (revision 550) +diff -urN -x .svn ../../freebsd-port/vpopmail/Makefile.in ./Makefile.in +--- ../../freebsd-port/vpopmail/Makefile.in Fri Jan 26 17:13:24 2007 ++++ ./Makefile.in Mon Jan 8 13:17:46 2007 @@ -863,7 +863,7 @@ @SET_MAKE@ @@ -11,10 +10,11 @@ Index: Makefile.in if test ! -d $(DESTDIR)@vpopmaildir@/$$d; then \ $(INSTALL) -d -g @vpopgroup@ -m 0755 -o @vpopuser@ \ $(DESTDIR)@vpopmaildir@/$$d ; \ -@@ -920,14 +920,6 @@ +@@ -919,14 +919,6 @@ + $(INSTALL) -o root -m 0444 $$include \ $(DESTDIR)@vpopmaildir@/include/ ; \ done - +- - $(INSTALL) -d $(DESTDIR)@vpopmaildir@/doc/man_html - $(INSTALL) -d $(DESTDIR)@vpopmaildir@/doc/doc_html - $(INSTALL) -o @vpopuser@ -m 0444 -g @vpopgroup@ \ @@ -22,7 +22,6 @@ Index: Makefile.in - - $(INSTALL) -o @vpopuser@ -m 0444 -g @vpopgroup@ \ - doc/doc_html/*.* $(DESTDIR)@vpopmaildir@/doc/doc_html/ -- + fix-priv: if test -r $(MYSQLCONF); then \ - chown @vpopuser@ $(MYSQLCONF) ; \ diff --git a/mail/vpopmail/files/patch-Makefile.in b/mail/vpopmail/files/patch-Makefile.in index 6b3a5f599775..17c45af7b093 100644 --- a/mail/vpopmail/files/patch-Makefile.in +++ b/mail/vpopmail/files/patch-Makefile.in @@ -1,37 +1,17 @@ -diff -urN -x .svn ../../vendor/vpopmail/Makefile.in ./Makefile.in ---- ../../vendor/vpopmail/Makefile.in Tue Oct 3 17:40:12 2006 -+++ ./Makefile.in Wed Oct 4 15:48:16 2006 -@@ -97,7 +97,7 @@ - +--- ../../vendor/vpopmail/Makefile.in 2007-10-07 23:44:14.000000000 +0300 ++++ Makefile.in 2007-10-08 16:26:04.000000000 +0300 +@@ -299,12 +299,11 @@ + noinst_HEADERS = md5.h vpopmail.h file_lock.h vauth.h vlimits.h maildirquota.h vcdb.h vldap.h vmysql.h voracle.h vpgsql.h vsybase.h vlog.h global.h hmac_md5.h seek.h COMMONSOURCES = vpopmail.c md5.c bigdir.c vauth.c file_lock.c vpalias.c seek.c vlimits.c maildirquota.c - --CONFIG_CLEAN_FILES = vauth.c -+CONFIG_CLEAN_FILES = vauth.c cdb/conf-cc cdb/conf-ld cdb/compile cdb/load - - MYSQLCONF = $(DESTDIR)@vpopmaildir@/etc/vpopmail.mysql - VLIMITS = $(DESTDIR)@vpopmaildir@/etc/vlimits.default -@@ -106,7 +106,6 @@ - + CONFIG_CLEAN_FILES = vauth.c cdb/conf-cc cdb/conf-ld cdb/compile cdb/load +-MYSQLCONF = $(DESTDIR)@vpopmaildir@/etc/vpopmail.mysql +-VLIMITS = $(DESTDIR)@vpopmaildir@/etc/vlimits.default ++MYSQLCONF = $(DESTDIR)@vpopmaildir@/etc/vpopmail.mysql-dist ++VLIMITS = $(DESTDIR)@vpopmaildir@/etc/vlimits.default-dist + noinst_LIBRARIES = libvpopmail.a libvpopmail_a_SOURCES = $(COMMONSOURCES) libvpopmail_a_LIBADD = cdb/*.o -libvpopmail_a_CFLAGS = -fPIC - vpopmailbindir = @vpopmaildir@/bin - vpopmailbin_PROGRAMS = vchkpw vdelivermail clearopensmtp vadddomain \ -@@ -880,6 +879,8 @@ - echo "-L@vpopmaildir@/lib -lvpopmail @auth_libs@ @LIBS@" > \ - $(DESTDIR)@vpopmaildir@/etc/lib_deps - -+ $(INSTALL) -o @vpopuser@ -m 0644 -g @vpopgroup@ \ -+ vlimits.default $(VLIMITS)-dist; \ - if test ! -r $(VLIMITS); then \ - $(INSTALL) -o @vpopuser@ -m 0644 -g @vpopgroup@ \ - vlimits.default $(VLIMITS); \ -@@ -897,7 +898,6 @@ - echo "# settings for each line:" >> $(MYSQLCONF); \ - echo "# host|port|user|password|database" >> $(MYSQLCONF); \ - echo "#" >> $(MYSQLCONF); \ -- echo "localhost|0|root|secret|vpopmail" >> $(MYSQLCONF); \ - echo "#" >> $(MYSQLCONF); \ - echo "# Note:" >> $(MYSQLCONF); \ - echo "# The value of host may be either a hostname or an IP address." >> $(MYSQLCONF); \ + vuserinfo_SOURCES = vuserinfo.c maildirquota.c + vuserinfo_LDADD = libvpopmail.a @auth_libs@ diff --git a/mail/vpopmail/files/patch-README.onchange b/mail/vpopmail/files/patch-README.onchange new file mode 100644 index 000000000000..6cb2d1912527 --- /dev/null +++ b/mail/vpopmail/files/patch-README.onchange @@ -0,0 +1,12 @@ +diff -urN -x .svn ../../vendor/vpopmail/README.onchange ./README.onchange +--- ../../vendor/vpopmail/README.onchange 2007-10-07 23:44:14.000000000 +0300 ++++ ./README.onchange 2007-10-08 11:53:54.000000000 +0300 +@@ -8,7 +8,7 @@ + only the inital call triggers the script. For example vadddomain uses + vadduser and vmoduser to create the postmaster user, and set its + attributes. Your script will be called once with cmd set to +-add_domain, and arg1 set to the domain being added. Bythe time the ++add_domain, and arg1 set to the domain being added. By the time the + script is called, the domain and the postmaster user have already + been created. + diff --git a/mail/vpopmail/files/patch-README.vdelivermail b/mail/vpopmail/files/patch-README.vdelivermail new file mode 100644 index 000000000000..34915ded9153 --- /dev/null +++ b/mail/vpopmail/files/patch-README.vdelivermail @@ -0,0 +1,12 @@ +diff -urN -x .svn ../../vendor/vpopmail/README.vdelivermail ./README.vdelivermail +--- ../../vendor/vpopmail/README.vdelivermail 2007-10-07 23:44:14.000000000 +0300 ++++ ./README.vdelivermail 2007-10-08 11:53:30.000000000 +0300 +@@ -57,7 +57,7 @@ + + If you are not sure what you are doing writing .qmail files, and mucking around + the internals of vpopmail, I strongly suggest you leave this file to the programs. +-Qmailadmin is probably the easiset way to manage the .qmail-default file once the ++Qmailadmin is probably the easiest way to manage the .qmail-default file once the + domain has been created. + + Due to the requirement that Maildirs accessed by vpopmail must be owned by vpopmail diff --git a/mail/vpopmail/files/patch-README.vpopmaild b/mail/vpopmail/files/patch-README.vpopmaild index 9b02a9cca357..227f83321619 100644 --- a/mail/vpopmail/files/patch-README.vpopmaild +++ b/mail/vpopmail/files/patch-README.vpopmaild @@ -1,27 +1,16 @@ -diff -urN -x .svn ../../../tags/vpopmail-5.4.14-stock/README.vpopmaild ./README.vpopmaild ---- ../../../tags/vpopmail-5.4.14-stock/README.vpopmaild Mon Oct 2 13:49:02 2006 -+++ ./README.vpopmaild Mon Oct 2 16:36:38 2006 -@@ -36,8 +36,8 @@ +diff -urN -x .svn ../../vendor/vpopmail/README.vpopmaild ./README.vpopmaild +--- ../../vendor/vpopmail/README.vpopmaild 2007-10-07 23:44:14.000000000 +0300 ++++ ./README.vpopmaild 2007-10-08 12:10:43.000000000 +0300 +@@ -243,7 +243,7 @@ Rights required: Must be a valid email address.
--Action: Verify the username and password of the persion desiring to
-- login, and set thier access rights.
-+Action: Verify the username and password of the person desiring to
-+ login, and set their access rights.
+-Action: Verify the username and password of the persion desiring to
++Action: Verify the username and password of the person desiring to
+ login, and set their access rights.
- If the compact option is given, bitmap values are returned
- as a single numeric value instead of a line for each bit
-@@ -62,7 +62,7 @@ - Rights required: SA_ADMIN, or QA_ADMIN
-
- Action: Delete a mailbox and user from the specified domain. ONLY SA_ADMIN
--can delete users to domains other than the home domain of the login user.
-+can delete users from domains other than the home domain of the login user.
-
-
- --------------------------------------------------------------------
-@@ -170,11 +170,11 @@ + For the "login" command, a successful login will return a
+@@ -386,7 +386,7 @@ The following values are returned as the character '1' or '0'. '1'
@@ -30,30 +19,7 @@ diff -urN -x .svn ../../../tags/vpopmail-5.4.14-stock/README.vpopmaild ./README. means the user can not change passwords.
no_password_change, no_pop, no_webmail, no_imap, bounce_mail, no_relay,
--no_dialup, user_flag_0, user_flag_1, user_flag_2, user_flag_3, no_smpt
-+no_dialup, user_flag_0, user_flag_1, user_flag_2, user_flag_3, no_smtp
-
-
- The following items confer extra privileges to the user. A '1' says that
-@@ -231,7 +231,7 @@ - Rights required: SA_ADMIN
-
- Action: return internal information about a domain. The information
--returned includes: domain directory, userid, groupid, number of users,
-+returned includes: domain directory, userid, groupid, number of users.
- If you ask for an alias domain, you will receive information for the
- parent domain. Part of that information will include a list of all
- alias names of the parent domain.
-@@ -313,7 +313,7 @@ - Maildir dir
- lastauth file
-
--The possible type values are: file, dir, chardev, plkdev, fifo,
-+The possible type values are: file, dir, chardev, blkdev, fifo,
- link, sock, unknown.
-
-
-@@ -381,7 +381,7 @@ +@@ -630,7 +630,7 @@ Rights required: SA_ADMIN
Action: List all domains on the system, and their parent domain.
@@ -62,47 +28,13 @@ diff -urN -x .svn ../../../tags/vpopmail-5.4.14-stock/README.vpopmaild ./README. When both are given, the data is broken up into pages with lines_per_page
lines on each. The page returned is specified by page.
-@@ -434,7 +434,7 @@ -
- Rights required: Anyone
-
--Action: Return the domain assoicated with this IP Address, if any.
-+Action: Return the domain associated with this IP Address, if any.
-
-
- --------------------------------------------------------------------
-@@ -476,7 +476,7 @@ - Rights required: Any. SA_ADMIN can read all domains, all other users
- can only read their own domain.
-
--Action: Return Limits informaiton for a domain. If no special limits
-+Action: Return Limits information for a domain. If no special limits
- are set, it returns the default limit settings for all domains.
- Find out where these files are kept, and add it here.
-
-@@ -550,7 +550,7 @@ -
- Rights required: SA_ADMIN
-
--Action: Delete the limits file for a domin. This will make the
-+Action: Delete the limits file for a domain. This will make the
- domain revert to the global limits set somewhere. (Find
- out where, and add it here.)
-
-@@ -674,14 +674,14 @@ - #define V_USER1 0x100
- #define V_USER2 0x200
- #define V_USER3 0x400
--After adding the NO_DIALUP flag we relalized there may be other
-+After adding the NO_DIALUP flag we realized there may be other
- flags people will want that are not directly used by any email code.
-
- #define NO_SMTP 0x800
- If set, do not allow smtp connections.
-
- #define QA_ADMIN 0x1000
--If set, the user is granted admin privilages in qmailadmin
-+If set, the user is granted admin privileges in qmailadmin
+@@ -1087,7 +1087,7 @@ + The actual error messages are stored in the file vpopmaild.msg for easy translation.
+ Once there are other language files, I'll create a directory to store the various
+ language files, and use a symlink to select a language. Error messages are set
+-at comile time.
++at compile time.
- #define V_OVERRIDE 0x2000
- If set, the user is not subject to domain limits. Part of the
+-0.X represents a message passed up from fpopmaild primitives, and does not otherwise
++0.X represents a message passed up from vpopmaild primitives, and does not otherwise
+ follow the standard error reporting structure. (yet?)
diff --git a/mail/vpopmail/files/patch-config.h.in b/mail/vpopmail/files/patch-config.h.in index 2fd10f54ddb9..e8f0cb561289 100644 --- a/mail/vpopmail/files/patch-config.h.in +++ b/mail/vpopmail/files/patch-config.h.in @@ -1,15 +1,12 @@ ---- config.h.in.orig Mon Feb 2 06:24:19 2004 -+++ config.h.in Mon Feb 2 09:33:51 2004 -@@ -238,6 +238,12 @@ - #undef QMAILDIR +--- ../../vendor/vpopmail/config.h.in 2007-10-07 19:56:55.000000000 +0300 ++++ config.h.in 2007-10-07 22:24:54.000000000 +0300 +@@ -277,6 +277,9 @@ + #undef SPAMC_PROG /* "" */ -+#undef SPAMC -+ -+/* "" */ +#undef SPAM_THRESHOLD + +/* "" */ - #undef QMAILINJECT + #undef SQWEBMAIL_PASS - /* "" */ + /* Define to 1 if you have the ANSI C header files. */ diff --git a/mail/vpopmail/files/patch-configure b/mail/vpopmail/files/patch-configure index 5939fb3f59f1..0c56a5188102 100644 --- a/mail/vpopmail/files/patch-configure +++ b/mail/vpopmail/files/patch-configure @@ -1,71 +1,15 @@ ---- configure.old Sun Nov 20 15:09:16 2005 -+++ configure Sun Nov 20 15:11:01 2005 -@@ -838,6 +838,8 @@ - --enable-qmail-newu=PATH Full path to qmail-newu program. - --enable-qmail-inject=PATH Full path to qmail-inject program. - --enable-qmail-newmrh=PATH Full path to qmail-newmrh program. -+ --enable-spamassassin=PATH Enable SpamAssassin. Full path to spamc program. default /usr/local/bin/spamc" -+ --enable-spam-threshold=# or n Automatically delete messages that score more than # spam hits" - --enable-vpopuser=USER User name allocated to vpopmail vpopmail. - --enable-vpopgroup=GROUP Group name allocated to vpopmail vchkpw. - --enable-roaming-users Enable POP-before-SMTP functionality. -@@ -4693,7 +4695,7 @@ - - #---------------------------------------------------------------------- - --if test `$idcommand` != "0" -+if false && test `$idcommand` != "0" - then - { echo "$as_me:$LINENO: WARNING: === vpopmail must be configured as root. ===" >&5 - echo "$as_me: WARNING: === vpopmail must be configured as root. ===" >&2;} -@@ -4823,6 +4825,46 @@ - ;; - esac - -+# Check whether --enable-spamassassin or --disable-spamassassin was given. -+if test "${enable_spamassassin+set}" = set; then -+ enableval="$enable_spamassassin" -+ spamc="$enableval" -+ -+ case $spamc in -+ 1*|y*|Y*) -+ spamc="/usr/local/bin/spamc" -+ ;; -+ esac -+ -+ if test ! -f "$spamc" -+ then -+ { echo "configure: error: Unable to find your spamc file, specify --enable-spamassassin=/full/path/to/spamc" 1>&2; exit 1; } -+ fi -+ -+ cat >> confdefs.h <<EOF -+#define SPAMC "$spamc" -+EOF -+ -+# Check whether --enable-spam-threshold or --disable-spam-threshold was given. -+if test "${enable_spam_threshold+set}" = set; then -+ enableval="$enable_spam_threshold" -+ ENABLE_SPAM_THRESHOLD=$enableval -+else -+ ENABLE_SPAM_THRESHOLD=0 -+fi -+ -+case $ENABLE_SPAM_THRESHOLD in -+0*|n*|N*) -+ ;; -+*) -+ cat >> confdefs.h <<EOF -+#define SPAM_THRESHOLD $ENABLE_SPAM_THRESHOLD -+EOF -+ -+ ;; -+esac -+fi -+ - #---------------------------------------------------------------------- - - echo "$as_me:$LINENO: checking whether we can locate the qmail directory" >&5 -@@ -5201,27 +5243,6 @@ +diff -urN -x .svn ../../../branches/vendor/vpopmail/configure ./configure +--- ../../../branches/vendor/vpopmail/configure 2007-10-07 19:56:56.000000000 +0300 ++++ ./configure 2007-10-07 21:55:00.298247000 +0300 +@@ -877,6 +877,7 @@ + --enable-onchange-script Enable onchange script. See README.onchange for more info. + --enable-spamassassin Enable spamassassin. See README.spamassassin for more info. + --enable-spamc-prog=PATH Full path to spamc program /usr/{local/}bin/spamc. ++ --enable-spam-threshold=# or n Automatically delete messages that score more than # spam hits + --enable-maildrop Enable maildrop. See README.maildrop for more info. + --enable-maildrop-prog=PATH Full path to maildrop program /usr/{local/}bin/maildrop. + --enable-domains-dir=TEXT Directory in ~vpopmail to store domains (default=domains). +@@ -5844,27 +5845,6 @@ #---------------------------------------------------------------------- @@ -93,7 +37,7 @@ echo "$as_me:$LINENO: checking whether roaming-users has been enabled" >&5 echo $ECHO_N "checking whether roaming-users has been enabled... $ECHO_C" >&6 # Check whether --enable-roaming-users or --disable-roaming-users was given. -@@ -5309,29 +5330,9 @@ +@@ -5952,29 +5932,9 @@ if test "${enable_tcpserver_file+set}" = set; then enableval="$enable_tcpserver_file" tcpserver_file="$enableval" @@ -124,7 +68,32 @@ echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 -@@ -5979,7 +5980,7 @@ +@@ -6483,6 +6443,24 @@ + #define SPAMC_PROG "$spamc_prog" + _ACEOF + ++# Check whether --enable-spam-threshold or --disable-spam-threshold was given. ++if test "${enable_spam_threshold+set}" = set; then ++ enableval="$enable_spam_threshold" ++ ENABLE_SPAM_THRESHOLD=$enableval ++else ++ ENABLE_SPAM_THRESHOLD=0 ++fi ++ ++case $ENABLE_SPAM_THRESHOLD in ++0*|n*|N*) ++ ;; ++*) ++ cat >> confdefs.h <<EOF ++#define SPAM_THRESHOLD $ENABLE_SPAM_THRESHOLD ++EOF ++ ++ ;; ++esac + + ;; + esac +@@ -6803,7 +6781,7 @@ #define USE_LDAP $USE_LDAP _ACEOF @@ -133,9 +102,9 @@ auth_inc="-I/usr/local/include" -@@ -8296,8 +8297,8 @@ - fi - fi +@@ -9389,8 +9367,8 @@ + ;; + esac -echo "${CC} -O2" > cdb/conf-cc -echo "${CC} -s" > cdb/conf-ld diff --git a/mail/vpopmail/files/patch-vchangepw.c b/mail/vpopmail/files/patch-vchangepw.c deleted file mode 100644 index 3e7d840d5ba5..000000000000 --- a/mail/vpopmail/files/patch-vchangepw.c +++ /dev/null @@ -1,31 +0,0 @@ -diff -urN -x .svn ../../vendor/vpopmail/vchangepw.c ./vchangepw.c ---- ../../vendor/vpopmail/vchangepw.c Wed Oct 4 13:19:16 2006 -+++ ./vchangepw.c Wed Oct 4 15:44:20 2006 -@@ -35,7 +35,7 @@ - - int main(void) - { -- int i; -+ int i, bad; - struct vqpasswd *vpw = NULL; - char Email[MAX_BUFF]; - char User[MAX_BUFF]; -@@ -53,9 +53,15 @@ - - fputs("Please enter the email address: ", stdout); - -- fgets(Email, sizeof(Email), stdin); -- i = strlen(Email) - 1; -- if (Email[i] != '\n') { -+ bad = 0; -+ if (fgets(Email, sizeof(Email), stdin) == NULL) { -+ bad = 1; -+ } else { -+ i = strlen(Email) - 1; -+ if (i < 0 || (Email[i] != '\n' && Email[i] != '\r')) -+ bad = 1; -+ } -+ if (bad) { - puts("Error: email address too long"); - return 3; - } diff --git a/mail/vpopmail/files/patch-vchkpw.c b/mail/vpopmail/files/patch-vchkpw.c deleted file mode 100644 index 5c81a50698e7..000000000000 --- a/mail/vpopmail/files/patch-vchkpw.c +++ /dev/null @@ -1,19 +0,0 @@ -diff -urN -x .svn ../../vendor/vpopmail/vchkpw.c ./vchkpw.c ---- ../../vendor/vpopmail/vchkpw.c Tue Oct 3 17:40:12 2006 -+++ ./vchkpw.c Tue Oct 3 17:58:48 2006 -@@ -761,9 +762,6 @@ - - int authapop(unsigned char *password, unsigned char *timestamp, unsigned char *clearpass) - { --#ifdef USE_ACTIVE_DIR -- return(-1); --#else - MD5_CTX context; - unsigned char digest[16]; - char encrypted[16*2+1]; -@@ -782,5 +780,4 @@ - *s = '\0'; - - return strcmp(password,encrypted); --#endif - } diff --git a/mail/vpopmail/files/patch-vdeldomain.c b/mail/vpopmail/files/patch-vdeldomain.c deleted file mode 100644 index d250f60ced47..000000000000 --- a/mail/vpopmail/files/patch-vdeldomain.c +++ /dev/null @@ -1,12 +0,0 @@ -diff -urN -x .svn ../../../tags/vpopmail-5.4.14-stock/vdeldomain.c ./vdeldomain.c ---- ../../../tags/vpopmail-5.4.14-stock/vdeldomain.c Mon Oct 2 13:49:02 2006 -+++ ./vdeldomain.c Mon Oct 2 16:36:38 2006 -@@ -67,7 +67,7 @@ - if (strcmp(entry->domain, entry->realdomain) != 0) { - aliases[aliascount++] = strdup(entry->domain); - } else { -- strcpy(parent,entry->domain); -+ snprintf(parent,sizeof(parent),"%s",entry->domain); - } - - entry = get_domain_entries(NULL); diff --git a/mail/vpopmail/files/patch-vdelivermail.c b/mail/vpopmail/files/patch-vdelivermail.c index d324a7f820f1..010b03d8c317 100644 --- a/mail/vpopmail/files/patch-vdelivermail.c +++ b/mail/vpopmail/files/patch-vdelivermail.c @@ -1,324 +1,21 @@ -diff -urN -x .svn ../../vendor/vpopmail/vdelivermail.c ./vdelivermail.c ---- ../../vendor/vpopmail/vdelivermail.c Wed Oct 4 13:19:16 2006 -+++ ./vdelivermail.c Wed Oct 4 15:44:20 2006 -@@ -66,6 +66,7 @@ - - #define FILE_SIZE 156 - char loop_buf[FILE_SIZE]; -+char spam_buf[FILE_SIZE]; - - #define MSG_BUF_SIZE 5000 - char msgbuf[MSG_BUF_SIZE]; -@@ -78,9 +79,6 @@ - #define EXIT_OK 0 - #define EXIT_OVERQUOTA EXIT_BOUNCE - --/* from qmail's wait.h for run_command() */ --#define wait_exitcode(w) ((w) >> 8) -- - /* Forward declarations */ - int process_valias(void); - void get_arguments(int argc, char **argv); -@@ -93,7 +91,10 @@ - void usernotfound(void); - int is_loop_match( const char *dt, const char *address); - int deliver_quota_warning(const char *dir, const char *q); -- -+#ifdef SPAM_THRESHOLD -+int is_spam(int threshold); -+int is_spam_match(char *xsl, int threshold); -+#endif - - /* print an error string and then exit - * vexit() never returns, so vexiterr() and vexit() should actually return void -@@ -201,7 +202,7 @@ - if ( is_domain_valid(TheDomain) != 0 ) - vexiterr (EXIT_BOUNCE, "invalid domain name"); - -- strncpy(TheUserFull, TheUser, sizeof(TheUserFull)); -+ snprintf (TheUserFull, sizeof(TheUserFull), "%s", TheUser); - - #ifdef QMAIL_EXT - /* !! Shouldn't this work its way backwards, and try all possibilities? -@@ -247,7 +248,7 @@ - - /* check for wildcard if there's no match */ - if(tmpstr == NULL) { -- for(i=strlen(TheUser);i >= 0 && j != 1;--i) { -+ for(i=strlen(TheUser);i > 0 && j != 1;--i) { - if(TheUser[i-1]=='-') { - tmpuser[0] = '\0'; - strncat(tmpuser,TheUser,i); -@@ -410,6 +411,10 @@ - char local_file_new[FILE_SIZE]; - size_t headerlen; - int write_fd; -+#ifdef SPAMC -+ int nread; -+ int pim[2]; -+#endif - char quota[80]; - - headerlen = strlen (extra_headers); -@@ -435,6 +440,49 @@ - return(-2); - } - -+#ifdef SPAMC -+ /* fork the SpamAssassin client - patch by Alex Dupre */ -+ if (!pipe(pim)) { -+ pid = vfork(); -+ switch (pid) { -+ case -1: -+ close(pim[0]); -+ close(pim[1]); -+ break; -+ case 0: -+ close(pim[0]); -+ dup2(pim[1], 1); -+ close(pim[1]); -+ if (execl(SPAMC, SPAMC, "-u", maildir_to_email(maildir), 0) == -1) { -+ while ((nread = read(0, msgbuf, MSG_BUF_SIZE)) > 0) -+ write(1, msgbuf, nread); -+ _exit(0); -+ } -+ } -+ close(pim[1]); -+ dup2(pim[0], 0); -+ close(pim[0]); -+ } -+#ifdef SPAM_THRESHOLD -+ /* silently delete message if spam level > SPAM_THRESHOLD */ -+ if (is_spam(SPAM_THRESHOLD) == 1) { -+ close(write_fd); -+ unlink(local_file_tmp); -+ return 0; -+ } -+ -+#ifdef MAKE_SEEKABLE -+ if (!Seekable(0)) -+ MakeSeekable(stdin); -+#endif -+ -+ if (lseek(0, 0L, SEEK_SET) < 0) { -+ printf("lseek errno=%d\n", errno); -+ return -2; -+ } -+#endif +diff -urN -x .svn ../../../branches/vendor/vpopmail/vdelivermail.c ./vdelivermail.c +--- ../../../branches/vendor/vpopmail/vdelivermail.c 2007-10-07 19:56:56.000000000 +0300 ++++ ./vdelivermail.c 2007-10-07 21:18:56.000000000 +0300 +@@ -1246,7 +1246,17 @@ + } + + /* still in the headers check for spam header */ ++#ifndef SPAM_THRESHOLD + if ( strncmp(&spambuf[j], "X-Spam-Flag: YES", 16 ) == 0 ) return(1); ++#else ++ if ( strncmp(&spambuf[j], "X-Spam-Level: ", 14 ) == 0 ) { ++ for (k = 0; k < SPAM_THRESHOLD; k++) { ++ if (spambuf[j + 14 + k] != '*') ++ return (0); ++ } ++ return(1); ++ } +#endif -+ - if (fdcopy (write_fd, read_fd, extra_headers, headerlen) != 0) { - /* Did the write fail because we were over quota? */ - if ( errno == EDQUOT ) { -@@ -549,10 +597,10 @@ - if (user_over_maildirquota(address,format_maildirquota(quota))==1) { - /* check for over quota message in domain */ -- sprintf(tmp_file, "%s/.over-quota.msg",TheDomainDir); -+ snprintf(tmp_file, sizeof(tmp_file), "%s/.over-quota.msg",TheDomainDir); - if ( (fs=fopen(tmp_file, "r")) == NULL ) { - /* if no domain over quota then check in vpopmail dir */ -- sprintf(tmp_file, "%s/%s/.over-quota.msg",VPOPMAILDIR,DOMAINS_DIR); -+ snprintf(tmp_file, sizeof(tmp_file), "%s/%s/.over-quota.msg",VPOPMAILDIR,DOMAINS_DIR); - fs=fopen(tmp_file, "r"); - } - -@@ -579,10 +627,10 @@ - if (domain_over_maildirquota(address)==1) - { - /* check for over quota message in domain */ -- sprintf(tmp_file, "%s/.over-quota.msg",TheDomainDir); -+ snprintf(tmp_file, sizeof(tmp_file), "%s/.over-quota.msg",TheDomainDir); - if ( (fs=fopen(tmp_file, "r")) == NULL ) { - /* if no domain over quota then check in vpopmail dir */ -- sprintf(tmp_file, "%s/%s/.over-quota.msg",VPOPMAILDIR,DOMAINS_DIR); -+ snprintf(tmp_file, sizeof(tmp_file), "%s/%s/.over-quota.msg",VPOPMAILDIR,DOMAINS_DIR); - fs=fopen(tmp_file, "r"); - } - -@@ -673,9 +721,12 @@ - } - - close(fdm); -- waitpid(inject_pid,&child,0); -- xcode = wait_exitcode(child); -- if (xcode == 0) return; -+ if (waitpid(inject_pid,&child,0) <= 0 || !WIFEXITED(child)) { -+ xcode = EXIT_DEFER; -+ } else { -+ xcode = WEXITSTATUS(child); -+ if (xcode == 0) return; -+ } - vexiterr (xcode, "system error calling qmail-inject"); - } - } -@@ -775,6 +826,7 @@ - printf("Unable to fork: %d.", errno); - vexit(EXIT_DEFER); - case 0: -+ setenv("SHELL", "/bin/sh", 1); - args[0] = "/bin/sh"; args[1] = "-c"; args[2] = prog; args[3] = 0; - sig_catch(SIGPIPE,SIG_DFL); - execv(*args,args); -@@ -782,9 +834,9 @@ - exit(EXIT_DEFER); /* the child's exit code will get caught below */ - } - -- wait(&wstat); -- waitpid(wstat,&child,0); -- switch(wait_exitcode(wstat)) -+ if (waitpid(child,&wstat,0) < 0 || !WIFEXITED(wstat)) -+ vexit(EXIT_DEFER); -+ switch(WEXITSTATUS(wstat)) - { - case 64: case 65: case 70: case 76: case 77: case 78: case 100: case 112: vexit(EXIT_BOUNCE); - case 99: vexit(99); /* not sure about this, when does it exit 99? */ -@@ -830,9 +882,13 @@ - - /* if we find the line, return error (looping) */ - if (is_loop_match(loop_buf, address)==1 ) { -+ /* seek to the end of stdin */ -+ fseek(stdin, 0L, SEEK_END); - /* return the loop found */ - return(1); - } else if (*loop_buf == '\r' || *loop_buf == '\n') { -+ /* seek to the end of stdin */ -+ fseek(stdin, 0L, SEEK_END); - /* end of headers return not found looping message value */ - return(0); - } -@@ -949,10 +1005,10 @@ - FILE *fs; - char tmp_file[256]; - -- sprintf(tmp_file, "%s/.no-user.msg",TheDomainDir); -+ snprintf(tmp_file, sizeof(tmp_file), "%s/.no-user.msg",TheDomainDir); - if ( (fs=fopen(tmp_file, "r")) == NULL ) { - /* if no domain no user then check in vpopmail dir */ -- sprintf(tmp_file, "%s/%s/.no-user.msg",VPOPMAILDIR,DOMAINS_DIR); -+ snprintf(tmp_file, sizeof(tmp_file), "%s/%s/.no-user.msg",VPOPMAILDIR,DOMAINS_DIR); - fs=fopen(tmp_file, "r"); - } - if ( fs == NULL ) { -@@ -999,7 +1055,7 @@ - struct stat sb; - char quotawarnmsg[BUFF_SIZE]; - -- sprintf (quotawarnmsg, "%s%s", dir, "/quotawarn"); -+ snprintf (quotawarnmsg, sizeof(quotawarnmsg), "%s%s", dir, "/quotawarn"); - time(&tm); - - /* Send only one warning every 24 hours */ -@@ -1017,12 +1073,12 @@ - close(fd); - - /* Look in the domain for a .quotawarn.msg */ -- sprintf(quotawarnmsg, "%s/.quotawarn.msg", TheDomainDir); -+ snprintf(quotawarnmsg, sizeof(quotawarnmsg), "%s/.quotawarn.msg", TheDomainDir); - if ( ((read_fd = open(quotawarnmsg, O_RDONLY)) < 0) || - (stat(quotawarnmsg, &sb) != 0)) { - - /* if that fails look in vpopmail dir */ -- sprintf(quotawarnmsg, "%s/%s/.quotawarn.msg", VPOPMAILDIR, DOMAINS_DIR); -+ snprintf(quotawarnmsg, sizeof(quotawarnmsg), "%s/%s/.quotawarn.msg", VPOPMAILDIR, DOMAINS_DIR); - if ( ((read_fd = open(quotawarnmsg, O_RDONLY)) < 0) || - (stat(quotawarnmsg, &sb) != 0)) { - return 0; -@@ -1063,3 +1119,97 @@ - - return (strcasecmp (compare, (dt+14)) == 0); - } -+ -+#ifdef SPAM_THRESHOLD -+/* Check for a spam message -+ * This is done by checking for a matching line -+ * in the email headers for X-Spam-Level: which -+ * we put in each spam email -+ * -+ * Return 1 if spam -+ * Return 0 if not spam -+ * Return -1 on error -+ */ -+int is_spam(int threshold) -+{ -+ int i; -+ int found; -+ -+#ifdef MAKE_SEEKABLE -+ if (!Seekable(0)) -+ MakeSeekable(stdin); -+#endif -+ -+ if ( lseek(0, 0L, SEEK_SET) < 0 ) { -+ printf("lseek errno=%d\n", errno); -+ return(-1); -+ } -+ -+ while (fgets(spam_buf, sizeof(spam_buf), stdin) != NULL){ -+ -+ /* if we find the line, return error (looping) */ -+ if (strncmp(spam_buf, "X-Spam-Level: ", 14) == 0 && -+ is_spam_match(spam_buf, threshold) ==1) { -+ -+ /* seek to the end of stdin */ -+ lseek(0, 0L, SEEK_END); -+ -+ /* return the spam found */ -+ return(1); -+ -+ /* check for the start of the body, we only need -+ * to check the headers. -+ */ -+ } else { -+ -+ /* walk through the charaters in the body */ -+ for (i = 0, found = 0; spam_buf[i] != 0 && found == 0; ++i) { -+ switch(spam_buf[i]) { -+ -+ /* skip blank spaces and new lines */ -+ case ' ': -+ case '\n': -+ case '\t': -+ case '\r': -+ break; -+ -+ /* found a non blank, so we are still -+ * in the headers -+ */ -+ default: -+ -+ /* set the found non blank char flag */ -+ found = 1; -+ break; -+ } -+ } -+ -+ /* if the line only had blanks, then it is the -+ * delimiting line between the headers and the -+ * body. We don't need to check the body for -+ * the X-Spam-Level: line. Hence, we -+ * are done with our search and can return the -+ * spam not found value -+ */ -+ if (found == 0) { -+ /* seek to the end of stdin */ -+ lseek(0, 0L, SEEK_END); -+ /* return not found spam message value */ -+ return(0); -+ } -+ } -+ } -+ -+ /* if we get here then there is either no body -+ * or SpamAssassin drop it, so mark the message -+ * as spam. -+ */ -+ return(1); -+} -+ -+int is_spam_match(char *xsl, int threshold) -+{ -+ if (strlen(xsl) - strlen("X-Spam-Level: ") > threshold) return(1); -+ else return(0); -+} -+#endif + if (spambuf[i+1]!=0) j=i+1; + } diff --git a/mail/vpopmail/files/patch-vpalias.c b/mail/vpopmail/files/patch-vpalias.c deleted file mode 100644 index 7d5d5f5b8968..000000000000 --- a/mail/vpopmail/files/patch-vpalias.c +++ /dev/null @@ -1,116 +0,0 @@ -diff -urN -x .svn ../../vendor/vpopmail/vpalias.c ./vpalias.c ---- ../../vendor/vpopmail/vpalias.c Wed Oct 4 13:19:16 2006 -+++ ./vpalias.c Wed Oct 4 17:14:57 2006 -@@ -160,6 +160,7 @@ - { - char *tmpstr; - char Dir[156]; -+ char *p; - uid_t uid; - gid_t gid; - int i; -@@ -174,8 +175,10 @@ - return(-1); - } - strncat(Dir, "/.qmail-", sizeof(Dir)-strlen(Dir)-1); -- for(i=0;alias[i]!=0;++i) if ( alias[i] == '.' ) alias[i] = ':'; -- strncat(Dir, alias, sizeof(Dir)-strlen(Dir)-1); -+ i = strlen(Dir); -+ for (p = alias; (i < (int)sizeof(Dir) - 1) && (*p != '\0'); p++) -+ Dir[i++] = (*p == '.' ? ':' : *p); -+ Dir[i] = '\0'; - return(unlink(Dir)); - } - -@@ -192,8 +195,8 @@ - gid_t gid; - int countit; - struct stat mystat; -- char filename[500]; -- int i, j, len; -+ char filename[500], **new_names; -+ int i, j, len, cnt_names; - - if ( domain == NULL ) { - verrori=VA_NULL_POINTER; -@@ -226,27 +229,8 @@ - * Its only a few bytes... - */ - -- if (mydir!=NULL) closedir(mydir); -- if ( (mydir = opendir(Dir)) == NULL ) return(NULL); -- -- while ((mydirent=readdir(mydir))!=NULL) { -- if ( strncmp(mydirent->d_name,".qmail-", 7) == 0 && -- strcmp(mydirent->d_name, ".qmail-default") != 0 ) { -- max_names++; -- } -- } -- -- /* Now we know about how many aliases there may be. -- * Allocate a buffer for them -- */ -- -- if (mydir!=NULL) { -- closedir(mydir); -- /* this is static and hence must be nulled incase max_names == 0 below */ -- mydir = NULL; -- } -- -- if (max_names == 0) return NULL; -+ max_names = 100; /* some kind of default... */ -+ num_names = 0; - - names = malloc( max_names * sizeof(char *)); - memset(names, 0, max_names * sizeof(char *)); -@@ -258,7 +242,7 @@ - strcmp(mydirent->d_name, ".qmail-default") != 0 ) { - - countit=0; -- sprintf(filename, "%s/%s", Dir, mydirent->d_name); -+ snprintf(filename, sizeof(filename), "%s/%s", Dir, mydirent->d_name); - - if(!lstat(filename, &mystat) && S_ISLNK(mystat.st_mode)) { - /* It is a mailing list */ -@@ -274,18 +258,39 @@ - } - - if(countit) { -+ if (num_names == max_names) { -+ // reallocate the array -+ cnt_names = 2 * max_names; -+ new_names = realloc( names, cnt_names * sizeof(char *) ); -+ if (new_names == NULL) { -+ for(i = 0; i < num_names; i++) -+ free(names[i]); -+ free(names); -+ return(NULL); -+ } -+ -+ // Okay, looks like we allocated enough memory -+ names = new_names; -+ max_names = cnt_names; -+ } - sprintf(filename, "%s", mydirent->d_name ); - len = strlen( filename ) - 7; - names[ num_names ] = malloc( len + 1 ); - for(i=7,j=0; j<=len; i++,j++) { -- names[num_names][j] = filename[i]; - if( ':' == filename[i] ) { - names[num_names][j] = '.'; -- } -+ } else { -+ names[num_names][j] = filename[i]; -+ } - } - num_names++; - } - } -+ } -+ if (num_names < max_names) { -+ new_names = realloc( names, num_names * sizeof(char *) ); -+ if (new_names != NULL) -+ names = new_names; - } - - if (mydir!=NULL) { diff --git a/mail/vpopmail/files/patch-vpgsql.c b/mail/vpopmail/files/patch-vpgsql.c index a1325d9a6bf5..7b78640d576b 100644 --- a/mail/vpopmail/files/patch-vpgsql.c +++ b/mail/vpopmail/files/patch-vpgsql.c @@ -1,15 +1,7 @@ diff -urN -x .svn ../../vendor/vpopmail/vpgsql.c ./vpgsql.c ---- ../../vendor/vpopmail/vpgsql.c Wed Oct 4 13:19:16 2006 -+++ ./vpgsql.c Sun Oct 8 17:20:54 2006 -@@ -16,6 +16,7 @@ - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - */ -+#include <ctype.h> - #include <pwd.h> - #include <unistd.h> - #include <stdio.h> -@@ -389,13 +390,15 @@ +--- ../../vendor/vpopmail/vpgsql.c Fri Jan 26 15:59:16 2007 ++++ ./vpgsql.c Fri Jan 26 17:01:33 2007 +@@ -390,13 +390,15 @@ #endif #ifdef ENABLE_SQL_LOGGING @@ -27,7 +19,7 @@ diff -urN -x .svn ../../vendor/vpopmail/vpgsql.c ./vpgsql.c return(0); } -@@ -442,13 +445,15 @@ +@@ -443,13 +445,15 @@ #endif #ifdef ENABLE_SQL_LOGGING diff --git a/mail/vpopmail/files/patch-vpopmail.c b/mail/vpopmail/files/patch-vpopmail.c index 7e65f247fac0..3f73d3a831a5 100644 --- a/mail/vpopmail/files/patch-vpopmail.c +++ b/mail/vpopmail/files/patch-vpopmail.c @@ -1,198 +1,45 @@ diff -urN -x .svn ../../vendor/vpopmail/vpopmail.c ./vpopmail.c ---- ../../vendor/vpopmail/vpopmail.c Wed Oct 4 13:19:16 2006 -+++ ./vpopmail.c Wed Oct 4 15:44:20 2006 -@@ -560,6 +560,8 @@ - if (entry.realdomain == NULL) continue; - - /* remove trailing '-' from entry.domain */ -+ if (entry.realdomain <= entry.domain + 2 || -+ *(entry.realdomain-2) != '-') continue; - *(entry.realdomain-2) = '\0'; - - if ((p = strtok (NULL, ":")) == NULL) continue; -@@ -1229,6 +1231,7 @@ - for(i=0;tmpbuf1[i]!=0;++i) { - if (tmpbuf1[i]=='\n') { - tmpbuf1[i]=0; -+ break; - } - } - -@@ -1239,6 +1242,7 @@ - if( 0 == strcmp(tmpbuf1,aliases[i])) { - doit=0; - // fprintf( stderr, " *** DELETE ***\n"); -+ break; - } - } - if( doit ) { -@@ -1381,7 +1385,7 @@ - execl(QMAILNEWU,"qmail-newu", NULL); - exit(127); - } else { -- wait(&pid); -+ waitpid(pid,&pid,0); - } - return(0); +--- ../../vendor/vpopmail/vpopmail.c 2007-10-07 23:44:14.000000000 +0300 ++++ ./vpopmail.c 2007-10-08 11:53:36.000000000 +0300 +@@ -1559,7 +1559,7 @@ + i++; + } + +-k = strlen(s) - i - 1; ++k = strlen(s) - i; + + if( i>0 ) { + for( j=0; j<k; j++ ) { +@@ -1571,7 +1571,7 @@ + + // trim spaces and tabs from end + i = strlen(s) - 1; +-while(( s[i] == ' ' ) || ( s[i] == '\t' )) { ++while(i >= 0 && ( s[i] == ' ' ) || ( s[i] == '\t' )) { + i--; + } + +@@ -4127,11 +4127,19 @@ + } + else if ( pid > 0 ) + { +- wait(&rv); +- return(rv); ++ if (waitpid ( pid, &rv, 0 ) < 0 || ++ !WIFEXITED( rv ) || WEXITSTATUS( rv ) != 0 ) { ++ fprintf(stderr, ++ "ONCHANGE script %s did not exit gracefully.\n", ++ path); ++ return(rv); ++ } ++ return(0); + } + +- fprintf(stderr, "ONCHANGE script %s unable to fork.\n", path); +- return(0); ++ rv = errno; ++ fprintf(stderr, "ONCHANGE script %s unable to fork: %s\n", path, ++ strerror(rv)); ++ return(rv); } -@@ -1633,7 +1637,8 @@ - - // If users/assign - need to delete last character - if( 1 == file_type ) { -- domain[--i] = 0; -+ if (i > 0) -+ domain[--i] = 0; - } else { - domain[i] = 0; - } -@@ -1679,9 +1684,7 @@ - i=i+2; - - // Clean out the domain variable -- for(j=0;j<MAX_BUFF;j++) { -- domain[j] = 0; -- } -+ memset(domain, 0, sizeof(domain)); - - // Get one last look at the array before assembling it - // for(j=0;j<i;j++) { -@@ -1738,9 +1741,7 @@ - int i, count=0; - char cur_domain[MAX_BUFF]; - -- sortrec sortdata[2000]; -- --// sortdata = malloc( file_lines * sizeof( sortrec )); -+ sortrec *sortdata = NULL; - - // fprintf( stderr, "\n***************************************\n" - // "sort_file: %s\n", filename ); -@@ -1761,8 +1762,8 @@ - #ifdef FILE_LOCKING - unlock_lock(fd3, 0, SEEK_SET, 0); - close(fd3); -- return(VA_COULD_NOT_UPDATE_FILE); - #endif -+ return(VA_COULD_NOT_UPDATE_FILE); - } - - snprintf(tmpbuf1, sizeof(tmpbuf1), "%s", filename); -@@ -1770,19 +1771,31 @@ - if ( (fs = fopen(tmpbuf1, "w+")) == NULL ) { - fclose(fs1); - #ifdef FILE_LOCKING -- close(fd3); - unlock_lock(fd3, 0, SEEK_SET, 0); -+ close(fd3); - #endif - return(VA_COULD_NOT_UPDATE_FILE); - } - } - -+ sortdata = malloc( file_lines * sizeof( sortrec )); -+ if (sortdata == NULL) { -+ fclose(fs); -+ fclose(fs1); -+#ifdef FILE_LOCKING -+ unlock_lock(fd3, 0, SEEK_SET, 0); -+ close(fd3); -+#endif -+ return(VA_MEMORY_ALLOC_ERR); -+ } -+ - while( fgets(tmpbuf1,sizeof(tmpbuf1),fs) != NULL ) { - - // Trim \n off end of line. - for(i=0;tmpbuf1[i]!=0;++i) { - if (tmpbuf1[i]=='\n') { - tmpbuf1[i]=0; -+ break; - } - } - -@@ -1793,6 +1806,22 @@ - - // fprintf( stderr, " Entry: %s\n", tmpbuf1 ); - -+ // A new entry; is the allocated memory enough? -+ if (count == file_lines) { -+ fclose(fs); -+ fclose(fs1); -+#ifdef FILE_LOCKING -+ unlock_lock(fd3, 0, SEEK_SET, 0); -+ close(fd3); -+#endif -+ for (i = 0; i < count; i++) { -+ free( sortdata[i].key ); -+ free( sortdata[i].value ); -+ } -+ free( sortdata ); -+ return(VA_MEMORY_ALLOC_ERR); -+ } -+ - extract_domain( cur_domain, tmpbuf1, file_type ); - - sortdata[count].key = strdup( cur_domain ); -@@ -1826,7 +1855,11 @@ - close(fd3); #endif - --// free( sortrec ); -+ for (i = 0; i < count; i++) { -+ free( sortdata[i].key ); -+ free( sortdata[i].value ); -+ } -+ free( sortdata ); - - return(0); - } -@@ -1893,6 +1926,7 @@ - for(i=0;tmpbuf1[i]!=0;++i) { - if (tmpbuf1[i]=='\n') { - tmpbuf1[i]=0; -+ break; - } - } - -@@ -2028,7 +2062,7 @@ - execl(QMAILNEWMRH,"qmail-newmrh", NULL); - exit(127); - } else { -- wait(&pid); -+ waitpid(pid,&pid,0); - } - return(0); - } -@@ -2406,7 +2440,7 @@ - - while( fgets(tmpbuf,sizeof(tmpbuf),fs) != NULL ) { - /* usually any newlines into nulls */ -- for(i=0;tmpbuf[i]!=0;++i) if (tmpbuf[i]=='\n') tmpbuf[i]=0; -+ for(i=0;tmpbuf[i]!=0;++i) if (tmpbuf[i]=='\n') { tmpbuf[i]=0; break; } - /* Michael Bowe 14th August 2003 - * What happens if domain isnt null terminated? - */ -@@ -2899,12 +2933,12 @@ - - int result; - --// NOTE: vopen_smpt_relay returns <0 on error 0 on duplicate 1 added -+// NOTE: vopen_smtp_relay returns <0 on error 0 on duplicate 1 added - // check for failure. - - /* store the user's ip address into the sql relay table */ - if (( result = vopen_smtp_relay()) < 0 ) { // database error -- vsqlerror( stderr, "Error. vopen_smpt_relay failed" ); -+ vsqlerror( stderr, "Error. vopen_smtp_relay failed" ); - return (verrori); - } else if ( result == 1 ) { - /* generate a new tcp.smtp.cdb file */ -@@ -3198,7 +3232,7 @@ - close(tcprules_fdm); - - /* wait untill tcprules finishes so we don't have zombies */ -- while(wait(&wstat)!= (int)pid); -+ waitpid(pid,&wstat,0); - - /* if tcprules encounters an error, then the tempfile will be - * left behind on the disk. We dont want this because we could diff --git a/mail/vpopmail/files/patch-vqmaillocal.c b/mail/vpopmail/files/patch-vqmaillocal.c deleted file mode 100644 index 350a2309c435..000000000000 --- a/mail/vpopmail/files/patch-vqmaillocal.c +++ /dev/null @@ -1,12 +0,0 @@ -diff -urN -x .svn ../../vendor/vpopmail/vqmaillocal.c ./vqmaillocal.c ---- ../../vendor/vpopmail/vqmaillocal.c Mon Oct 2 13:08:46 2006 -+++ ./vqmaillocal.c Wed Oct 4 15:44:20 2006 -@@ -672,7 +672,7 @@ - exit(-1); - } - -- wait(&wstat); -+ waitpid(child,&wstat,0); - - } - diff --git a/mail/vpopmail/pkg-plist b/mail/vpopmail/pkg-plist index 54ec3a819b4e..3612913b4f4b 100644 --- a/mail/vpopmail/pkg-plist +++ b/mail/vpopmail/pkg-plist @@ -39,27 +39,41 @@ vpopmail/bin/vuserinfo %%PORTDOCS%%vpopmail/doc/man_html/vpopbull.html %%PORTDOCS%%vpopmail/doc/man_html/vsetuserquota.html %%PORTDOCS%%vpopmail/doc/README +%%PORTDOCS%%vpopmail/doc/README.activedirectory %%PORTDOCS%%vpopmail/doc/README.filelocking %%PORTDOCS%%vpopmail/doc/README.ipaliasdomains %%PORTDOCS%%vpopmail/doc/README.ldap +%%PORTDOCS%%vpopmail/doc/README.maildrop %%PORTDOCS%%vpopmail/doc/README.mysql +%%PORTDOCS%%vpopmail/doc/README.onchange %%PORTDOCS%%vpopmail/doc/README.oracle %%PORTDOCS%%vpopmail/doc/README.pgsql +%%PORTDOCS%%vpopmail/doc/README.qmail-default %%PORTDOCS%%vpopmail/doc/README.quotas %%PORTDOCS%%vpopmail/doc/README.roamingusers +%%PORTDOCS%%vpopmail/doc/README.spamassassin %%PORTDOCS%%vpopmail/doc/README.sybase +%%PORTDOCS%%vpopmail/doc/README.vdelivermail %%PORTDOCS%%vpopmail/doc/README.vlimits %%PORTDOCS%%vpopmail/doc/README.vpopmaild %%PORTDOCS%%vpopmail/doc/README.vqmaillocal -@unexec if [ -f %D/vpopmail/etc/defaultdomain ]; then rm -f %D/vpopmail/etc/defaultdomain; fi +%%PORTDOCS%%vpopmail/doc/UPGRADE vpopmail/etc/inc_deps vpopmail/etc/lib_deps +@exec if [ ! -f %D/vpopmail/etc/defaultdomain ]; then touch %D/vpopmail/etc/defaultdomain; fi +@unexec if [ -f %D/vpopmail/etc/defaultdomain ] && [ ! -s %D/vpopmail/etc/defaultdomain ]; then rm -f %D/vpopmail/etc/defaultdomain; fi @unexec if cmp -s %D/vpopmail/etc/tcp.smtp %D/vpopmail/etc/tcp.smtp-dist; then rm -f %D/vpopmail/etc/tcp.smtp; fi vpopmail/etc/tcp.smtp-dist @exec if [ ! -f %D/vpopmail/etc/tcp.smtp ] ; then cp -p %D/%F %B/tcp.smtp; fi @unexec if cmp -s %D/vpopmail/etc/vlimits.default %D/vpopmail/etc/vlimits.default-dist; then rm -f %D/vpopmail/etc/vlimits.default; fi vpopmail/etc/vlimits.default-dist -@unexec if [ -f %D/vpopmail/etc/vpopmail.mysql ]; then rm -f %D/vpopmail/etc/vpopmail.mysql; fi +@exec if [ ! -f %D/vpopmail/etc/vlimits.default ] ; then cp -p %D/%F %B/vlimits.default; fi +%%LDAP%%@unexec if cmp -s %D/vpopmail/etc/vpopmail.ldap %D/vpopmail/etc/vpopmail.ldap-dist; then rm -f %D/vpopmail/etc/vpopmail.ldap; fi +%%LDAP%%vpopmail/etc/vpopmail.ldap-dist +%%LDAP%%@exec if [ ! -f %D/vpopmail/etc/vpopmail.ldap ] ; then cp -p %D/%F %B/vpopmail.ldap; fi +@unexec if cmp -s %D/vpopmail/etc/vpopmail.mysql %D/vpopmail/etc/vpopmail.mysql-dist; then rm -f %D/vpopmail/etc/vpopmail.mysql; fi +vpopmail/etc/vpopmail.mysql-dist +@exec if [ ! -f %D/vpopmail/etc/vpopmail.mysql ] ; then cp -p %D/%F %B/vpopmail.mysql; fi vpopmail/include/config.h vpopmail/include/vauth.h vpopmail/include/vlimits.h @@ -67,10 +81,16 @@ vpopmail/include/vpopmail.h vpopmail/include/vpopmail_config.h vpopmail/lib/libvpopmail.a %%LDAP%%vpopmail/ldap/README.ldap +%%LDAP%%vpopmail/ldap/nsswitch.conf +%%LDAP%%vpopmail/ldap/pam_ldap.conf +%%LDAP%%vpopmail/ldap/pam_ldap.secret %%LDAP%%vpopmail/ldap/qmailUser.schema %%LDAP%%vpopmail/ldap/slapd.conf %%LDAP%%vpopmail/ldap/vpopmail.ldif %%LDAP%%@dirrm vpopmail/ldap +%%MAILDROP%%vpopmail/maildrop/maildroprc.v1 +%%MAILDROP%%vpopmail/maildrop/maildroprc.v2 +%%MAILDROP%%@dirrm vpopmail/maildrop @dirrm vpopmail/lib @dirrm vpopmail/include @dirrmtry vpopmail/etc |