Hi folks,
            I've spent the last few days trying out libmapi, and I'm very
impressed by everyone's work. Here's a post covering some of my experiences:
http://petewarden.typepad.com/searchbrowser/2008/11/how-to-connect-to-exchange-from-linux.html

I ran into a few hiccups that I'll be preparing some proper reports on, but
nothing I couldn't work around. The most puzzling was with the results
returned from ReadRecipients. Here's some test code I've been using:

    recipient_rows = talloc_zero(mem_ctx, struct ReadRecipientRow);
    retval = ReadRecipients(obj_message, 0, &recipient_count,
&recipient_rows);

    for (count=0; count<recipient_count; count+=1)
    {
        struct ReadRecipientRow* current_row = &recipient_rows[count];

//        const char* recipient_display =
current_row->RecipientRow.SimpleDisplayName.lpszA;
//        const char* recipient_address =
current_row->RecipientRow.EmailAddress.lpszA;

        uint32_t flags = current_row->RecipientRow.RecipientFlags;
        uint32_t transmittable_flags = (flags&0x220);
        const bool hasTransmittable =
((transmittable_flags==0x020)||(transmittable_flags==0x220));

        // Pete- This is whacky, but the structure members seem misnamed, so
using the ones that appear to hold
        // the correct values
        const char* recipient_display =
current_row->RecipientRow.EmailAddress.lpszA;
        const char* recipient_address;
        if (hasTransmittable)
            recipient_address =
current_row->RecipientRow.TransmittableDisplayName.lpszA;
        else
            recipient_address = current_row->RecipientRow.DisplayName.lpszA;

What I'm seeing on my Exchange 2003/libmapi top-of-tree is that
current_row->RecipientRow.EmailAddress seems to contain the display name,
and the actual email address is held in either TransmittableDisplayName or
DisplayName. I'm groping in the dark with the flags usage, but the code
above seems to produce the results I'd expect for my data set.

I will prepare a proper bug report on this, I know how hard it is to figure
out what's going on from a partial code snippet and description.

cheers,
           Pete
_______________________________________________
devel mailing list
[email protected]
http://mailman.openchange.org/listinfo/devel

Reply via email to