[Dovecot] Antispam plugin, compile under osx

Bradley Giesbrecht bradley.giesbrecht at gmail.com
Tue Apr 13 23:09:52 EEST 2010


On Apr 11, 2010, at 11:53 PM, Johannes Berg wrote:

>
>> cc  -fPIC -shared -Wall -Wextra -DPLUGINNAME=antispam - 
>> DHAVE_CONFIG_H -
>> I/opt/local/include/dovecot/ -I/opt/local/include/dovecot/src/ -I/ 
>> opt/
>> local/include/dovecot/src/lib/ -I/opt/local/include/dovecot/src/lib-
>> storage/ -I/opt/local/include/dovecot/src/lib-mail/ -I/opt/local/
>> include/dovecot/src/lib-imap/ -I/opt/local/include/dovecot/src/lib-
>> dict/ -I/opt/local/include/dovecot/src/lib-index/ -I/opt/local/ 
>> include/
>> dovecot/src/imap/ signature.o antispam-plugin.o antispam-storage.o
>> dspam-exec.o -o lib90_antispam_plugin.so
>> Undefined symbols:
>>   "_mailbox_get_name", referenced from:
>>       _mailbox_patternmatch in antispam-plugin.o
>>       _mailbox_is_spam in antispam-plugin.o
>>       _mailbox_is_trash in antispam-plugin.o
>>       _mailbox_is_unsure in antispam-plugin.o
>
> Looks like your linker is prepending _ to each symbol, which probably
> don't exist since dovecot itself exports w/o the underscore ... I have
> no idea why it's doing that though.
>
> johannes

If someone else stumbles upon this thread.

 From unix-porting at lists.apple.com
> The underscores are a red herring. If you use nm to look at the  
> executables that export mailbox_get_name, for example libexec/ 
> dovecot/imap, you see that the symbol is exported with the underscore.
>
> You need to use the appropriate linker flags for your module, like - 
> undefined dynamic_lookup. Look at how dovecot's own modules are  
> linked when you build dovecot.

Adding 'CFLAGS += -undefined dynamic_lookup' to .config allows for  
make to complete without error.

I have not tested the .so plugin and if there are problems I will  
report it to this thread.


Thanks for the help,
Bradley Giesbrecht


More information about the dovecot mailing list