#include #include #include #include #include int main ( int argc, const char **argv ) { mailbox_t mbox_src; size_t msgno, total, tot2 = 0; int status; /* Register the formats. */ // mu_register_all_mbox_formats (); list_t bookie = 0; registrar_get_list ( &bookie ); list_append ( bookie, path_record ); list_append ( bookie, mbox_record ); list_append ( bookie, pop_record ); // list_append (bookie, mh_record);\ // list_append (bookie, maildir_record);\ /* Setup the mailbox */ mailbox_create_default ( &mbox_src, argv[ 1 ] ); mailbox_open ( mbox_src, MU_STREAM_READ ); /* Go through the source messages, list uidl */ mailbox_messages_count ( mbox_src, &total ); for ( msgno = 1; msgno <= total; msgno++ ) { message_t msg_src; header_t hdr_src; mailbox_get_message ( mbox_src, msgno, &msg_src ); message_get_header ( msg_src, &hdr_src ); char uidl[ 128 ] = ""; message_get_uidl( msg_src, uidl, 127, NULL ); printf ( "%d %s\n", msgno, uidl ); header_destroy ( &hdr_src, NULL ); message_destroy ( &msg_src, NULL ); } mailbox_close ( mbox_src ); mailbox_destroy ( &mbox_src ); return 0; }