Making third-party plugins for Dovecot is really hard and frustrating. Using dovecot 2.2.33.2 and the following sources, the compile errors keep coming. The use of g++ is mandated as the underlying backend this plugin will access only has a C++ interface.
== Source 1
/* g++-7 -c a.cpp */
#include
== Problems 1 /usr/include/dovecot/compat.h:45:4: error: #error uoff_t size not set # error uoff_t size not set
== Source 2
/* g++-7 -DHAVE_CONFIG_H -c a.cpp */
#include "config.h" /* generated by my configure */
#include
== Problems 2 In file included from /usr/include/bits/byteswap.h:35:0, from /usr/include/byteswap.h:24, from a.cpp:2: /usr/include/dovecot/byteorder.h:32:24: error: expected unqualified-id before ‘__extension__’ static inline uint16_t bswap_16(uint16_t in);
== Other problems
dovecot headers files are missing 'extern "C"' lines.
This means the linkage of symbols like dev_null_fd is not what it should be.
I can't use
extern "C" {
#include