Closed Bug 131087 Opened 23 years ago Closed 23 years ago

Failure on sending S/Mime messages should display the correct reason

Categories

(MailNews Core :: Security: S/MIME, defect)

Other Branch
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: KaiE, Assigned: KaiE)

References

Details

Attachments

(2 files)

For examples, see bug 127364 or bug 121287. The current code gives misleading information to the user when sending is not possible. Currently, it just displays a general statement about "wrong email settings". It should be stating that there is a problem caused by certificates, if that's the real reason.
Assigning to me, nsbeta1+.
Assignee: ssaux → kaie
Keywords: nsbeta1+
*** Bug 119540 has been marked as a duplicate of this bug. ***
I'd like to land this before the UI freeze. Although I'm just defining two additional strings, I guess it's better to land today or tomorrow. Will attach a patch in a minute.
Attached patch Suggested fixSplinter Review
David, can you please review the code? Sean, can you please review the two added strings? (search for "properties" in the patch). Thanks!
David, in the code I'm changing, I'm removing comments which say XXX fix this later The comment did not say what exactly should get fixed. Are those comments from you and is the only thing that's missing, giving feedback to the user? Or is there more to do? A hint for reviewing: I'm removing a line that checks for "status < 0". I'm removing it, because a couple of lines above, there is already the same line, and the variable is not changed after and and before the removed check.
Comment on attachment 76586 [details] [diff] [review] Suggested fix r=ddrinan.
Attachment #76586 - Flags: review+
Jag, can you please sr= ? I would like to land this today or on Friday, because it is a UI relevant change. Thanks!
Comment on attachment 76586 [details] [diff] [review] Suggested fix >Index: mozilla/mailnews/extensions/smime/src/nsMsgComposeSecure.cpp >=================================================================== >RCS file: /cvsroot/mozilla/mailnews/extensions/smime/src/nsMsgComposeSecure.cpp,v >retrieving revision 1.11 >diff -u -d -r1.11 nsMsgComposeSecure.cpp >--- mozilla/mailnews/extensions/smime/src/nsMsgComposeSecure.cpp 27 Mar 2002 03:27:43 -0000 1.11 >+++ mozilla/mailnews/extensions/smime/src/nsMsgComposeSecure.cpp 28 Mar 2002 17:47:25 -0000 ... >+ if (NS_SUCCEEDED(res) && errorString.Length()) !errorString.IsEmpty() (Both places) >@@ -572,17 +630,19 @@ > PR_ASSERT(mSelfEncryptionCert); > PR_SetError(0,0); > mEncryptionCinfo = do_CreateInstance(NS_CMSMESSAGE_CONTRACTID, &rv); >- if (NS_FAILED(rv)) return 0; >- rv = mEncryptionCinfo->CreateEncrypted(mCerts); // XXX Fix this later XXX // >+ if (NS_FAILED(rv)) return NS_ERROR_OUT_OF_MEMORY; I would just return rv here instead of assuming we're out of memory. If you suspect mEncryptionCinfo could be null while NS_SUCCEEDED(rv), add a ! check on that and then return NS_ERROR_OUTOFMEMORY. Also, you're effectively changing this case from NS_SUCCEEDED to NS_FAILED, are all callers ready to deal with that? (Both places)
>>+ if (NS_SUCCEEDED(res) && errorString.Length()) > > !errorString.IsEmpty() > > (Both places) ok, changed. >> mEncryptionCinfo = do_CreateInstance(NS_CMSMESSAGE_CONTRACTID, &rv); >>- if (NS_FAILED(rv)) return 0; >>+ if (NS_FAILED(rv)) return NS_ERROR_OUT_OF_MEMORY; > > I would just return rv here instead of assuming we're out of memory. You're right, I changed that in both places. > Also, you're effectively changing this case from NS_SUCCEEDED to NS_FAILED, are > all callers ready to deal with that? Yes, I think it should be that way. Our only caller is in nsMsgSendPart, routed through nsMsgSend. We arrive in this method only if there is actually encryption work to do. If we are asked to encrypt, but we can't do our job, then we should return failure, and cause the mail sending code to give up.
Attached patch Updated PatchSplinter Review
Comment on attachment 76764 [details] [diff] [review] Updated Patch a=asa (on behalf of drivers) for checkin to the 1.0 trunk
Attachment #76764 - Flags: approval+
Keywords: adt1.0.0
adt1.00+ per ADT triage, pending L10N approval. Adding mcarlson for L10N approval for strings.
Keywords: adt1.0.0adt1.0.0+
l10n approved. thanks
Comments on the new strings: +ErrorCanNotEncrypt=Unable to encrypt the message. Please check that you have a valid email certificate for each recipient. Please check that your own configured mail security certificates for this mail account are valid and trusted. Change to: "Unable to encrypt message. Please check that you have a valid email certificate for each recipient. Please check that the certificates specified in Mail & Newsgroups Account Settings for this mail account are valid and trusted. +ErrorCanNotSign=Unable to sign the message. Please check that your own configured mail security certificates for this mail account are valid and trusted. Change to: "Unable to sign message. Please check that the certificates specified in Mail & Newsgroups Account Settings for this mail account are valid and trusted. Reason in both cases is to give user a bit more of a clue re where to look, plus consistency with usage elsewhere.
QA Contact: alam → carosendahl
Comment on attachment 76764 [details] [diff] [review] Updated Patch looks good to me, R=ducarroz
Attachment #76764 - Flags: review+
Comment on attachment 76764 [details] [diff] [review] Updated Patch sr=jag
Attachment #76764 - Flags: superreview+
Checked in, using Sean's suggested text.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Verified.
Status: RESOLVED → VERIFIED
Is this also in the branch yet?
This landed on the trunk before the 1.0.0 branch was created, so the answer is yes.
Product: PSM → Core
Product: Core → MailNews Core
QA Contact: carosendahl → s.mime
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: