Hey,

The plugin API of dovecot apparently changed in 2.3.17. Because of this,
the version of dovecot-fts-xapian in 7.1 is broken and will crash
whenever invoked.

Diff to update the plugin to the latest version follows. I'm running
this on my backup MX that I upgraded to 7.1 to test, and I no longer get
crashes when receiving mail or replicating mail to it.

(please CC me, I'm not subscribed to ports@)

Thanks

Index: mail/dovecot-fts-xapian/Makefile
===================================================================
RCS file: /cvs/ports/mail/dovecot-fts-xapian/Makefile,v
retrieving revision 1.13
diff -u -p -r1.13 Makefile
--- mail/dovecot-fts-xapian/Makefile    11 Mar 2022 19:34:35 -0000      1.13
+++ mail/dovecot-fts-xapian/Makefile    24 Apr 2022 11:32:12 -0000
@@ -2,8 +2,7 @@ COMMENT=                full text search plugin for Do
 
 GH_ACCOUNT=            grosjo
 GH_PROJECT=            fts-xapian
-GH_TAGNAME=            1.4.8
-REVISION=              2
+GH_TAGNAME=            1.5.5
 
 PKGNAME=               dovecot-${DISTNAME}
 
Index: mail/dovecot-fts-xapian/distinfo
===================================================================
RCS file: /cvs/ports/mail/dovecot-fts-xapian/distinfo,v
retrieving revision 1.6
diff -u -p -r1.6 distinfo
--- mail/dovecot-fts-xapian/distinfo    26 Mar 2021 10:24:32 -0000      1.6
+++ mail/dovecot-fts-xapian/distinfo    24 Apr 2022 11:32:12 -0000
@@ -1,2 +1,2 @@
-SHA256 (fts-xapian-1.4.8.tar.gz) = VHzIdCXFnV+7O3+BEg8L0B3Wx4rSNNPXUMAvQhgE43Q=
-SIZE (fts-xapian-1.4.8.tar.gz) = 29381
+SHA256 (fts-xapian-1.5.5.tar.gz) = AqnOaVC4HNMMw+tuPd6Ab+GD/VArjrCXSh5UxCUMBCk=
+SIZE (fts-xapian-1.5.5.tar.gz) = 33228
Index: 
mail/dovecot-fts-xapian/patches/patch-src_fts-backend-xapian-functions_cpp
===================================================================
RCS file: 
mail/dovecot-fts-xapian/patches/patch-src_fts-backend-xapian-functions_cpp
diff -N 
mail/dovecot-fts-xapian/patches/patch-src_fts-backend-xapian-functions_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ mail/dovecot-fts-xapian/patches/patch-src_fts-backend-xapian-functions_cpp  
24 Apr 2022 11:32:12 -0000
@@ -0,0 +1,28 @@
+Index: src/fts-backend-xapian-functions.cpp
+--- src/fts-backend-xapian-functions.cpp.orig
++++ src/fts-backend-xapian-functions.cpp
+@@ -506,10 +506,15 @@ static long fts_backend_xapian_current_time()
+ static long fts_backend_xapian_get_free_memory() // KB
+ {
+       struct rlimit rl;
++
++#if !defined(__OpenBSD__)
+       getrlimit(RLIMIT_AS,&rl);
+ 
+       long limit = rl.rlim_cur / 1024.0;
+       if(fts_xapian_settings.verbose>1) i_warning("FTS Xapian: RLIM AS 
=%ld",limit);
++#else
++      long limit = 0;
++#endif
+ 
+       getrlimit(RLIMIT_DATA,&rl);
+       long l2 = rl.rlim_cur / 1024.0;
+@@ -517,7 +522,7 @@ static long fts_backend_xapian_get_free_memory() // KB
+ 
+       if((l2>0) && ((limit>l2) || (limit<1))) limit=l2;
+ 
+-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || 
defined(__APPLE__) 
++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) 
+       uint32_t m;
+       size_t len = sizeof(m);
+       sysctlbyname("vm.stats.vm.v_free_count", &m, &len, NULL, 0);
Index: mail/dovecot-fts-xapian/patches/patch-src_fts-xapian-plugin_c
===================================================================
RCS file: mail/dovecot-fts-xapian/patches/patch-src_fts-xapian-plugin_c
diff -N mail/dovecot-fts-xapian/patches/patch-src_fts-xapian-plugin_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ mail/dovecot-fts-xapian/patches/patch-src_fts-xapian-plugin_c       24 Apr 
2022 11:32:12 -0000
@@ -0,0 +1,12 @@
+Index: src/fts-xapian-plugin.c
+--- src/fts-xapian-plugin.c.orig
++++ src/fts-xapian-plugin.c
+@@ -35,7 +35,7 @@ static void fts_xapian_mail_user_created(struct mail_u
+         fuser->set.partial    = XAPIAN_DEFAULT_PARTIAL;
+         fuser->set.full       = XAPIAN_DEFAULT_FULL;
+ 
+-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || 
defined(__APPLE__)
++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
+       size_t len = sizeof(fuser->set.pagesize);
+       sysctlbyname("hw.pagesize", &(fuser->set.pagesize), &len, NULL, 0);
+ #else
Index: mail/dovecot-fts-xapian/patches/patch-src_fts-xapian-plugin_h
===================================================================
RCS file: mail/dovecot-fts-xapian/patches/patch-src_fts-xapian-plugin_h
diff -N mail/dovecot-fts-xapian/patches/patch-src_fts-xapian-plugin_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ mail/dovecot-fts-xapian/patches/patch-src_fts-xapian-plugin_h       24 Apr 
2022 11:32:12 -0000
@@ -0,0 +1,12 @@
+Index: src/fts-xapian-plugin.h
+--- src/fts-xapian-plugin.h.orig
++++ src/fts-xapian-plugin.h
+@@ -16,7 +16,7 @@
+ #include "module-context.h"
+ #include "fts-api-private.h"
+ 
+-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || 
defined(__APPLE__)
++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
+ #include <sys/types.h>
+ #include <sys/sysctl.h>
+ #if !defined(__APPLE__)
Index: 
mail/dovecot-fts-xapian/patches/patch-src_fts-backend-xapian-functions_cpp
===================================================================
RCS file: 
mail/dovecot-fts-xapian/patches/patch-src_fts-backend-xapian-functions_cpp
diff -N 
mail/dovecot-fts-xapian/patches/patch-src_fts-backend-xapian-functions_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ mail/dovecot-fts-xapian/patches/patch-src_fts-backend-xapian-functions_cpp  
24 Apr 2022 11:32:12 -0000
@@ -0,0 +1,28 @@
+Index: src/fts-backend-xapian-functions.cpp
+--- src/fts-backend-xapian-functions.cpp.orig
++++ src/fts-backend-xapian-functions.cpp
+@@ -506,10 +506,15 @@ static long fts_backend_xapian_current_time()
+ static long fts_backend_xapian_get_free_memory() // KB
+ {
+       struct rlimit rl;
++
++#if !defined(__OpenBSD__)
+       getrlimit(RLIMIT_AS,&rl);
+ 
+       long limit = rl.rlim_cur / 1024.0;
+       if(fts_xapian_settings.verbose>1) i_warning("FTS Xapian: RLIM AS 
=%ld",limit);
++#else
++      long limit = 0;
++#endif
+ 
+       getrlimit(RLIMIT_DATA,&rl);
+       long l2 = rl.rlim_cur / 1024.0;
+@@ -517,7 +522,7 @@ static long fts_backend_xapian_get_free_memory() // KB
+ 
+       if((l2>0) && ((limit>l2) || (limit<1))) limit=l2;
+ 
+-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || 
defined(__APPLE__) 
++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) 
+       uint32_t m;
+       size_t len = sizeof(m);
+       sysctlbyname("vm.stats.vm.v_free_count", &m, &len, NULL, 0);
Index: mail/dovecot-fts-xapian/patches/patch-src_fts-xapian-plugin_c
===================================================================
RCS file: mail/dovecot-fts-xapian/patches/patch-src_fts-xapian-plugin_c
diff -N mail/dovecot-fts-xapian/patches/patch-src_fts-xapian-plugin_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ mail/dovecot-fts-xapian/patches/patch-src_fts-xapian-plugin_c       24 Apr 
2022 11:32:12 -0000
@@ -0,0 +1,12 @@
+Index: src/fts-xapian-plugin.c
+--- src/fts-xapian-plugin.c.orig
++++ src/fts-xapian-plugin.c
+@@ -35,7 +35,7 @@ static void fts_xapian_mail_user_created(struct mail_u
+         fuser->set.partial    = XAPIAN_DEFAULT_PARTIAL;
+         fuser->set.full       = XAPIAN_DEFAULT_FULL;
+ 
+-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || 
defined(__APPLE__)
++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
+       size_t len = sizeof(fuser->set.pagesize);
+       sysctlbyname("hw.pagesize", &(fuser->set.pagesize), &len, NULL, 0);
+ #else
Index: mail/dovecot-fts-xapian/patches/patch-src_fts-xapian-plugin_h
===================================================================
RCS file: mail/dovecot-fts-xapian/patches/patch-src_fts-xapian-plugin_h
diff -N mail/dovecot-fts-xapian/patches/patch-src_fts-xapian-plugin_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ mail/dovecot-fts-xapian/patches/patch-src_fts-xapian-plugin_h       24 Apr 
2022 11:32:12 -0000
@@ -0,0 +1,12 @@
+Index: src/fts-xapian-plugin.h
+--- src/fts-xapian-plugin.h.orig
++++ src/fts-xapian-plugin.h
+@@ -16,7 +16,7 @@
+ #include "module-context.h"
+ #include "fts-api-private.h"
+ 
+-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || 
defined(__APPLE__)
++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
+ #include <sys/types.h>
+ #include <sys/sysctl.h>
+ #if !defined(__APPLE__)

Reply via email to