Closed Bug 381659 Opened 16 years ago Closed 14 years ago

"Multipart/Encrypted" not supported, only "multipart/encrypted"

Categories

(Thunderbird :: Mail Window Front End, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 3.0b1

People

(Reporter: danai.sae-han, Assigned: mkmelin)

References

Details

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; nl; rv:1.8.1.3) Gecko/20070310 Iceweasel/2.0.0.3 (Debian-2.0.0.3-2)
Build Identifier: Mozilla-Thunderbird 1.5.0.10

Hi!

When I send encrypted emails from Mew (Messaging in the Emacs World; http://www.mew.org/), I can't open them in TB+Enigmail.

Problem is that TB doesn't understand "Multipart/Encrypted".  But when I manually edit the outgoing email from Mew, and replace it with the lowercase "multipart/encrypted", TB will recognize my email and Enigmail will do its work just fine.

I hope you can fix this problem.

Thanks


/Danai

Reproducible: Always

Steps to Reproduce:
1. Send an encrypted email from Mew
2. Open TB and receive the email
3. Open the email
Actual Results:  
Blank message window, with "Part 1.1" and "Part 1.2" as attachments, the first containing the Mime version "1.0", the latter the raw encrypted message.

Expected Results:  
Popup window asking me for a password, and decrypting the email.

http://mozdev.org/bugs/show_bug.cgi?id=7269 shows that this bug has been reported two and a half years ago against Enigmail, but the author wrote this needed to be fixed in TB to get an elegant solution.
Version: unspecified → 1.5
for reference, http://www.faqs.org/rfcs/rfc2045.html (mime)
5.1.  Syntax of the Content-Type Header Field
     content := "Content-Type" ":" type "/" subtype
                *(";" parameter)
                ; Matching of media type and subtype
                ; is ALWAYS case-insensitive.
   The type, subtype, and parameter names are not case sensitive.  For
   example, TEXT, Text, and TeXt are all equivalent top-level media
   types.
Indeed.  I reported this bug, because apparently bug #59619, "MIME types should not be case sensitive" (https://bugzilla.mozilla.org/show_bug.cgi?id=59619), is not the same as this one.
I just installed Mozilla-Thunderbird 2.0.0.0, and it has the same problem: the encrypted email appears as "Part 1.1" and "Part 1.2".
(In reply to comment #0)
> User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; nl; rv:1.8.1.3)
> Gecko/20070310 Iceweasel/2.0.0.3 (Debian-2.0.0.3-2)
> Build Identifier: Mozilla-Thunderbird 1.5.0.10
> 
> Hi!
> 
> When I send encrypted emails from Mew (Messaging in the Emacs World;
> http://www.mew.org/), I can't open them in TB+Enigmail.
> 
> Problem is that TB doesn't understand "Multipart/Encrypted".  But when I
> manually edit the outgoing email from Mew, and replace it with the lowercase
> "multipart/encrypted", TB will recognize my email and Enigmail will do its work
> just fine.
> 
> I hope you can fix this problem.
> 
> Thanks
> 
> 
> /Danai
> 
> Reproducible: Always
> 
> Steps to Reproduce:
> 1. Send an encrypted email from Mew
> 2. Open TB and receive the email
> 3. Open the email
> Actual Results:  
> Blank message window, with "Part 1.1" and "Part 1.2" as attachments, the first
> containing the Mime version "1.0", the latter the raw encrypted message.
> 
> Expected Results:  
> Popup window asking me for a password, and decrypting the email.
> 
> http://mozdev.org/bugs/show_bug.cgi?id=7269 shows that this bug has been
> reported two and a half years ago against Enigmail, but the author wrote this
> needed to be fixed in TB to get an elegant solution.
> 

That said, I'm not sure this is a bug in TB per se.  I suspect WONTFIX, but hat is a developer decision.
I almost forgot about this bug. Scott, maybe you have any idea? For some strange reason, none of the Enigmail code is called if the content-type of an email ("mutlipart/encrypted") is not 100% in small letters. 

Here is how I register the content-type handler in Mozilla:
  static const nsModuleComponentInfo info =
  { "Enigmail Content Handler",
    NS_ENIGCONTENTHANDLER_CID /* some UUID */,
    ""@mozilla.org/mimecth;1?type=multipart/encrypted",
    nsEnigContentHandlerConstructor,
  };

  // Create a generic factory for the content handler
  nsCOMPtr<nsIGenericFactory> factory;
  rv = NS_NewGenericFactory(getter_AddRefs(factory), &info);
  if (NS_FAILED(rv)) return rv;

  nsCOMPtr<nsIComponentRegistrar> registrar;
  rv = NS_GetComponentRegistrar(getter_AddRefs(registrar));
  if (NS_FAILED(rv)) return rv;

  // Register factory
  rv = registrar->RegisterFactory(info.mCID, info.mDescription,
                                           info.mContractID, factory);

  if (NS_FAILED(rv)) return rv;
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee: mscott → nobody
I wonder if this still exists on trunk? Might have been fixed by the changes in bug 409962.
Unfortunately the bug is still not fixed, I checked with the latest nightly build (20080831030154): .
Attached patch proposed fix (obsolete) — Splinter Review
Patrick: are you able to try and see if this patch fixes it for you?
Assignee: nobody → mkmelin+mozilla
Status: NEW → ASSIGNED
Magnus, I tried the patch: yes it fixes the bug -- I'd say commit it :-)
Attachment #342796 - Flags: superreview?(bienvenu)
Attachment #342796 - Flags: review?(bienvenu)
Comment on attachment 342796 [details] [diff] [review]
proposed fix

this would leak memory, since ToNewCString allocates. You should just be able to use lowerCaseContentType.get().

While we're here, and testing this code, we should rewrite it to use an nsCString for lookupID. Then, I think we can just init it with "@mozilla.org/mimecth;1?type=", and append the lower case content type, or append the content_type and lower case the whole string...
Attachment #342796 - Flags: superreview?(bienvenu)
Attachment #342796 - Flags: superreview-
Attachment #342796 - Flags: review?(bienvenu)
Attachment #342796 - Flags: review-
Attached patch proposed fix, v2Splinter Review
Hopefully this is better:)
Attachment #342796 - Attachment is obsolete: true
Attachment #343068 - Flags: superreview?(bienvenu)
Attachment #343068 - Flags: review?(bienvenu)
Attachment #343068 - Flags: superreview?(bienvenu)
Attachment #343068 - Flags: superreview+
Attachment #343068 - Flags: review?(bienvenu)
Attachment #343068 - Flags: review+
Comment on attachment 343068 [details] [diff] [review]
proposed fix, v2

yes, thanks!
changeset:   610:0e2ef43af74d
http://hg.mozilla.org/comm-central/rev/0e2ef43af74d

->FIXED
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
OS: Linux → All
Hardware: PC → All
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 3.0b1
Depends on: 460058
You need to log in before you can comment on or make changes to this bug.