Bug 474283 Drop redundant nsMsgSimulateError.h debug code. r/sr=bienvenu
authorMark Banner <bugzilla@standard8.plus.com>
Mon, 19 Jan 2009 18:33:05 +0000
changeset 1692 d2442ac0de7f1acf0685472f76e24aa03c2cbd15
parent 1691 739ea2707464ed16694cc8f85abe22ef3245cf46
child 1693 6785834e804c3a6de3a95d239a18579684db80ef
push id1356
push userbugzilla@standard8.plus.com
push dateMon, 19 Jan 2009 18:34:14 +0000
treeherdercomm-central@d2442ac0de7f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs474283
Bug 474283 Drop redundant nsMsgSimulateError.h debug code. r/sr=bienvenu
mailnews/compose/src/nsMsgAttachmentHandler.cpp
mailnews/compose/src/nsMsgCompUtils.cpp
mailnews/compose/src/nsMsgCompose.cpp
mailnews/compose/src/nsMsgCopy.cpp
mailnews/compose/src/nsMsgSend.cpp
mailnews/compose/src/nsMsgSendLater.cpp
mailnews/compose/src/nsMsgSimulateError.h
mailnews/compose/src/nsSmtpProtocol.cpp
mailnews/compose/src/nsSmtpService.cpp
--- a/mailnews/compose/src/nsMsgAttachmentHandler.cpp
+++ b/mailnews/compose/src/nsMsgAttachmentHandler.cpp
@@ -48,17 +48,16 @@
 #include "nsMimeTypes.h"
 #include "nsMsgCompCID.h"
 #include "nsReadableUtils.h"
 #include "nsIMsgMessageService.h"
 #include "nsMsgUtils.h"
 #include "nsMsgPrompts.h"
 #include "nsTextFormatter.h"
 #include "nsIPrompt.h"
-#include "nsMsgSimulateError.h"
 #include "nsITextToSubURI.h"
 #include "nsEscape.h"
 #include "nsIURL.h"
 #include "nsIFileURL.h"
 #include "nsNetCID.h"
 #include "nsIMimeStreamConverter.h"
 #include "nsMsgMimeCID.h"
 #include "nsNetUtil.h"
@@ -560,17 +559,17 @@ nsMsgAttachmentHandler::SnarfMsgAttachme
     if (!mTmpFile)
     {
       rv = NS_ERROR_FAILURE;
       goto done;
     }
 
     nsCOMPtr<nsIOutputStream> outputStream;
     rv = NS_NewLocalFileOutputStream(getter_AddRefs(outputStream), mTmpFile, -1, 00600);
