You need to have the statement
#include "linkage.c"
early in your program's main() function.
You will have to write some code for those callbacks instead of just having dummy routines. In particular, mail_open() on an IMAP mailbox isn't likely to work without at least code for mm_login().
There are several programs in the IMAP toolkit which should be used as a model. In particular, look at the source code for mtest and mailutil. For a more advanced example, look at the source code for imapd.
-- Mark --
http://staff.washington.edu/mrc Science does not emerge from voting, party politics, or public debate. Si vis pacem, para bellum.