Quantcast
Channel: Aspose.Email Product Family
Viewing all articles
Browse latest Browse all 1367

Multiple problems creating Exchange Journal related messages

$
0
0
Hi there,

We have run into several issues attempting to create MS Exchange compatible (2010+) journal report messages to be placed into a journal mailbox.

1) First, we have trouble creating the 'x-ms-journal-report' MAPI property - we have tried several times to create the property on the item, we don't get an error, but the property doesn't show in the resulting message.  Code as follows:

public static void SetStringNamedProperty(this MapiMessage mapiMessage, Guid guid, string name, string value)
 {
   var tag = mapiMessage.NamedPropertyMapping.GetNextAvailablePropertyId(mapiMessage.IsStoreUnicodeOk() ? MapiPropertyType.PT_UNICODE : MapiPropertyType.PT_STRING8);
   var newProp = new MapiProperty(tag, mapiMessage.IsStoreUnicodeOk() ? Encoding.Unicode.GetBytes(value) : Encoding.ASCII.GetBytes(value));
    
   mapiMessage.NamedPropertyMapping.AddNamedPropertyMapping(newProp, name, guid);
   mapiMessage.NamedProperties.Add(tag, newProp);
 }


2) We also cannot seemingly attach emails "properly" to the journal report.  It seems that the only method of attachment is literally representing "File attachment", or PR_ATTACH_METHOD = 1.  What we'd like to see is a way to use "Embedded attachment" to attach other emails to an email, which would be PR_ATTACH_METHOD = 5.

3) Lastly, it seems like the only way to set a sender address is if it is an SMTP e-mail address, and that doesn't always have to be the case.  In fact, email messages can be in a distinguished name format.  For example:

p1.SenderEmailAddress = "/O=ORG/OU=EXCHANGE ADMINISTRATIVE GROUP (FYDIBOHF23SPDLT)/CN=RECIPIENTS/CN=MICROSOFTEXCHANGE329E71EC88AE4615BBC36AB6CE41109E";
p1.SenderName = "Microsoft Outlook";

This code will product an error, but the sender address is technically 100% valid.  In fact, if you review journal report messages from Exchange itself, you will see that this is a "well-known address" and it will be identical to the address above.

This last issue, #3, can actually impact other areas of an organization that may want to read/parse a variety of emails as it is totally possible to have some emails lying about that contain DNs instead of SMTP addresses, not just an Exchange journal message.

Thank you.

Viewing all articles
Browse latest Browse all 1367