Exchange CDO library corrupts Content-Disposition field in SMTP messages

171 views Asked by At

We are using CDO + VBScript for adding some text to outgoing SMTP messages via Event Sink on Exchange 2003.

We have found that if the message contains an attachment the Save method corrupts the content-disposition field by removing quotes around creation-date and modification-date attributes.

This is the content-disposition field before saving. Creation-date and modification-date are properly quoted.

Content-Disposition: attachment;
    filename="desktop.ini";
    size=402;
    creation-date="Wed, 30 Oct 2013 14:17:14 GMT";
    modification-date="Wed, 30 Oct 2013 14:17:14 GMT"

This is the content-disposition after saving the message. There are no quotes anymore around date fields.

Content-Disposition: attachment;
    filename="desktop.ini";
    size=402;
    creation-date=Wed, 30 Oct 2013 14:17:14 GMT;
    modification-date=Wed, 30 Oct 2013 14:17:14 GMT

This is the simple script that we used to test the behaviour.

<SCRIPT LANGUAGE="VBScript">
Sub ISMTPOnArrival_OnArrival(ByVal oMsg, iStatus)

oMsg.DataSource.Save

End Sub
</SCRIPT>

The quotes are removed even if I try to add quotes by rewriting the creation-date field as follows.

CreationDate = "creation-date=" & Chr(34) & "Wed, 30 Oct 2013 14:17:14 GMT" & Chr(34)

Is this a bug in CDO?

Are there any workarounds possible except removing creation-date and modification-date completely?

0

There are 0 answers