Bug 282982

Summary: Violation of RfC 2633 Chapter 3.8 - smime.p7m is not recognized as encrypted mail, not encrypted, displayed in-line when the content-type is application/octet-stream
Product: [Applications] kmail2 Reporter: Thomas Arend <thomas>
Component: message listAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: grave CC: montel, sknauss, thomas, winter
Priority: NOR    
Version: 4.9.4   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 4.10.3
Attachments: Example Mail which shows the behavior when opening in kontact
MessageWindow showing encrypted attachment as smime.p7m
Message Window showing decrypted message text

Description Thomas Arend 2011-09-28 18:48:57 UTC
Version:           4.4.10 (using KDE 4.6.0) 
OS:                Linux

In accordance with RfC 2633 Chapter 3.8 a s/mime encrypted attachment should be also identified by the file suffixs p7m, p7s, p7m.

When a s/mine encrypted message is received with an attachemt descibed as

Content-type: application/octet-stream;
  name="smime.p7m"
Content-Disposition: attachment; filename="smime.p7m"
Content-transfer-encoding: base64

then the attachment is not recognised as a s/mime encrypted attachment.

A work-around is changing the content-type manualy to "application/pkcs7-mime" (with a filter).

This behavior may occure with some none complaied gateways (probably Lotus Notes or McAFee Scanner) which can't understand s/mime extensions and replace pkcs7-mime with octet-stream partly in an random manner.


Reproducible: Always

Steps to Reproduce:
Send a s/mime encryted mail to yourself, change the Content-Type from aplication/pkcs7-mime to application/octet-stream manualy.

Actual Results:  
smime.p7m is shown as an unknown attachment.

Expected Results:  
Decrypt, verify all attachments with the file name suffix p7m, p7s or p7c iaw RfC 2633 3.8 and display it in the same manner when it is received with contend type application/pkcs7-mime.


sed Filter for work around:

/^Content-type: application\/octet-stream;/,/^\ \ name="smime.p7m"/ s#octet-stream#pkcs7-mime#
Comment 1 Thomas Arend 2011-09-28 18:51:12 UTC
Created attachment 64041 [details]
Example Mail which shows the behavior when opening in kontact

Mbox mail with "wrong" attachment content-type.
Comment 2 Thomas Arend 2011-09-28 18:57:11 UTC
Created attachment 64042 [details]
MessageWindow showing encrypted attachment as smime.p7m

This depicts how the message is displayed.
Comment 3 Thomas Arend 2011-09-28 18:59:43 UTC
Created attachment 64043 [details]
Message Window showing decrypted message text

This screen shot depict how it should / could be displayed!
Comment 4 Thomas Arend 2012-03-04 11:50:22 UTC
Bug is also in Kmail 4.7.2
Comment 5 Thomas Arend 2012-09-15 02:24:15 UTC
It is still in
Comment 6 Thomas Arend 2012-12-09 16:29:05 UTC
The error is still in Version 4.9.4.

Seems that nobody cares.
Comment 7 Laurent Montel 2012-12-09 17:21:33 UTC
by default it was kmail1
so perhaps you ca
Comment 8 Laurent Montel 2012-12-09 17:21:50 UTC
by default it was kmail1
so perhaps you can change to kmail2...
Comment 9 Thomas Arend 2012-12-12 07:23:51 UTC
Changed . It is also kmail2
Comment 10 Laurent Montel 2012-12-12 07:42:56 UTC
I confirm it.
Will look at it soon.
Comment 11 Allen Winter 2013-03-30 15:36:51 UTC
CC: Sandro 
Might already be fixed?  Anyway, Sandro probably knows this stuff best at this point.
Comment 12 Sandro Knauß 2013-03-30 17:58:29 UTC
Nope isn't fixed.
Comment 13 Sandro Knauß 2013-04-16 13:19:28 UTC
Git commit 789e88fb47ba148ec49f8d9a6c2fe938d40560fb by Sandro Knauß.
Committed on 14/04/2013 at 15:47.
Pushed by knauss into branch 'KDE/4.10'.

Fix Bug #282982 - Violation of RfC 2633 Chapter 3.8

Violation of RfC 2633 Chapter 3.8 - smime.p7m is not recognized as
encrypted mail, not encrypted, displayed in-line when the content-type
is application/octet-stream.
FIXED-IN: 4.10.3
REVIEW: 110011

M  +9    -0    messageviewer/objecttreeparser.cpp

http://commits.kde.org/kdepim/789e88fb47ba148ec49f8d9a6c2fe938d40560fb