- /* If user defined callback function was defined, call it */
- if (helper->user_callback) {
- helper->user_callback (self, NULL, msg, helper->user_data);
+ /* If user defined callback function was defined, call it */
+ if (helper->user_callback) {
+ /* This callback is called into an iddle by tinymail,
+ and idles are not in the main lock */
+ gdk_threads_enter ();
+ helper->user_callback (self, helper->header, msg, helper->user_data);
+ gdk_threads_leave ();
+ }