Hello Nick!

I am sorry - I forgot to mention that you need attached patch for dovecot.

Kind regards,
Dennis

Am Dienstag, 5. Juni 2012, 11:28:27 schrieb Nick Rosier:
> Hi Dennis,
> 
> I'm trying to compile the plugin on FreeBSD 9 with Dovecot 2.1.7 and get
> the following error:
> 
> libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I..
> -I/usr/local/include/dovecot -g -O2 -MT mailbox-ext.lo -MD -MP -MF
> .deps/mailbox-ext.Tpo -c mailbox-ext.c  -fPIC -DPIC -o
> .libs/mailbox-ext.o mailbox-ext.c:25:19: error: missing binary operator
> before token "("
> mailbox-ext.c: In function 'mailbox_get_guid_string': mailbox-ext.c:32:
> error: 'MAIL_GUID_128_SIZE' undeclared (first use in this function)
> mailbox-ext.c:32: error: (Each undeclared identifier is reported only
> once mailbox-ext.c:32: error: for each function it appears in.)
> mailbox-ext.c:33: warning: implicit declaration of function
> 'mailbox_get_guid'
> *** Error code 1
> Stop in /root/work/dovecot-metadata-plugin-6fe39779d758/src. *** Error
> code 1
> 
> Removing DOVECOT_PREREQ and "forcing" to use the 2.1 definition fixes
> that (I couldn't find anywhere where that macro was defined).
> 
> Next I get another error, again caused by the DOVECOT_PREREQ:
> 
> libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I..
> -I/usr/local/include/dovecot -g -O2 -MT imap-metadata-plugin.lo -MD -MP
> -MF .deps/imap-metadata-plugin.Tpo -c imap-metadata-plugin.c  -fPIC
> -DPIC -o .libs/imap-metadata-plugin.o
> imap-metadata-plugin.c: In function 'is_valid_rfc5464_entry_name':
> imap-metadata-plugin.c:162: warning: comparison is always false due to
> limited range of data type
> imap-metadata-plugin.c:513:19: error: missing binary operator before
> token "("
> imap-metadata-plugin.c: In function 'cmd_getmetadata':
> imap-metadata-plugin.c:516: warning: passing argument 2 of
> 'mail_namespace_find' from incompatible pointer type
> imap-metadata-plugin.c: In function 'setmetadata_helper':
> imap-metadata-plugin.c:596: warning: 'return' with a value, in function
> returning void
> imap-metadata-plugin.c:672:19: error: missing binary operator before
> token "("
> imap-metadata-plugin.c: In function 'cmd_setmetadata':
> imap-metadata-plugin.c:675: warning: passing argument 2 of
> 'mail_namespace_find' from incompatible pointer type
> *** Error code 1
> 
> Am I missing something on my system?
> 
> Rgds,
> N.
> 
> Dennis Schridde wrote:
> > Hello everyone!
> > 
> > I just released dovecot-metadata-8, which is an implementation of RFC 5464
> > (IMAP METADATA), allowing to add comments/annotations/metadata to folders
> > of an email account.
> > 
> > 2012-06-04: Version 9
> > 
> >   * Added Dovecot 2.1 compatibility
> >   * Fixed compliance with RFC 5464 Section 3.2
> >   * Separated backend code into library
> >   * Synced code of imap-annotatemore with imap-metadata
> >   * Improved error messages
> >   * Several bugfixes (incl. segfaults)
> >   * Minor cleanups
> > 
> > Please get the code from [1] and send me an email for any problem you
> > find.
> > 
> > For more information please refer to my email from Sun, 12 Jun 2011
> > 15:55:57 +0200 titled "dovecot-metadata-8 released".
> > 
> > Kind regards,
> > Dennis
> > 
> > [1] http://hg.dovecot.org/dovecot-metadata-plugin
# HG changeset patch
# User Dennis Schridde <devuran...@gmx.net>
# Date 1319973808 -3600
# Node ID b144c7d3bb67b44c59aa53965ceb70c38e4f21b3
# Parent  b88e776bfb03011fe3b2825361d59cf90dd95562
Add macros DOVECOT_VERSION_{MAJOR,MINOR} to config.h to allow version checks in the preprocessor

Version number set as PACKAGE_VERSION is assumed to be D.D* with D=digits

diff -r b88e776bfb03 -r b144c7d3bb67 configure.in
--- a/configure.in	Sat Oct 29 13:29:30 2011 +0200
+++ b/configure.in	Sun Oct 30 12:23:28 2011 +0100
@@ -281,6 +281,9 @@
 AC_DEFINE_UNQUOTED(DOVECOT_STRING, "$PACKAGE_STRING", Dovecot string)
 AC_DEFINE_UNQUOTED(DOVECOT_VERSION, "$PACKAGE_VERSION", Dovecot version)
 
+AC_DEFINE([DOVECOT_VERSION_MAJOR], regexp(AC_PACKAGE_VERSION, [^\([0-9]+\)\.\([0-9]+\)], [\1]), [Dovecot major version])
+AC_DEFINE([DOVECOT_VERSION_MINOR], regexp(AC_PACKAGE_VERSION, [^\([0-9]+\)\.\([0-9]+\)], [\2]), [Dovecot minor version])
+
 AC_CHECK_HEADERS(strings.h stdint.h unistd.h dirent.h malloc.h inttypes.h \
   sys/uio.h sys/sysmacros.h sys/resource.h sys/select.h libgen.h \
   sys/quota.h sys/fs/ufs_quota.h ufs/ufs/quota.h jfs/quota.h sys/fs/quota_common.h \
# HG changeset patch
# User Dennis Schridde <devuran...@gmx.net>
# Date 1319974793 -3600
# Node ID 4ee2e23710fb04f95874a61ddf32f04a9cb2afbb
# Parent  b144c7d3bb67b44c59aa53965ceb70c38e4f21b3
Add DOVECOT_PREREQ to src/lib/macros.h - convenience macro to test the version of dovecot

diff -r b144c7d3bb67 -r 4ee2e23710fb src/lib/macros.h
--- a/src/lib/macros.h	Sun Oct 30 12:23:28 2011 +0100
+++ b/src/lib/macros.h	Sun Oct 30 12:39:53 2011 +0100
@@ -193,4 +193,14 @@
 #define i_unreached() \
 	i_panic("file %s: line %d: unreached", __FILE__, __LINE__)
 
+/*
+   Convenience macros to test the versions of dovecot.
+*/
+#if defined DOVECOT_VERSION_MAJOR && defined DOVECOT_VERSION_MINOR
+#  define DOVECOT_PREREQ(maj, min) \
+          ((DOVECOT_VERSION_MAJOR << 16) + DOVECOT_VERSION_MINOR >= ((maj) << 16) + (min))
+#else
+#  define DOVECOT_PREREQ(maj, min) 0
 #endif
+
+#endif

Reply via email to