biddyweb / android-rcs-ims-stack

Automatically exported from code.google.com/p/android-rcs-ims-stack
2 stars 1 forks source link

Content-Disposition header position in CPIM messages #79

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Client receives an instant message, sends an IMDN delivery/display 
notification back

What is the expected output? What do you see instead?

Expected: Content-Disposition header should be in the embedded MIME object 
header section, after the CRLF.
Example between dashed lines:
-----
From: <sip:anonymous@anonymous.invalid>
To: <sip:anonymous@anonymous.invalid>
NS: imdn <urn:ietf:params:imdn>
imdn.Message-ID: 1L0dFkTiJA
DateTime: 2012-08-08T09:01:05.000Z

Content-Disposition: notification
Content-type: message/imdn+xml
Content-length: 251

<?xml version="1.0" encoding="UTF-8"?>
<imdn xmlns="urn:ietf:params:xml:ns:imdn">
<message-id>7a2896f3</message-id>
<datetime>2012-08-08T09:01:05.000Z</datetime>
<delivery-notification><status><delivered/></status></delivery-notification>
</imdn>
-----

Actual output: the header is in the CPIM message metadata headers section. 
Example:
-----
From: <sip:anonymous@anonymous.invalid>
To: <sip:anonymous@anonymous.invalid>
NS: imdn <urn:ietf:params:imdn>
imdn.Message-ID: 1L0dFkTiJA
DateTime: 2012-08-08T09:01:05.000Z
Content-Disposition: notification

Content-type: message/imdn+xml
Content-length: 251

<?xml version="1.0" encoding="UTF-8"?>
<imdn xmlns="urn:ietf:params:xml:ns:imdn">
<message-id>7a2896f3</message-id>
<datetime>2012-08-08T09:01:05.000Z</datetime>
<delivery-notification><status><delivered/></status></delivery-notification>
</imdn>
-----

What version of the product are you using? On what operating system?
Used version 2.4.2, but the issue is visible in current trunk code.
File:
https://code.google.com/p/android-rcs-ims-stack/source/browse/trunk/core/src/com
/orangelabs/rcs/core/ims/service/im/chat/ChatUtils.java
Method:
public static String buildCpimDeliveryReport(String from, String to, String 
imdn);

Please provide any additional information below.

According to RFC3862, the CPIM message structure is:
m: Content-type: Message/CPIM
s:
h: (message-metadata-headers)
s:
e: (encapsulated MIME message-body)

Since Content-Disposition is not a general CPIM header, but a MIME content 
header only required by IMDN (RFC5438) in this case, it should be considered 
part of the embedded content and placed after the empty separator line just 
like the Content-type and Content-length headers.
(Note: RFC for IMDN omits the separator line altogether in its examples, which 
should be invalid CPIM.)

Original issue reported on code.google.com by tamas.gy...@gmail.com on 8 Aug 2012 at 10:22

GoogleCodeExporter commented 9 years ago
For reference, the correct structure is reported here
http://www.rfc-editor.org/errata_search.php?rfc=5438

It should say:
   From: Bob <im:bob@example.com>
   To: Alice <im:alice@example.com>
   NS: imdn <urn:ietf:params:imdn>
   imdn.Message-ID: d834jied93rf

   Content-type: message/imdn+xml
   Content-Disposition: notification
   Content-length: ...

Original comment by mcd...@mcdull.us on 6 Mar 2014 at 11:45

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r548.

Original comment by lemordan...@gmail.com on 2 Apr 2014 at 11:51