summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuhammad Moinur Rahman <bofh@FreeBSD.org>2020-07-23 06:43:41 +0000
committerMuhammad Moinur Rahman <bofh@FreeBSD.org>2020-07-23 06:43:41 +0000
commit5443ea1828a66150ea5c6251e385186b5c2d0e0d (patch)
tree8bed098d6c87ecb532cc783a09baba513e31c602
parentnet/v2ray: Update to 4.25.0 (diff)
mail/dbmail: Fix imap connection failure
- Fix failed to retrieve fd limits PR: 247561 Submitted by: ahicks@p-o.co.uk
-rw-r--r--mail/dbmail/Makefile1
-rw-r--r--mail/dbmail/files/patch-acinclude.m412
-rw-r--r--mail/dbmail/files/patch-src_dm__imapsession.c16
-rw-r--r--mail/dbmail/files/patch-src_dm__misc.c21
4 files changed, 44 insertions, 6 deletions
diff --git a/mail/dbmail/Makefile b/mail/dbmail/Makefile
index 28e58c29c458..846da586a64b 100644
--- a/mail/dbmail/Makefile
+++ b/mail/dbmail/Makefile
@@ -4,6 +4,7 @@
PORTNAME= dbmail
PORTVERSION= 3.2.4
DISTVERSIONPREFIX= v
+PORTREVISION= 1
CATEGORIES= mail
MAINTAINER= bofh@FreeBSD.org
diff --git a/mail/dbmail/files/patch-acinclude.m4 b/mail/dbmail/files/patch-acinclude.m4
index 7c88add09839..2df19a4b6960 100644
--- a/mail/dbmail/files/patch-acinclude.m4
+++ b/mail/dbmail/files/patch-acinclude.m4
@@ -1,6 +1,6 @@
---- acinclude.m4.orig 2015-01-25 10:20:50 UTC
+--- acinclude.m4.orig 2020-06-08 07:19:38 UTC
+++ acinclude.m4
-@@ -221,7 +221,7 @@ if ( test [ "x$lookforldap" != "xno" ] || test [ "x$lo
+@@ -222,7 +222,7 @@ if ( test [ "x$lookforldap" != "xno" ] || test [ "x$lo
dnl See if we already have the paths we need in the environment.
dnl ...but only if --with-ldap was given without a specific path.
if ( test [ "x$lookforldap" = "xyes" ] || test [ "x$lookforauthldap" = "xyes" ] ); then
@@ -9,7 +9,7 @@
if test [ "x$LDAPLIB" != "xfailed" ]; then
break
fi
-@@ -233,7 +233,7 @@ if ( test [ "x$lookforldap" != "xno" ] || test [ "x$lo
+@@ -234,7 +234,7 @@ if ( test [ "x$lookforldap" != "xno" ] || test [ "x$lo
SAVE_CFLAGS=$CFLAGS
dnl The headers might be in a funny place, so we need to use -Ipath
CFLAGS="$CFLAGS -L$TEST_PATH $LDAPINC"
@@ -18,7 +18,7 @@
CFLAGS=$SAVE_CFLAGS
if test [ "x$LDAPLIB" != "xfailed" ]; then
break 2
-@@ -247,7 +247,7 @@ if ( test [ "x$lookforldap" != "xno" ] || test [ "x$lo
+@@ -248,7 +248,7 @@ if ( test [ "x$lookforldap" != "xno" ] || test [ "x$lo
AC_MSG_ERROR([Could not find LDAP library.])
else
AC_DEFINE([AUTHLDAP], 1, [Define if LDAP will be used.])
@@ -27,7 +27,7 @@
AC_SUBST(LDAPLIB)
AC_SUBST(LDAPINC)
AUTHALIB="modules/.libs/libauth_ldap.a"
-@@ -339,7 +341,7 @@ AC_DEFUN([DM_CHECK_EVENT], [
+@@ -334,7 +334,7 @@ AC_DEFUN([DM_CHECK_EVENT], [
AC_DEFUN([DM_CHECK_SSL], [
AC_CHECK_HEADERS([openssl/ssl.h],
@@ -36,7 +36,7 @@
if test [ "x$SSLLIB" = "xfailed" ]; then
AC_MSG_ERROR([Could not find OPENSSL library.])
else
-@@ -539,15 +541,15 @@ AC_DEFUN([CMU_SOCKETS], [
+@@ -544,15 +544,15 @@ AC_DEFUN([CMU_SOCKETS], [
save_LIBS="$LIBS"
SOCKETLIB=""
AC_CHECK_FUNC(connect, :,
diff --git a/mail/dbmail/files/patch-src_dm__imapsession.c b/mail/dbmail/files/patch-src_dm__imapsession.c
new file mode 100644
index 000000000000..6d1f89b5da5e
--- /dev/null
+++ b/mail/dbmail/files/patch-src_dm__imapsession.c
@@ -0,0 +1,16 @@
+--- src/dm_imapsession.c.orig 2020-07-23 04:06:59 UTC
++++ src/dm_imapsession.c
+@@ -804,9 +804,10 @@ static void _fetch_headers(ImapSession *self, body_fet
+ "m.mailbox_idnr = %" PRIu64 " "
+ "AND m.message_idnr %s "
+ "AND status < %d "
+- //"AND n.headername %s IN ('%s') " //old, from the sql point of view is slow
+- "having seq %s %d " //patch Cosmin Cioranu, removing the above conditions needs a restriction, patched added
+- "ORDER BY message_idnr, seq",
++ //"AND n.headername %s IN ('%s') " //old, from the sql point of view is slow, CC 2020
++ "GROUP By m.message_idnr, n.headername, v.headervalue "
++ "having seq %s %d "
++ "ORDER BY m.message_idnr, seq",
+ not?"":fieldorder->str,
+ DBPFX, DBPFX, DBPFX, DBPFX,
+ self->mailbox->id, p_string_str(range),
diff --git a/mail/dbmail/files/patch-src_dm__misc.c b/mail/dbmail/files/patch-src_dm__misc.c
new file mode 100644
index 000000000000..f3cde4915f64
--- /dev/null
+++ b/mail/dbmail/files/patch-src_dm__misc.c
@@ -0,0 +1,21 @@
+--- src/dm_misc.c.orig 2020-06-29 22:53:45 UTC
++++ src/dm_misc.c
+@@ -131,6 +131,10 @@ int drop_privileges(char *newuser, char *newgroup)
+
+ int get_opened_fd_count(void)
+ {
++#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__SUNPRO_C) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
++ // BSD like systems don't use proc
++ return 0;
++#else
+ DIR* dir = NULL;
+ struct dirent* entry = NULL;
+ char buf[32];
+@@ -147,6 +151,7 @@ int get_opened_fd_count(void)
+ closedir(dir);
+
+ return fd_count - 2; /* exclude '.' and '..' entries */
++#endif
+ }
+
+ void create_unique_id(char *target, uint64_t message_idnr)