Problems with custom plugin

Lukas Mika lukas.mika at web.de
Thu Jul 24 09:59:22 UTC 2014


Hi everybody,

I wrote a plugin for Dovecot 2.1.something which was based on the
information found at http://wiki2.dovecot.org/Design/Storage/Plugins and
by studying the mail_log plugin.
My plugin can be found here: https://github.com/dim-0/dovecot-mbc
It takes the notify plugin's information, that a new mailbox has been
created (or an old one been renamed) in order to trigger a custom script
(which in my case sets default ACLs for shared mailboxes).

This plugin went quite well for a while, but then I recently upgraded
Dovecot to version 2.2.9 and now I cannot build my plugin anymore.
I get two error messages which both describe the same thing:

src/mbc-plugin.c: In function ‘mbc_mailbox_create’:
/usr/include/dovecot/src/lib/module-context.h:46:67: error: ‘struct
mbc_user_module’ has no member named ‘reg’
  COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(OBJ_REGISTER(obj), (id_ctx).reg)

src/mbc-plugin.c: In function ‘mbc_mail_user_created’:
/usr/include/dovecot/src/lib/module-context.h:46:67: error: ‘struct
mbc_user_module’ has no member named ‘reg’
  COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(OBJ_REGISTER(obj), (id_ctx).reg)

Obviously the module context nowadays expects another attribute/struct
named "reg". However, I cannot find any information about this within
the documentation and plugin mentioned above. The only clue I have got
yet is the definition in module-context.h:
   union STRUCT_NAME_module_context {
           struct STRUCT_NAME_module_register *reg;
           // it's allowed to have some structure here so it won't waste
space.
           // for example: struct STRUCT_NAME_vfuncs super;
   };

However, I still cannot make any sense of it (yet).

Could you please help me in filling the gap and understanding, what has
to be changed?

Thanks a lot in advance for an awesome piece of software and any input
on this topic,
Lukas


More information about the dovecot mailing list