aboutsummaryrefslogtreecommitdiff
path: root/mail/vpopmail
diff options
context:
space:
mode:
authorPeter Pentchev <roam@FreeBSD.org>2006-10-05 11:49:17 +0000
committerPeter Pentchev <roam@FreeBSD.org>2006-10-05 11:49:17 +0000
commit215d42df82190ff033953b7973327265c1beda75 (patch)
tree495a98c1958cb11bb012f364490322006d5b3198 /mail/vpopmail
parent1854c2ed1d8bd952e3d46e00e8296483ccf4f444 (diff)
downloadports-215d42df82190ff033953b7973327265c1beda75.tar.gz
ports-215d42df82190ff033953b7973327265c1beda75.zip
Update to vpopmail-5.4.17. In the process:
- add a new knob, WITH_SQL_REMOVE_DELETED, for explicitly activating the new code for removing entries from the SQL log file when a user or domain is deleted; - add real NOPORTDOCS support and install the README.* files in addition to the doc_html/ and man_html/ directories if NOPORTDOCS is not set; - fix a couple of spelling and grammar errors in the new README.vpopmaild; - add several sanity checks; - remove the last traces of the ActiveDirectory backend; - various other minor changes.
Notes
Notes: svn path=/head/; revision=174531
Diffstat (limited to 'mail/vpopmail')
-rw-r--r--mail/vpopmail/Makefile19
-rw-r--r--mail/vpopmail/distinfo6
-rw-r--r--mail/vpopmail/files/Makefile.in-noportdocs.patch28
-rw-r--r--mail/vpopmail/files/patch-Makefile.in20
-rw-r--r--mail/vpopmail/files/patch-README.vpopmaild108
-rw-r--r--mail/vpopmail/files/patch-vchangepw.c31
-rw-r--r--mail/vpopmail/files/patch-vchkpw.c19
-rw-r--r--mail/vpopmail/files/patch-vdeldomain.c12
-rw-r--r--mail/vpopmail/files/patch-vdelivermail.c72
-rw-r--r--mail/vpopmail/files/patch-vmysql.c33
-rw-r--r--mail/vpopmail/files/patch-vpalias.c116
-rw-r--r--mail/vpopmail/files/patch-vpgsql.c43
-rw-r--r--mail/vpopmail/files/patch-vpopmail.c198
-rw-r--r--mail/vpopmail/files/patch-vqmaillocal.c12
-rw-r--r--mail/vpopmail/files/sql-remove-deleted.patch9
-rw-r--r--mail/vpopmail/files/vchkpw-smtp-auth.patch26
-rw-r--r--mail/vpopmail/pkg-plist52
17 files changed, 747 insertions, 57 deletions
diff --git a/mail/vpopmail/Makefile b/mail/vpopmail/Makefile
index c54b3678e423..9a6914d2e410 100644
--- a/mail/vpopmail/Makefile
+++ b/mail/vpopmail/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= vpopmail
-PORTVERSION= 5.4.13
+PORTVERSION= 5.4.17
CATEGORIES= mail
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
@@ -76,6 +76,7 @@ CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
# WITH_MYSQL_LOG - enable auth logging to a MySQL database [deprecateed]
# WITH_PGSQL_LOG - enable auth logging to a PostgreSQL database [deprecated]
# WITH_SQL_LOG - enable auth logging to the selected SQL database
+# WITH_SQL_LOG_REMOVE_DELETED - remove log entries for deleted users/domains
# QMAIL_PREFIX - location of qmail directory
# PREFIX - installation area for vpopmail (see comment below)
# VCHKPW_GID - the group ID of the new vchkpw group (89)
@@ -187,12 +188,19 @@ WITH_SQL_LOG= yes
.if defined(WITH_SQL_LOG)
CONFIGURE_ARGS+= --enable-sql-logging
+.if defined(WITH_SQL_LOG_REMOVE_DELETED)
+EXTRA_PATCHES+= ${FILESDIR}/sql-remove-deleted.patch
+.endif
.endif
.if defined(WITH_SMTP_AUTH_PATCH)
EXTRA_PATCHES+= ${FILESDIR}/vchkpw-smtp-auth.patch
.endif
+.if defined(NOPORTDOCS)
+EXTRA_PATCHES+= ${FILESDIR}/Makefile.in-noportdocs.patch
+.endif
+
.include <bsd.port.pre.mk>
.if !defined(WITHOUT_FPIC) && ${ARCH} == "amd64"
@@ -289,6 +297,12 @@ CONFIGURE_ARGS+= --enable-spamassassin=${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
+
#
# This port doesn't honour PREFIX, it honours vpopmail's home directory.
# Since we create vpopmail if it doesn't exist, we set it so that it
@@ -373,5 +387,8 @@ post-install:
${CHMOD} ug+s ${PREFIX}/vpopmail/bin/vchkpw
.endif
@${TOUCH} ${QMAIL_PREFIX}/control/locals
+.if !defined(NOPORTDOCS)
+ ${INSTALL_DATA} ${DOCS:S,^,${WRKSRC}/,} ${PREFIX}/vpopmail/doc/
+.endif
.include <bsd.port.post.mk>
diff --git a/mail/vpopmail/distinfo b/mail/vpopmail/distinfo
index 6b3917995fd8..de7179e08edc 100644
--- a/mail/vpopmail/distinfo
+++ b/mail/vpopmail/distinfo
@@ -1,3 +1,3 @@
-MD5 (vpopmail-5.4.13.tar.gz) = da0bf4dd773ec725171dc6d41ee4b3cd
-SHA256 (vpopmail-5.4.13.tar.gz) = 0cb13c797ef1dbfa858c237ed7002d9b943901d0fd8884b73d82f71936be5b97
-SIZE (vpopmail-5.4.13.tar.gz) = 434719
+MD5 (vpopmail-5.4.17.tar.gz) = 4e4d815109ba7b8c38edad1afc7cc73a
+SHA256 (vpopmail-5.4.17.tar.gz) = 5cb004c9ca911c0e20dac3dfdb9069fa491b617146907e60dc900bd8349ca956
+SIZE (vpopmail-5.4.17.tar.gz) = 454437
diff --git a/mail/vpopmail/files/Makefile.in-noportdocs.patch b/mail/vpopmail/files/Makefile.in-noportdocs.patch
new file mode 100644
index 000000000000..8330444cb76b
--- /dev/null
+++ b/mail/vpopmail/files/Makefile.in-noportdocs.patch
@@ -0,0 +1,28 @@
+Index: Makefile.in
+===================================================================
+--- Makefile.in (revision 548)
++++ Makefile.in (revision 550)
+@@ -863,7 +863,7 @@
+ @SET_MAKE@
+
+ install-exec-am:
+- for d in bin doc etc include lib ; do \
++ for d in bin etc include lib ; do \
+ if test ! -d $(DESTDIR)@vpopmaildir@/$$d; then \
+ $(INSTALL) -d -g @vpopgroup@ -m 0755 -o @vpopuser@ \
+ $(DESTDIR)@vpopmaildir@/$$d ; \
+@@ -920,14 +920,6 @@
+ $(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@ \
+- doc/man_html/*.* $(DESTDIR)@vpopmaildir@/doc/man_html/
+-
+- $(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 832a3ad85535..6b3a5f599775 100644
--- a/mail/vpopmail/files/patch-Makefile.in
+++ b/mail/vpopmail/files/patch-Makefile.in
@@ -1,6 +1,16 @@
---- Makefile.in.orig Sat Sep 17 02:37:34 2005
-+++ Makefile.in Thu Jun 15 16:58:59 2006
-@@ -101,7 +101,6 @@
+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 @@
+
+ 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 @@
libvpopmail_a_SOURCES = $(COMMONSOURCES)
libvpopmail_a_LIBADD = cdb/*.o
@@ -8,7 +18,7 @@
vpopmailbindir = @vpopmaildir@/bin
vpopmailbin_PROGRAMS = vchkpw vdelivermail clearopensmtp vadddomain \
-@@ -861,6 +860,8 @@
+@@ -880,6 +879,8 @@
echo "-L@vpopmaildir@/lib -lvpopmail @auth_libs@ @LIBS@" > \
$(DESTDIR)@vpopmaildir@/etc/lib_deps
@@ -17,7 +27,7 @@
if test ! -r $(VLIMITS); then \
$(INSTALL) -o @vpopuser@ -m 0644 -g @vpopgroup@ \
vlimits.default $(VLIMITS); \
-@@ -878,7 +879,6 @@
+@@ -897,7 +898,6 @@
echo "# settings for each line:" >> $(MYSQLCONF); \
echo "# host|port|user|password|database" >> $(MYSQLCONF); \
echo "#" >> $(MYSQLCONF); \
diff --git a/mail/vpopmail/files/patch-README.vpopmaild b/mail/vpopmail/files/patch-README.vpopmaild
new file mode 100644
index 000000000000..9b02a9cca357
--- /dev/null
+++ b/mail/vpopmail/files/patch-README.vpopmaild
@@ -0,0 +1,108 @@
+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 @@
+
+ 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.
+
+ 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 @@
+
+
+ The following values are returned as the character '1' or '0'. '1'
+-says the field is active which, for example an active no_password_change
++says the field is active - for example, an active no_password_change field
+ 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 @@
+ Rights required: SA_ADMIN
+
+ Action: List all domains on the system, and their parent domain.
+-If the optional page is given, lines_per_page must be specified also.
++If the optional page is given, lines_per_page must also be specified.
+ 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
+
+ #define V_OVERRIDE 0x2000
+ If set, the user is not subject to domain limits. Part of the
diff --git a/mail/vpopmail/files/patch-vchangepw.c b/mail/vpopmail/files/patch-vchangepw.c
new file mode 100644
index 000000000000..3e7d840d5ba5
--- /dev/null
+++ b/mail/vpopmail/files/patch-vchangepw.c
@@ -0,0 +1,31 @@
+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
new file mode 100644
index 000000000000..5c81a50698e7
--- /dev/null
+++ b/mail/vpopmail/files/patch-vchkpw.c
@@ -0,0 +1,19 @@
+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
new file mode 100644
index 000000000000..d250f60ced47
--- /dev/null
+++ b/mail/vpopmail/files/patch-vdeldomain.c
@@ -0,0 +1,12 @@
+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 1ecc5e8da01f..d324a7f820f1 100644
--- a/mail/vpopmail/files/patch-vdelivermail.c
+++ b/mail/vpopmail/files/patch-vdelivermail.c
@@ -1,5 +1,6 @@
---- vdelivermail.c.orig Fri Sep 2 20:47:29 2005
-+++ vdelivermail.c Sun Jul 2 15:17:29 2006
+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
@@ -8,7 +9,17 @@
#define MSG_BUF_SIZE 5000
char msgbuf[MSG_BUF_SIZE];
-@@ -93,7 +94,10 @@
+@@ -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);
@@ -20,7 +31,7 @@
/* print an error string and then exit
* vexit() never returns, so vexiterr() and vexit() should actually return void
-@@ -201,7 +205,7 @@
+@@ -201,7 +202,7 @@
if ( is_domain_valid(TheDomain) != 0 )
vexiterr (EXIT_BOUNCE, "invalid domain name");
@@ -29,7 +40,7 @@
#ifdef QMAIL_EXT
/* !! Shouldn't this work its way backwards, and try all possibilities?
-@@ -247,7 +251,7 @@
+@@ -247,7 +248,7 @@
/* check for wildcard if there's no match */
if(tmpstr == NULL) {
@@ -38,16 +49,18 @@
if(TheUser[i-1]=='-') {
tmpuser[0] = '\0';
strncat(tmpuser,TheUser,i);
-@@ -410,6 +414,8 @@
+@@ -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);
-@@ -434,6 +440,49 @@
+@@ -435,6 +440,49 @@
return(-2);
}
@@ -97,7 +110,7 @@
if (fdcopy (write_fd, read_fd, extra_headers, headerlen) != 0) {
/* Did the write fail because we were over quota? */
if ( errno == EDQUOT ) {
-@@ -547,10 +596,10 @@
+@@ -549,10 +597,10 @@
if (user_over_maildirquota(address,format_maildirquota(quota))==1) {
/* check for over quota message in domain */
@@ -110,7 +123,7 @@
fs=fopen(tmp_file, "r");
}
-@@ -577,10 +626,10 @@
+@@ -579,10 +627,10 @@
if (domain_over_maildirquota(address)==1)
{
/* check for over quota message in domain */
@@ -123,7 +136,23 @@
fs=fopen(tmp_file, "r");
}
-@@ -769,6 +818,7 @@
+@@ -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:
@@ -131,7 +160,20 @@
args[0] = "/bin/sh"; args[1] = "-c"; args[2] = prog; args[3] = 0;
sig_catch(SIGPIPE,SIG_DFL);
execv(*args,args);
-@@ -824,9 +874,13 @@
+@@ -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 ) {
@@ -145,7 +187,7 @@
/* end of headers return not found looping message value */
return(0);
}
-@@ -943,10 +997,10 @@
+@@ -949,10 +1005,10 @@
FILE *fs;
char tmp_file[256];
@@ -158,7 +200,7 @@
fs=fopen(tmp_file, "r");
}
if ( fs == NULL ) {
-@@ -993,7 +1047,7 @@
+@@ -999,7 +1055,7 @@
struct stat sb;
char quotawarnmsg[BUFF_SIZE];
@@ -167,7 +209,7 @@
time(&tm);
/* Send only one warning every 24 hours */
-@@ -1011,12 +1065,12 @@
+@@ -1017,12 +1073,12 @@
close(fd);
/* Look in the domain for a .quotawarn.msg */
@@ -182,7 +224,7 @@
if ( ((read_fd = open(quotawarnmsg, O_RDONLY)) < 0) ||
(stat(quotawarnmsg, &sb) != 0)) {
return 0;
-@@ -1057,3 +1111,97 @@
+@@ -1063,3 +1119,97 @@
return (strcasecmp (compare, (dt+14)) == 0);
}
diff --git a/mail/vpopmail/files/patch-vmysql.c b/mail/vpopmail/files/patch-vmysql.c
new file mode 100644
index 000000000000..cdaa7da2e40c
--- /dev/null
+++ b/mail/vpopmail/files/patch-vmysql.c
@@ -0,0 +1,33 @@
+diff -urN -x .svn ../../vendor/vpopmail/vmysql.c ./vmysql.c
+--- ../../vendor/vpopmail/vmysql.c Wed Oct 4 13:19:16 2006
++++ ./vmysql.c Wed Oct 4 16:08:34 2006
+@@ -579,12 +579,14 @@
+ #endif
+
+ #ifdef ENABLE_SQL_LOGGING
++#ifdef ENABLE_SQL_REMOVE_DELETED
+ qnprintf( SqlBufUpdate, SQL_BUF_SIZE,
+ "delete from vlog where domain = '%s'", domain );
+ if (mysql_query(&mysql_update,SqlBufUpdate)) {
+ return(-1);
+ }
+ #endif
++#endif
+
+ vdel_limits(domain);
+
+@@ -628,12 +630,14 @@
+ #endif
+
+ #ifdef ENABLE_SQL_LOGGING
++#ifdef ENABLE_SQL_REMOVE_DELETED
+ qnprintf( SqlBufUpdate, SQL_BUF_SIZE,
+ "delete from vlog where domain = '%s' and user = '%s'",
+ domain, user );
+ if (mysql_query(&mysql_update,SqlBufUpdate)) {
+ err = -1;
+ }
++#endif
+ #endif
+ return(err);
+ }
diff --git a/mail/vpopmail/files/patch-vpalias.c b/mail/vpopmail/files/patch-vpalias.c
new file mode 100644
index 000000000000..7d5d5f5b8968
--- /dev/null
+++ b/mail/vpopmail/files/patch-vpalias.c
@@ -0,0 +1,116 @@
+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
new file mode 100644
index 000000000000..2069f1e4c8de
--- /dev/null
+++ b/mail/vpopmail/files/patch-vpgsql.c
@@ -0,0 +1,43 @@
+diff -urN -x .svn ../../vendor/vpopmail/vpgsql.c ./vpgsql.c
+--- ../../vendor/vpopmail/vpgsql.c Wed Oct 4 13:19:16 2006
++++ ./vpgsql.c Wed Oct 4 21:26:53 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,6 +390,7 @@
+ #endif
+
+ #ifdef ENABLE_SQL_LOGGING
++#ifdef ENABLE_SQL_REMOVE_DELETED
+ qnprintf( sqlBufUpdate, SQL_BUF_SIZE,
+ "delete from vlog where domain = '%s'", domain );
+ pgres=PQexec(pgc, SqlBufUpdate);
+@@ -396,6 +398,7 @@
+ return(-1);
+ }
+ #endif
++#endif
+ return(0);
+ }
+
+@@ -442,6 +445,7 @@
+ #endif
+
+ #ifdef ENABLE_SQL_LOGGING
++#ifdef ENABLE_SQL_REMOVE_DELETED
+ qnprintf( sqlBufUpdate, SQL_BUF_SIZE,
+ "delete from vlog where domain = '%s' and user='%s'",
+ domain, user );
+@@ -449,6 +453,7 @@
+ if( !pgres || PGresultStatus(pgres)!=PGRES_COMMAND_OK) {
+ err = -1;
+ }
++#endif
+ #endif
+
+ return(err);
diff --git a/mail/vpopmail/files/patch-vpopmail.c b/mail/vpopmail/files/patch-vpopmail.c
new file mode 100644
index 000000000000..7e65f247fac0
--- /dev/null
+++ b/mail/vpopmail/files/patch-vpopmail.c
@@ -0,0 +1,198 @@
+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);
+ }
+@@ -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
new file mode 100644
index 000000000000..350a2309c435
--- /dev/null
+++ b/mail/vpopmail/files/patch-vqmaillocal.c
@@ -0,0 +1,12 @@
+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/files/sql-remove-deleted.patch b/mail/vpopmail/files/sql-remove-deleted.patch
new file mode 100644
index 000000000000..6a8cd18d6bbc
--- /dev/null
+++ b/mail/vpopmail/files/sql-remove-deleted.patch
@@ -0,0 +1,9 @@
+diff -urN -x .svn ../../freebsd-port/vpopmail/config.h.in ./config.h.in
+--- ../../freebsd-port/vpopmail/config.h.in Wed Oct 4 15:59:54 2006
++++ ./config.h.in Wed Oct 4 16:02:18 2006
+@@ -354,3 +354,5 @@
+
+ /* Define to `int' if <sys/types.h> doesn't define. */
+ #undef uid_t
++
++#define ENABLE_SQL_REMOVE_DELETED
diff --git a/mail/vpopmail/files/vchkpw-smtp-auth.patch b/mail/vpopmail/files/vchkpw-smtp-auth.patch
index d55830ed511c..9fed9c96371d 100644
--- a/mail/vpopmail/files/vchkpw-smtp-auth.patch
+++ b/mail/vpopmail/files/vchkpw-smtp-auth.patch
@@ -1,15 +1,13 @@
---- vchkpw.c.orig Thu Dec 16 15:57:34 2004
-+++ vchkpw.c Fri Sep 16 06:25:31 2005
-@@ -435,8 +435,10 @@
- #ifdef CLEAR_PASS
- /* Check CRAM-MD5 auth */
- if(ConnType == SMTP_CONN) {
-- /* printf("vchkpw: smtp auth\n"); */
-- cramaccepted = authcram(ThePass,TheChallenge,vpw->pw_clear_passwd);
-+ printf("vchkpw: smtp auth\n");
-+ /* cramaccepted = authcram(ThePass,TheChallenge,vpw->pw_clear_passwd); */
-+ cramaccepted = authcram(TheChallenge,ThePass,vpw->pw_clear_passwd);
-+
- if(cramaccepted == 0) strcpy(AuthType, "CRAM-MD5");
- }
+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
+@@ -441,7 +441,8 @@
+ /* Check CRAM-MD5 auth */
+ if(ConnType == SMTP_CONN) {
+ /* printf("vchkpw: smtp auth\n"); */
+- cramaccepted = authcram(ThePass,TheChallenge,vpw->pw_clear_passwd);
++ /* cramaccepted = authcram(ThePass,TheChallenge,vpw->pw_clear_passwd); */
++ cramaccepted = authcram(TheChallenge,ThePass,vpw->pw_clear_passwd);
+ if(cramaccepted == 0) strcpy(AuthType, "CRAM-MD5");
+ }
diff --git a/mail/vpopmail/pkg-plist b/mail/vpopmail/pkg-plist
index e25fac686691..54ec3a819b4e 100644
--- a/mail/vpopmail/pkg-plist
+++ b/mail/vpopmail/pkg-plist
@@ -19,24 +19,38 @@ vpopmail/bin/vmoddomlimits
vpopmail/bin/vmoduser
vpopmail/bin/vpasswd
vpopmail/bin/vpopbull
+vpopmail/bin/vpopmaild
vpopmail/bin/vsetuserquota
vpopmail/bin/vuserinfo
-vpopmail/doc/doc_html/vpopmail.html
-vpopmail/doc/doc_html/vpopmail5.abw
-vpopmail/doc/doc_html/vpopmailapi.png
-vpopmail/doc/man_html/clearopensmtp.html
-vpopmail/doc/man_html/index.html
-vpopmail/doc/man_html/vaddaliasdomain.html
-vpopmail/doc/man_html/vadddomain.html
-vpopmail/doc/man_html/vadduser.html
-vpopmail/doc/man_html/vchkpw.html
-vpopmail/doc/man_html/vconvert.html
-vpopmail/doc/man_html/vdeldomain.html
-vpopmail/doc/man_html/vdelivermail.html
-vpopmail/doc/man_html/vdeluser.html
-vpopmail/doc/man_html/vpasswd.html
-vpopmail/doc/man_html/vpopbull.html
-vpopmail/doc/man_html/vsetuserquota.html
+%%PORTDOCS%%vpopmail/doc/doc_html/vpopmail.html
+%%PORTDOCS%%vpopmail/doc/doc_html/vpopmail5.abw
+%%PORTDOCS%%vpopmail/doc/doc_html/vpopmailapi.png
+%%PORTDOCS%%vpopmail/doc/man_html/clearopensmtp.html
+%%PORTDOCS%%vpopmail/doc/man_html/index.html
+%%PORTDOCS%%vpopmail/doc/man_html/vaddaliasdomain.html
+%%PORTDOCS%%vpopmail/doc/man_html/vadddomain.html
+%%PORTDOCS%%vpopmail/doc/man_html/vadduser.html
+%%PORTDOCS%%vpopmail/doc/man_html/vchkpw.html
+%%PORTDOCS%%vpopmail/doc/man_html/vconvert.html
+%%PORTDOCS%%vpopmail/doc/man_html/vdeldomain.html
+%%PORTDOCS%%vpopmail/doc/man_html/vdelivermail.html
+%%PORTDOCS%%vpopmail/doc/man_html/vdeluser.html
+%%PORTDOCS%%vpopmail/doc/man_html/vpasswd.html
+%%PORTDOCS%%vpopmail/doc/man_html/vpopbull.html
+%%PORTDOCS%%vpopmail/doc/man_html/vsetuserquota.html
+%%PORTDOCS%%vpopmail/doc/README
+%%PORTDOCS%%vpopmail/doc/README.filelocking
+%%PORTDOCS%%vpopmail/doc/README.ipaliasdomains
+%%PORTDOCS%%vpopmail/doc/README.ldap
+%%PORTDOCS%%vpopmail/doc/README.mysql
+%%PORTDOCS%%vpopmail/doc/README.oracle
+%%PORTDOCS%%vpopmail/doc/README.pgsql
+%%PORTDOCS%%vpopmail/doc/README.quotas
+%%PORTDOCS%%vpopmail/doc/README.roamingusers
+%%PORTDOCS%%vpopmail/doc/README.sybase
+%%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
vpopmail/etc/inc_deps
vpopmail/etc/lib_deps
@@ -61,8 +75,8 @@ vpopmail/lib/libvpopmail.a
@dirrm vpopmail/include
@dirrmtry vpopmail/etc
@dirrmtry vpopmail/domains
-@dirrm vpopmail/doc/man_html
-@dirrm vpopmail/doc/doc_html
-@dirrm vpopmail/doc
+%%PORTDOCS%%@dirrm vpopmail/doc/man_html
+%%PORTDOCS%%@dirrm vpopmail/doc/doc_html
+%%PORTDOCS%%@dirrm vpopmail/doc
@dirrm vpopmail/bin
@dirrmtry vpopmail