-    if (NS_FAILED(rv) || !outputStream || CHECK_SIMULATED_ERROR(SIMULATED_SEND_ERROR_3))
+    if (NS_FAILED(rv) || !outputStream)
     {
       if (m_mime_delivery_state)
       {
         nsCOMPtr<nsIMsgSendReport> sendReport;
         m_mime_delivery_state->GetSendReport(getter_AddRefs(sendReport));
         if (sendReport)
         {
           nsAutoString error_msg;
@@ -692,17 +691,17 @@ nsMsgAttachmentHandler::SnarfAttachment(
   nsCOMPtr <nsIFile> tmpFile;
   nsresult rv = nsMsgCreateTempFile("nsmail.tmp", getter_AddRefs(tmpFile));
   NS_ENSURE_SUCCESS(rv, rv);
   mTmpFile = do_QueryInterface(tmpFile);
   mDeleteFile = PR_TRUE;
 
   nsCOMPtr<nsIOutputStream> outputStream;
   rv = NS_NewLocalFileOutputStream(getter_AddRefs(outputStream), mTmpFile, -1, 00600);
-  if (NS_FAILED(rv) || !outputStream || CHECK_SIMULATED_ERROR(SIMULATED_SEND_ERROR_3))
+  if (NS_FAILED(rv) || !outputStream)
   {
     if (m_mime_delivery_state)
     {
       nsCOMPtr<nsIMsgSendReport> sendReport;
       m_mime_delivery_state->GetSendReport(getter_AddRefs(sendReport));
       if (sendReport)
       {
         nsAutoString error_msg;
--- a/mailnews/compose/src/nsMsgCompUtils.cpp
+++ b/mailnews/compose/src/nsMsgCompUtils.cpp
@@ -51,26 +51,20 @@
 #include "nsMimeTypes.h"
 #include "nsReadableUtils.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsIDocumentEncoder.h"    // for editor output flags
 #include "nsIURI.h"
 #include "nsNetCID.h"
 #include "nsMsgPrompts.h"
 #include "nsMsgUtils.h"
-#include "nsMsgSimulateError.h"
 #include "nsComposeStrings.h"
 #include "nsIMsgCompUtils.h"
 #include "nsIMsgMdnGenerator.h"
 
-#ifdef MOZ_THUNDERBIRD
-#include "nsIXULAppInfo.h"
-#include "nsXULAppAPI.h"
-#endif
-
 NS_IMPL_ISUPPORTS1(nsMsgCompUtils, nsIMsgCompUtils)
 
 nsMsgCompUtils::nsMsgCompUtils()
 {
 }
 
 nsMsgCompUtils::~nsMsgCompUtils()
 {
@@ -225,22 +219,21 @@ nsresult mime_sanity_check_fields (
   if (newsgroups)
     while (IS_SPACE (*newsgroups))
       newsgroups++;
   if (followup_to)
     while (IS_SPACE (*followup_to))
       followup_to++;
 
   /* #### sanity check other_random_headers for newline conventions */
-  if (!from || !*from || CHECK_SIMULATED_ERROR(SIMULATED_SEND_ERROR_6))
+  if (!from || !*from)
     return NS_MSG_NO_SENDER;
   else
-    if (((!to || !*to) && (!cc || !*cc) &&
-        (!bcc || !*bcc) && (!newsgroups || !*newsgroups)) ||
-        CHECK_SIMULATED_ERROR(SIMULATED_SEND_ERROR_7))
+    if ((!to || !*to) && (!cc || !*cc) &&
+        (!bcc || !*bcc) && (!newsgroups || !*newsgroups))
       return NS_MSG_NO_RECIPIENTS;
   else
     return NS_OK;
 }
 
 static char *
 nsMsgStripLine (char * string)
 {
--- a/mailnews/compose/src/nsMsgCompose.cpp
+++ b/mailnews/compose/src/nsMsgCompose.cpp
@@ -94,17 +94,16 @@
 #include "nsILocale.h"
 #include "nsIMsgComposeService.h"
 #include "nsIMsgComposeProgressParams.h"
 #include "nsMsgUtils.h"
 #include "nsIMsgImapMailFolder.h"
 #include "nsImapCore.h"
 #include "nsUnicharUtils.h"
 #include "nsNetUtil.h"
-#include "nsMsgSimulateError.h"
 #include "nsIContentViewer.h"
 #include "nsIMarkupDocumentViewer.h"
 #include "nsIMsgMdnGenerator.h"
 #include "plbase64.h"
 #include "nsIUTF8ConverterService.h"
 #include "nsUConvCID.h"
 #include "nsIUnicodeNormalizer.h"
 #include "nsIMsgAccountManager.h"
@@ -1089,17 +1088,16 @@ NS_IMETHODIMP nsMsgCompose::SendMsg(MSG_
       // Convert body to mail charset
       nsCString outCString;
       nsCString fallbackCharset;
       PRBool isAsciiOnly;
       // check if the body text is covered by the current charset.
       rv = nsMsgI18NSaveAsCharset(contentType, m_compFields->GetCharacterSet(),
                                   msgBody.get(), getter_Copies(outCString),
                                   getter_Copies(fallbackCharset), &isAsciiOnly);
-      SET_SIMULATED_ERROR(SIMULATED_SEND_ERROR_14, rv, NS_ERROR_UENC_NOMAPPING);
       if (m_compFields->GetForceMsgEncoding())
         isAsciiOnly = PR_FALSE;
       if (NS_SUCCEEDED(rv) && !outCString.IsEmpty())
       {
         // If the body contains characters outside the repertoire of the current
         // charset, just convert to UTF-8 and be done with it.
         if (NS_ERROR_UENC_NOMAPPING == rv && m_editor) {
           PRBool needToCheckCharset;
--- a/mailnews/compose/src/nsMsgCopy.cpp
+++ b/mailnews/compose/src/nsMsgCopy.cpp
@@ -50,17 +50,16 @@
 #include "nsIRDFResource.h"
 #include "nsRDFCID.h"
 #include "nsIURL.h"
 #include "nsNetCID.h"
 #include "nsMsgCompUtils.h"
 #include "prcmon.h"
 #include "nsIMsgImapMailFolder.h"
 #include "nsThreadUtils.h"
-#include "nsMsgSimulateError.h"
 #include "nsIMsgWindow.h"
 #include "nsIMsgProgress.h"
 #include "nsComposeStrings.h"
 #include "prmem.h"
 #include "nsServiceManagerUtils.h"
 #include "nsComponentManagerUtils.h"
 
 static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
@@ -222,17 +221,17 @@ nsMsgCopy::StartCopyOperation(nsIMsgIden
     isDraft = PR_TRUE;
     if (!dstFolder || NS_FAILED(rv))
       return NS_MSG_UNABLE_TO_SAVE_DRAFT;
   }
   else if (aMode == nsIMsgSend::nsMsgSaveAsTemplate) // SaveAsTemplate (Templates)
   {
     rv = GetTemplatesFolder(aUserIdentity, getter_AddRefs(dstFolder), &waitForUrl);
     isDraft = PR_FALSE;
-    if (!dstFolder || NS_FAILED(rv) || CHECK_SIMULATED_ERROR(SIMULATED_SEND_ERROR_5))
+    if (!dstFolder || NS_FAILED(rv))
 	    return NS_MSG_UNABLE_TO_SAVE_TEMPLATE;
   }
   else // SaveInSentFolder (Sent) -  nsMsgDeliverNow or nsMsgSendUnsent
   {
     rv = GetSentFolder(aUserIdentity, getter_AddRefs(dstFolder), &waitForUrl);
     isDraft = PR_FALSE;
     if (!dstFolder || NS_FAILED(rv))
       return NS_MSG_COULDNT_OPEN_FCC_FOLDER;
@@ -413,18 +412,16 @@ nsMsgCopy::CreateIfMissing(nsIMsgFolder 
 nsresult
 LocateMessageFolder(nsIMsgIdentity   *userIdentity,
                     nsMsgDeliverMode aFolderType,
                     const char       *aFolderURI,
                     nsIMsgFolder     **msgFolder)
 {
   nsresult                  rv = NS_OK;
 
-  RETURN_SIMULATED_ERROR(SIMULATED_SEND_ERROR_5, NS_ERROR_FAILURE)
-
   if (!msgFolder) return NS_ERROR_NULL_POINTER;
   *msgFolder = nsnull;
 
   if (!aFolderURI || !*aFolderURI)
     return NS_ERROR_INVALID_ARG;
 
   // as long as it doesn't start with anyfolder://
   if (PL_strncasecmp(ANY_SERVER, aFolderURI, strlen(aFolderURI)) != 0)
--- a/mailnews/compose/src/nsMsgSend.cpp
+++ b/mailnews/compose/src/nsMsgSend.cpp
@@ -88,17 +88,16 @@
 #include "nsMimeTypes.h"
 #include "nsISmtpUrl.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIEditorMailSupport.h"
 #include "nsIDocumentEncoder.h"    // for editor output flags
 #include "nsILoadGroup.h"
 #include "nsMsgSendReport.h"
-#include "nsMsgSimulateError.h"
 #include "nsNetCID.h"
 #include "nsNetError.h"
 #include "nsMsgUtils.h"
 #include "nsIMsgMdnGenerator.h"
 #include "nsISmtpServer.h"
 #include "nsIRDFService.h"
 #include "nsRDFCID.h"
 #include "nsIMsgAccountManager.h"
@@ -777,17 +776,17 @@ nsMsgComposeAndSend::GatherMimeAttachmen
   SetStatusMessage( msg );
 
   /* First, open the message file.
   */
   rv = nsMsgCreateTempFile("nsemail.eml", getter_AddRefs(mTempFile));
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = NS_NewLocalFileOutputStream(getter_AddRefs(mOutputFile), mTempFile, -1, 00600);
-  if (NS_FAILED(rv) || CHECK_SIMULATED_ERROR(SIMULATED_SEND_ERROR_4))
+  if (NS_FAILED(rv))
   {
     status = NS_MSG_UNABLE_TO_OPEN_TMP_FILE;
     if (mSendReport)
     {
       nsAutoString error_msg;
       nsCAutoString cPath;
       nsAutoString path;
       mTempFile->GetNativePath(cPath);
@@ -1382,17 +1381,17 @@ nsresult
 mime_write_message_body(nsIMsgSend *state, const char *buf, PRInt32 size)
 {
   NS_ENSURE_ARG_POINTER(state);
 
   nsCOMPtr<nsIOutputStream> output;
   nsCOMPtr<nsIMsgComposeSecure> crypto_closure;
 
   state->GetOutputStream(getter_AddRefs(output));
-  if (!output || CHECK_SIMULATED_ERROR(SIMULATED_SEND_ERROR_9))
+  if (!output)
     return NS_MSG_ERROR_WRITING_FILE;
 
   state->GetCryptoclosure(getter_AddRefs(crypto_closure));
   if (crypto_closure)
   {
     return crypto_closure->MimeCryptoWriteBlock (buf, size);
   }
 
@@ -3403,18 +3402,16 @@ nsMsgComposeAndSend::Init(
   }
 
   // Tell the user we are assembling the message...
   mComposeBundle->GetStringFromID(NS_MSG_ASSEMBLING_MESSAGE, getter_Copies(msg));
   SetStatusMessage(msg);
   if (mSendReport)
     mSendReport->SetCurrentProcess(nsIMsgSendReport::process_BuildMessage);
 
-  RETURN_SIMULATED_ERROR(SIMULATED_SEND_ERROR_1, NS_ERROR_FAILURE);
-
   //
   // The Init() method should initialize a send operation for full
   // blown create and send operations as well as just the "send a file"
   // operations.
   //
   m_dont_deliver_p = dont_deliver_p;
   m_deliver_mode = mode;
   mMsgToReplace = msgToReplace;
@@ -3588,18 +3585,17 @@ nsMsgComposeAndSend::DeliverMessage()
   // if this is a mongo email...we should have a way to warn the user that
   // they are about to do something they may not want to do.
   //
   PRInt64 fileSize;
   nsresult rv = mTempFile->GetFileSize(&fileSize);
   if (NS_FAILED(rv))
     return NS_ERROR_FAILURE;
 
-  if (((mMessageWarningSize > 0) && (fileSize > mMessageWarningSize) && (mGUINotificationEnabled)) ||
-      CHECK_SIMULATED_ERROR(SIMULATED_SEND_ERROR_15))
+  if ((mMessageWarningSize > 0) && (fileSize > mMessageWarningSize) && (mGUINotificationEnabled))
   {
     PRBool abortTheSend = PR_FALSE;
     nsString msg;
     mComposeBundle->GetStringFromID(NS_MSG_LARGE_MESSAGE_WARNING, getter_Copies(msg));
 
     if (!msg.IsEmpty())
     {
       PRUnichar *printfString = nsTextFormatter::smprintf(msg.get(), fileSize);
@@ -4596,17 +4592,17 @@ nsMsgComposeAndSend::MimeDoFCC(nsIFile  
     return status;
   }
 
   //
   // Get our files ready...
   //
   nsCOMPtr<nsIInputStream> inputFile;
   rv = NS_NewLocalFileInputStream(getter_AddRefs(inputFile), input_file);
-  if (NS_FAILED(rv) || CHECK_SIMULATED_ERROR(SIMULATED_SEND_ERROR_2))
+  if (NS_FAILED(rv))
   {
     if (mSendReport)
     {
       nsAutoString error_msg;
       nsCAutoString cPath;
       nsAutoString path;
       mTempFile->GetNativePath(cPath);
       NS_CopyNativeToUnicode(cPath, path);
--- a/mailnews/compose/src/nsMsgSendLater.cpp
+++ b/mailnews/compose/src/nsMsgSendLater.cpp
@@ -48,17 +48,16 @@
 #include "nsMsgUtils.h"
 #include "nsMailHeaders.h"
 #include "nsMsgPrompts.h"
 #include "nsISmtpUrl.h"
 #include "nsIChannel.h"
 #include "nsNetUtil.h"
 #include "prlog.h"
 #include "prmem.h"
-#include "nsMsgSimulateError.h"
 #include "nsIMimeConverter.h"
 #include "nsMsgMimeCID.h"
 #include "nsComposeStrings.h"
 #include "nsIMutableArray.h"
 
 NS_IMPL_ISUPPORTS3(nsMsgSendLater,
                    nsIMsgSendLater,
                    nsIRequestObserver,
@@ -119,17 +118,16 @@ nsMsgSendLater::OnStopRequest(nsIRequest
     DeliverQueuedLine(mLeftoverBuffer, PL_strlen(mLeftoverBuffer));
   }
 
   if (mOutFile)
     mOutFile->Close();
 
   // See if we succeeded on reading the message from the message store?
   //
-  SET_SIMULATED_ERROR(SIMULATED_SEND_ERROR_13, status, NS_ERROR_FAILURE);
   if (NS_SUCCEEDED(status))
   {
     // Message is done...send it!
     rv = CompleteMailFileSend();
 
 #ifdef NS_DEBUG
     printf("nsMsgSendLater: Success on getting message...\n");
 #endif
deleted file mode 100644
--- a/mailnews/compose/src/nsMsgSimulateError.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Jean-Francois Ducarroz <ducarroz@netscape.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#define SIMULATE_ERROR  0
-
-#if (SIMULATE_ERROR)
-  extern long SIMULATED_SEND_ERROR_ID;
-
-  enum
-  {
-    SIMULATED_SEND_ERROR_1 = 1, // Failure during the initialization
-    SIMULATED_SEND_ERROR_2,     // Failure while openning message to copy
-    SIMULATED_SEND_ERROR_3,     // Failure while opening a temp file for attachment handling
-    SIMULATED_SEND_ERROR_4,     // Failure while opening a temp file for converting to plain text a part. JFD: IMPORTANT TO TEST THIS CASE!
-    SIMULATED_SEND_ERROR_5,     // Failure while Locate a Message Folder
-    SIMULATED_SEND_ERROR_6,     // Simulate no sender
-    SIMULATED_SEND_ERROR_7,     // Simulate no recipient - nsMsgSend
-    SIMULATED_SEND_ERROR_8,     // Simulate no recipient - inside smtp
-    SIMULATED_SEND_ERROR_9,     // Simulate failure in mime_write_message_body
-    SIMULATED_SEND_ERROR_10,    // Simulate SMTP logging error
-    SIMULATED_SEND_ERROR_11,    // Simulate SMTP protocol error (1)
-    SIMULATED_SEND_ERROR_12,    // Simulate SMTP protocol error (2)
-    SIMULATED_SEND_ERROR_13,    // Simulate Sent unsent messages error
-    SIMULATED_SEND_ERROR_14,    // Simulate charset conversion error (plaintext only)
-    SIMULATED_SEND_ERROR_15,    // Simulate large message warning
-    SIMULATED_SEND_ERROR_16,    // Failure getting user email address in smtp
-    SIMULATED_SEND_ERROR_17,    // Failure while retreiving multipart related object
-    
-    SIMULATED_SEND_ERROR_EOL
-  };
-  
-  //JFD: last error simulated is NS_ERROR_BUT_DONT_SHOW_ALERT
-
-  long SIMULATED_SEND_ERROR_ID = 0;
-  
-  #define SET_SIMULATED_ERROR(id, var, err) \
-    if (SIMULATED_SEND_ERROR_ID == id)      \
-      var = err;
-
-  #define RETURN_SIMULATED_ERROR(id, err) \
-    if (SIMULATED_SEND_ERROR_ID == id)      \
-      return err;
-
-  #define CHECK_SIMULATED_ERROR(id) \
-    (SIMULATED_SEND_ERROR_ID == id)
-
-#else
-
-  #define SET_SIMULATED_ERROR(id, var, err)
-  #define RETURN_SIMULATED_ERROR(id, err)
-  #define CHECK_SIMULATED_ERROR(id) (0)
-  
-#endif
--- a/mailnews/compose/src/nsSmtpProtocol.cpp
+++ b/mailnews/compose/src/nsSmtpProtocol.cpp
@@ -66,17 +66,16 @@
 #include "prprf.h"
 #include "prmem.h"
 #include "plbase64.h"
 #include "prnetdb.h"
 #include "prsystem.h"
 #include "nsEscape.h"
 #include "nsMsgUtils.h"
 #include "nsIPipe.h"
-#include "nsMsgSimulateError.h"
 #include "nsNetUtil.h"
 #include "nsIPrefService.h"
 #include "nsISignatureVerifier.h"
 #include "nsISSLSocketControl.h"
 #include "nsComposeStrings.h"
 #include "nsIStringBundle.h"
 #include "nsMsgCompUtils.h"
 
@@ -599,17 +598,17 @@ PRInt32 nsSmtpProtocol::SendHeloResponse
     m_urlErrorState = NS_ERROR_COULD_NOT_GET_USERS_MAIL_ADDRESS;
     return(NS_ERROR_COULD_NOT_GET_USERS_MAIL_ADDRESS);
   }
   else
   {
     senderIdentity->GetEmail(emailAddress);
   }
 
-  if(emailAddress.IsEmpty() || CHECK_SIMULATED_ERROR(SIMULATED_SEND_ERROR_16))
+  if (emailAddress.IsEmpty())
   {
     m_urlErrorState = NS_ERROR_COULD_NOT_GET_USERS_MAIL_ADDRESS;
     return(NS_ERROR_COULD_NOT_GET_USERS_MAIL_ADDRESS);
   }
 
   if(m_verifyAddress)
   {
     buffer += "VRFY";
@@ -1332,17 +1331,17 @@ PRInt32 nsSmtpProtocol::SendVerifyRespon
 }
 
 PRInt32 nsSmtpProtocol::SendMailResponse()
 {
   PRInt32 status = 0;
   nsCAutoString buffer;
   nsresult rv;
 
-  if (m_responseCode/10 != 25 || CHECK_SIMULATED_ERROR(SIMULATED_SEND_ERROR_11))
+  if (m_responseCode/10 != 25)
   {
     int errorcode;
     if (TestFlag(SMTP_EHLO_SIZE_ENABLED))
       errorcode = (m_responseCode == 452) ? NS_ERROR_SMTP_TEMP_SIZE_EXCEEDED :
                   (m_responseCode == 552) ? NS_ERROR_SMTP_PERM_SIZE_EXCEEDED_2 :
                   NS_ERROR_SENDING_FROM_COMMAND;
     else
       errorcode = NS_ERROR_SENDING_FROM_COMMAND;
@@ -1570,17 +1569,17 @@ PRInt32 nsSmtpProtocol::SendPostData()
 
     return(status);
 }
 
 
 
 PRInt32 nsSmtpProtocol::SendMessageResponse()
 {
-  if((m_responseCode/10 != 25) || CHECK_SIMULATED_ERROR(SIMULATED_SEND_ERROR_12))
+  if((m_responseCode/10 != 25))
   {
     nsresult rv = nsExplainErrorDetails(m_runningURL, NS_ERROR_SENDING_MESSAGE, m_responseText.get());
     NS_ASSERTION(NS_SUCCEEDED(rv), "failed to explain SMTP error");
 
     m_urlErrorState = NS_ERROR_BUT_DONT_SHOW_ALERT;
     return(NS_ERROR_SENDING_MESSAGE);
   }
 
@@ -1661,17 +1660,18 @@ nsresult nsSmtpProtocol::LoadUrl(nsIURI 
 				*/
 				if (addrs1 && *addrs1)
 				{
                     rv = parser->ParseHeaderAddresses(addrs1, nsnull, &addrs2,
                                                       &m_addressesLeft);
 					PR_FREEIF (addrs1);
 				}
 
-				if (m_addressesLeft == 0 || addrs2 == nsnull || CHECK_SIMULATED_ERROR(SIMULATED_SEND_ERROR_8)) // hmm no addresses to send message to...
+        // hmm no addresses to send message to...
+				if (m_addressesLeft == 0 || addrs2 == nsnull)
 				{
 					m_nextState = SMTP_ERROR_DONE;
 					ClearFlag(SMTP_PAUSE_FOR_READ);
 					status = NS_MSG_NO_RECIPIENTS;
           m_urlErrorState = NS_MSG_NO_RECIPIENTS;
 					return(status);
 				}
 
--- a/mailnews/compose/src/nsSmtpService.cpp
+++ b/mailnews/compose/src/nsSmtpService.cpp
@@ -52,17 +52,16 @@
 #include "nsMsgCompCID.h"
 #include "nsArrayEnumerator.h"
 #include "nsSmtpUrl.h"
 #include "nsSmtpProtocol.h"
 #include "nsCOMPtr.h"
 #include "nsIMsgIdentity.h"
 #include "nsIPrompt.h"
 #include "nsIWindowWatcher.h"
-#include "nsMsgSimulateError.h"
 #include "nsIUTF8ConverterService.h"
 #include "nsUConvCID.h"
 
 #include "nsComposeStrings.h"
 
 #define SERVER_DELIMITER ","
 #define APPEND_SERVERS_VERSION_PREF_NAME "append_preconfig_smtpservers.version"
 #define MAIL_ROOT_PREF "mail."
@@ -129,31 +128,27 @@ NS_IMETHODIMP nsSmtpService::SendMailMes
   nsCOMPtr<nsISmtpServer> smtpServer;
   rv = GetSmtpServerByIdentity(aSenderIdentity, getter_AddRefs(smtpServer));
 
   if (NS_SUCCEEDED(rv) && smtpServer)
   {
     if (aPassword && *aPassword)
       smtpServer->SetPassword(nsDependentCString(aPassword));
 
-    if (!CHECK_SIMULATED_ERROR(SIMULATED_SEND_ERROR_10)) 
-    {
-      rv = NS_MsgBuildSmtpUrl(aFilePath, smtpServer,
-                              aRecipients, aSenderIdentity, aUrlListener, aStatusFeedback, 
-                              aNotificationCallbacks, &urlToRun, aRequestDSN); // this ref counts urlToRun
-      if (NS_SUCCEEDED(rv) && urlToRun)	
-        rv = NS_MsgLoadSmtpUrl(urlToRun, nsnull, aRequest);
+    // this ref counts urlToRun
+    rv = NS_MsgBuildSmtpUrl(aFilePath, smtpServer, aRecipients, aSenderIdentity,
+                            aUrlListener, aStatusFeedback, 
+                            aNotificationCallbacks, &urlToRun, aRequestDSN);
+    if (NS_SUCCEEDED(rv) && urlToRun)	
+      rv = NS_MsgLoadSmtpUrl(urlToRun, nsnull, aRequest);
 
-      if (aURL) // does the caller want a handle on the url?
-        *aURL = urlToRun; // transfer our ref count to the caller....
-      else
-        NS_IF_RELEASE(urlToRun);
-    }
+    if (aURL) // does the caller want a handle on the url?
+      *aURL = urlToRun; // transfer our ref count to the caller....
     else
-      rv = NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER;
+      NS_IF_RELEASE(urlToRun);
   }
 
   return rv;
 }
 
 
 // The following are two convience functions I'm using to help expedite building and running a mail to url...