Summary:ASTERISK-24787: [patch] - Microsoft exchange incompatibility for playing back messages stored in IMAP - play_message: No origtime
Reporter:Graham Barnett (GrahamJB)Labels:
Date Opened:2015-02-13 06:36:12.000-0600Date Closed:2015-02-20 09:48:15.000-0600
Versions:13.1.0 13.2.0 Frequency of
Environment:Attachments:( 0) app_voicemail.c.patch_MSExchange
Description:Failed to play back messages stored in Microsoft Exchange 2007 after Exchange Server 2007 SP1 RU8 and 2010

Two issues:
# Need to reconfigure exchange:
# x attributes are lower cased.

Install: Follow steps in 1
Code fix:

In: {{get_header_by_tag}}
use {{strcasestr}} not {{strstr}} for matching header attributes.

will post patch file later
Comments:By: Graham Barnett (GrahamJB) 2015-02-13 06:43:52.803-0600

For reference on this jira I had to set this in Exchange (seperate to code fix):

Set-TransportConfig -HeaderPromotionModeSetting MayCreate

With Exchange Server 2007 SP1 RU8 we disabled promotion of custom X-Headers to named properties when mail was submitted anonymously via SMTP. Only authenticated connections would work. With Exchange Server 2007 SP1 RU9 we disabled all named property promotion on messages submitted via SMTP, however Exchange Server 2007 SP2 introduced a new feature on the global TransportConfig object called HeaderPromotionModeSetting.

So what's the point of all this? Named properties are used for many thing, but a big impact for many is the use of named properties where POP and IMAP clients are concerned. Because Exchange Server 2007 does not keep the Mime for a message around, nor does it keep a full Mime Structure of the originally submitted messages, we will reconstruct the headers of a message when going through item (MAPI) to MIME conversion, IOW, when downloading a message via POP or IMAP.

If the X-Header on a message has never been promoted to a named property then it will not show up when RETRieving or FETCHing the message via POP or IMAP. Because the named property table is managed on a per database basis, once a named property has been promoted into a specific database it will always be provided to the POP/IMAP client.

By: Graham Barnett (GrahamJB) 2015-02-13 06:52:20.535-0600

For reference: Example of headers as retrieved by IMAP interface from Exchange 2007 SP3. Note lower casing.

Thread-Topic: Voicemail from xxx Length 0:04, on extension "xxxx"
Message-ID: <Asterisk-1-1741012920-xxx-24202@hosta>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach: yes
x-asterisk-vm-message-num: 1
x-asterisk-vm-server-name: xxxx Voicemail
x-asterisk-vm-context: default
x-asterisk-vm-extension: xxx
x-asterisk-vm-priority: 2
x-asterisk-vm-caller-channel: PJSIP/xxx-00000002
x-asterisk-vm-caller-id-num: xxx
x-asterisk-vm-caller-id-name: xxxx Study
x-asterisk-vm-duration: 4
x-asterisk-vm-message-type: Message
x-asterisk-vm-orig-date: Friday, February 13, 2015 at 12:16:00 PM
x-asterisk-vm-orig-time: 1423829760
x-asterisk-vm-message-id: 1423829755-00000001
x-asterisk-callerid: xxx
x-asterisk-calleridname: xxxx
Content-Type: multipart/mixed;

By: Matt Jordan (mjordan) 2015-02-13 09:26:09.814-0600

Putting this in Waiting for Feedback until patch is submitted.

By: Graham Barnett (GrahamJB) 2015-02-13 11:53:24.554-0600

Patch attached

By: Matt Jordan (mjordan) 2015-02-20 09:41:08.748-0600

Patch looks good to me. Thanks for the contribution!