Bug 1399756 - remove trailing spaces in mailnews/compose. rs=white-space-only
authorJorg K <jorgk@jorgk.com>
Fri, 22 Sep 2017 00:02:26 +0200
changeset 28942 e08911b56e26b2d7dbfd4d0cd4b1380555e70625
parent 28941 153b971fbc2120fe61da0fe75181a69ba51dabc7
child 28943 cc49055e5926dbdc2c04ed42decccfcf0db0f716
push id2027
push userclokep@gmail.com
push dateFri, 22 Sep 2017 15:34:57 +0000
treeherdercomm-beta@cffa2d0e5946 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswhite-space-only
bugs1399756
Bug 1399756 - remove trailing spaces in mailnews/compose. rs=white-space-only
mailnews/compose/public/nsMsgAttachmentData.h
mailnews/compose/src/nsComposeStrings.h
mailnews/compose/src/nsMsgAppleCodes.h
mailnews/compose/src/nsMsgAppleDouble.h
mailnews/compose/src/nsMsgAppleDoubleEncode.cpp
mailnews/compose/src/nsMsgAppleEncode.cpp
mailnews/compose/src/nsMsgAttachment.cpp
mailnews/compose/src/nsMsgAttachmentHandler.cpp
mailnews/compose/src/nsMsgAttachmentHandler.h
mailnews/compose/src/nsMsgCompFields.cpp
mailnews/compose/src/nsMsgCompUtils.h
mailnews/compose/src/nsMsgCompose.h
mailnews/compose/src/nsMsgComposeContentHandler.cpp
mailnews/compose/src/nsMsgComposeContentHandler.h
mailnews/compose/src/nsMsgComposeParams.cpp
mailnews/compose/src/nsMsgComposeParams.h
mailnews/compose/src/nsMsgComposeProgressParams.cpp
mailnews/compose/src/nsMsgComposeProgressParams.h
mailnews/compose/src/nsMsgComposeService.h
mailnews/compose/src/nsMsgCopy.h
mailnews/compose/src/nsMsgQuote.cpp
mailnews/compose/src/nsMsgQuote.h
mailnews/compose/src/nsMsgSendLater.cpp
mailnews/compose/src/nsMsgSendLater.h
mailnews/compose/src/nsMsgSendPart.cpp
mailnews/compose/src/nsMsgSendPart.h
mailnews/compose/src/nsMsgSendReport.cpp
mailnews/compose/src/nsSmtpProtocol.h
mailnews/compose/src/nsSmtpServer.h
mailnews/compose/src/nsSmtpService.cpp
mailnews/compose/src/nsSmtpService.h
mailnews/compose/src/nsSmtpUrl.h
mailnews/compose/src/nsURLFetcher.cpp
mailnews/compose/src/nsURLFetcher.h
--- a/mailnews/compose/public/nsMsgAttachmentData.h
+++ b/mailnews/compose/public/nsMsgAttachmentData.h
@@ -22,29 +22,29 @@ public:
 
   nsCOMPtr<nsIURI> m_url;   // The URL to attach.
 
   nsCString m_desiredType;  // The type to which this document should be
                             // converted.  Legal values are NULL, TEXT_PLAIN
                             // and APPLICATION_POSTSCRIPT (which are macros
                             // defined in net.h); other values are ignored.
 
-  nsCString m_realType;     // The type of the URL if known, otherwise NULL. For example, if 
-                            // you were attaching a temp file which was known to contain HTML data, 
-                            // you would pass in TEXT_HTML as the real_type, to override whatever type 
+  nsCString m_realType;     // The type of the URL if known, otherwise NULL. For example, if
+                            // you were attaching a temp file which was known to contain HTML data,
+                            // you would pass in TEXT_HTML as the real_type, to override whatever type
                             // the name of the tmp file might otherwise indicate.
 
   nsCString m_realEncoding; // Goes along with real_type
 
-  nsCString m_realName;     // The original name of this document, which will eventually show up in the 
-                            // Content-Disposition header. For example, if you had copied a document to a 
+  nsCString m_realName;     // The original name of this document, which will eventually show up in the
+                            // Content-Disposition header. For example, if you had copied a document to a
                             // tmp file, this would be the original, human-readable name of the document.
 
-  nsCString m_description;  // If you put a string here, it will show up as the Content-Description header.  
-                            // This can be any explanatory text; it's not a file name.             
+  nsCString m_description;  // If you put a string here, it will show up as the Content-Description header.
+                            // This can be any explanatory text; it's not a file name.
 
   nsCString m_disposition;  // The Content-Disposition header (if any). a
                             // nsMsgAttachmentData can very well have
                             // Content-Disposition: inline value, instead of
                             // "attachment".
   nsCString m_cloudPartInfo; // For X-Mozilla-Cloud-Part header, if any
 
   // Mac-specific data that should show up as optional parameters
@@ -71,26 +71,26 @@ public:
   virtual ~nsMsgAttachedFile();
 
   nsCOMPtr<nsIURI> m_origUrl; // Where it came from on the network (or even elsewhere on the local disk.)
 
   nsCOMPtr<nsIFile>  m_tmpFile;    // The tmp file in which the (possibly converted) data now resides.
 
   nsCString m_type;        // The type of the data in file_name (not necessarily the same as the type of orig_url.)
 
-  nsCString m_encoding;    // Likewise, the encoding of the tmp file. This will be set only if the original 
-                            // document had an encoding already; we don't do base64 encoding and so forth until 
+  nsCString m_encoding;    // Likewise, the encoding of the tmp file. This will be set only if the original
+                            // document had an encoding already; we don't do base64 encoding and so forth until
                             // it's time to assemble a full MIME message of all parts.
 
 
   nsCString m_description;    // For Content-Description header
   nsCString m_cloudPartInfo; // For X-Mozilla-Cloud-Part header, if any
-  nsCString m_xMacType;    // mac-specific info 
-  nsCString m_xMacCreator; // mac-specific info 
-  nsCString m_realName;      // The real name of the file. 
+  nsCString m_xMacType;    // mac-specific info
+  nsCString m_xMacCreator; // mac-specific info
+  nsCString m_realName;      // The real name of the file.
 
   // Some statistics about the data that was written to the file, so that when
   // it comes time to compose a MIME message, we can make an informed decision
   // about what Content-Transfer-Encoding would be best for this attachment.
   // (If it's encoded already, we ignore this information and ship it as-is.)
   uint32_t    m_size;
   uint32_t    m_unprintableCount;
   uint32_t    m_highbitCount;
--- a/mailnews/compose/src/nsComposeStrings.h
+++ b/mailnews/compose/src/nsComposeStrings.h
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
   String Ids used by mailnews\compose
   To Do: Convert the callers to use names instead of ids and then make this file obsolete.
  */
- 
+
 #ifndef _nsComposeStrings_H__
 #define _nsComposeStrings_H__
 
 #include "msgCore.h"
 
 #define NS_MSG_UNABLE_TO_OPEN_FILE                  NS_MSG_GENERATE_FAILURE(12500)
 #define NS_MSG_UNABLE_TO_OPEN_TMP_FILE              NS_MSG_GENERATE_FAILURE(12501)
 #define NS_MSG_UNABLE_TO_SAVE_TEMPLATE              NS_MSG_GENERATE_FAILURE(12502)
--- a/mailnews/compose/src/nsMsgAppleCodes.h
+++ b/mailnews/compose/src/nsMsgAppleCodes.h
@@ -13,17 +13,17 @@
 **
 **
 */
 
 #ifndef ad_codes_h
 #define ad_codes_h
 
 /*
-** applefile definitions used 
+** applefile definitions used
 */
 #if PRAGMA_STRUCT_ALIGN
   #pragma options align=mac68k
 #endif
 
 #define APPLESINGLE_MAGIC	0x00051600L
 #define APPLEDOUBLE_MAGIC 	0x00051607L
 #define VERSION 			0x00020000
@@ -36,34 +36,34 @@
 #define ENT_COMMENT 		4L
 #define ENT_DATES   		8L
 #define ENT_FINFO   		9L
 #define CONVERT_TIME 		1265437696L
 
 /*
 ** data type used in the encoder/decoder.
 */
-typedef struct ap_header 
+typedef struct ap_header
 {
 	int32_t 	magic;
 	int32_t	version;
 	char 	fill[16];
 	int16_t 	entries;
 
 } ap_header;
 
-typedef struct ap_entry 
+typedef struct ap_entry
 {
 	int32_t  id;
 	int32_t	offset;
 	int32_t	length;
 	
 } ap_entry;
 
-typedef struct ap_dates 
+typedef struct ap_dates
 {
 	int32_t create, modify, backup, access;
 
 } ap_dates;
 
 typedef struct myFInfo			/* the mac FInfo structure for the cross platform. */
 {	
 	int32_t	fdType, fdCreator;
@@ -93,14 +93,14 @@ int  ap_seek_part_start(appledouble_deco
 void parse_param(char *p, char **param, char**define, char **np);
 int  ap_seek_to_boundary(appledouble_decode_object* p_ap_decode_obj, bool firstime);
 int  ap_parse_header(appledouble_decode_object* p_ap_decode_obj,bool firstime);
 int  ap_decode_file_infor(appledouble_decode_object* p_ap_decode_obj);
 int  ap_decode_process_header(appledouble_decode_object* p_ap_decode_obj, bool firstime);
 int  ap_decode_process_data(  appledouble_decode_object* p_ap_decode_obj, bool firstime);
 
 PR_END_EXTERN_C
- 
+
 #if PRAGMA_STRUCT_ALIGN
   #pragma options align=reset
 #endif
 
 #endif /* ad_codes_h */
--- a/mailnews/compose/src/nsMsgAppleDouble.h
+++ b/mailnews/compose/src/nsMsgAppleDouble.h
@@ -1,15 +1,15 @@
 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-/* 
+/*
 *   AppleDouble.h
 *	-------------
 *
 *  	  The header file for a stream based apple single/double encodor/decodor.
 *		
 *		2aug95	mym		
 *		
 */
@@ -35,28 +35,28 @@
 
 					
 #define errFileOpen	NS_ERROR_GET_CODE(NS_MSG_UNABLE_TO_OPEN_TMP_FILE)
 #define errFileWrite	-202 /*Error writing temporary file.*/
 #define errUsrCancel	-2  /*MK_INTERRUPTED */
 #define errDecoding		-1
 
 /*
-** The envirment block data type. 
+** The envirment block data type.
 */
-enum 
-{ 
-	kInit, 
-	kDoingHeaderPortion, 
-	kDoneHeaderPortion, 
-	kDoingDataPortion, 
-	kDoneDataPortion 
+enum
+{
+	kInit,
+	kDoingHeaderPortion,
+	kDoneHeaderPortion,
+	kDoingDataPortion,
+	kDoneDataPortion
 };
 
-typedef struct _appledouble_encode_object 
+typedef struct _appledouble_encode_object
 {
     char    fname[256];
     FSIORefNum fileId;				/* the id for the open file (data/resource fork) */
 
 	int 	state;
 	int		text_file_type;		/* if the file has a text file type with it.	*/
 	char	*boundary;			/* the boundary string.							*/
 
@@ -65,73 +65,73 @@ typedef struct _appledouble_encode_objec
 	int		s_overflow;
 	
 	int		state64;			/* the left over state of base64 enocding 		*/
 	int		ct;					/* the character count of base64 encoding		*/
 	int 	c1, c2;				/* the left of the last base64 encoding 		*/		
 
 	char 	*outbuff;			/* the outbuff by the caller.           		*/
 	int		s_outbuff;			/* the size of the buffer.						*/
-	int		pos_outbuff;		/* the offset in the current buffer.			*/ 
+	int		pos_outbuff;		/* the offset in the current buffer.			*/
 
 } appledouble_encode_object;
 
 /* The possible content transfer encodings */
 
-enum 
-{ 
+enum
+{
 	kEncodeNone,
 	kEncodeQP,
 	kEncodeBase64,
 	kEncodeUU
 };
 
-enum 
-{ 
+enum
+{
 	kGeneralMine,
 	kAppleDouble,
 	kAppleSingle
 };
 
-enum 
-{ 
+enum
+{
 	kInline,
 	kDontCare
 };
 
-enum 
-{ 
+enum
+{
 	kHeaderPortion,
 	kDataPortion
 };
 
 /* the decode states.	*/
-enum 
-{ 
+enum
+{
 	kBeginParseHeader = 3,
 	kParsingHeader,
 	kBeginSeekBoundary,
 	kSeekingBoundary,
-	kBeginHeaderPortion, 
-	kProcessingHeaderPortion, 
-	kBeginDataPortion, 
-	kProcessingDataPortion, 
+	kBeginHeaderPortion,
+	kProcessingHeaderPortion,
+	kBeginDataPortion,
+	kProcessingDataPortion,
 	kFinishing
 };
 
 /* uuencode states */
 enum
 {
 	kWaitingForBegin = (int) 0,
 	kBegin,
 	kMainBody,
 	kEnd
 };
 
-typedef struct _appledouble_decode_object 
+typedef struct _appledouble_decode_object
 {
 	int		is_binary;
 	int		is_apple_single;	/* if the object encoded is in apple single		*/
 	int		write_as_binhex;
 	
 	int		messagetype;
 	char*	boundary0;			/* the boundary for the enclosure.				*/
 	int		deposition;			/* the deposition.								*/
@@ -140,68 +140,68 @@ typedef struct _appledouble_decode_objec
 	
 	char	fname[256];
 	// nsIOFileStream *fileSpec;					/* the stream for data fork work.					 */
 
 	int 	state;
 	
 	int		rksize;				/* the resource fork size count.				*/
 	int		dksize;				/* the data fork size count.					*/
-	 
+	
 	int		status;				/* the error code if anyerror happens.			*/
 	char 	b_leftover[256];
 	int		s_leftover;
 	
 	int		encode;				/* the encode type of the message.				*/
 	int		state64;			/* the left over state of base64 enocding 		*/
 	int		left;				/* the character count of base64 encoding		*/
 	int 	c[4];				/* the left of the last base64 encoding 		*/		
 	int		uu_starts_line;		/* is decoder at the start of a line? (uuencode)	*/
 	int		uu_state;			/* state w/r/t the uuencode body */
 	int		uu_bytes_written;	/* bytes written from the current tuple (uuencode) */
 	int		uu_line_bytes;		/* encoded bytes remaining in the current line (uuencode) */
 
 	char 	*inbuff;			/* the outbuff by the caller.           		*/
 	int		s_inbuff;			/* the size of the buffer.						*/
-	int		pos_inbuff;			/* the offset in the current buffer.			*/ 
+	int		pos_inbuff;			/* the offset in the current buffer.			*/
 
 
 	nsCOMPtr <nsIFile> tmpFile;		/* the temp file to hold the decode data fork 	*/
 								                      /* when doing the binhex exporting.				*/
   nsCOMPtr <nsIOutputStream> tmpFileStream; /* The output File Stream */
 	int32_t	            data_size;			/* the size of the data in the tmp file.		*/
 
 } appledouble_decode_object;
 
 
 /*
 **	The protypes.
 */
 
 PR_BEGIN_EXTERN_C
 
-int ap_encode_init(appledouble_encode_object *p_ap_encode_obj, 
+int ap_encode_init(appledouble_encode_object *p_ap_encode_obj,
 					const char* fname,
 					char* separator);
 
-int ap_encode_next(appledouble_encode_object* p_ap_encode_obj, 
+int ap_encode_next(appledouble_encode_object* p_ap_encode_obj,
 					char 	*to_buff,
 					int32_t 	buff_size,
 					int32_t*	real_size);
 
 int ap_encode_end(appledouble_encode_object* p_ap_encode_obj,
 					bool	is_aborting);
 
 int ap_decode_init(appledouble_decode_object* p_ap_decode_obj,
 					bool	is_apple_single,
 					bool	write_as_bin_hex,
 					void  	*closure);
 
-int ap_decode_next(appledouble_decode_object* p_ap_decode_obj, 
-					char 	*in_buff, 
+int ap_decode_next(appledouble_decode_object* p_ap_decode_obj,
+					char 	*in_buff,
 					int32_t 	buff_size);
 
-int ap_decode_end(appledouble_decode_object* p_ap_decode_obj, 
+int ap_decode_end(appledouble_decode_object* p_ap_decode_obj,
 				 	bool is_aborting);
 
 PR_END_EXTERN_C
 
 #endif
--- a/mailnews/compose/src/nsMsgAppleDoubleEncode.cpp
+++ b/mailnews/compose/src/nsMsgAppleDoubleEncode.cpp
@@ -23,19 +23,19 @@
 #include "nsCExternalHandlerService.h"
 #include "nsIMIMEService.h"
 #include "nsMimeTypes.h"
 #include "prmem.h"
 #include "nsNetUtil.h"
 
 
 void	
-MacGetFileType(nsIFile   *fs, 
-               bool         *useDefault, 
-               char         **fileType, 
+MacGetFileType(nsIFile   *fs,
+               bool         *useDefault,
+               char         **fileType,
                char         **encoding)
 {
 	if ((fs == NULL) || (fileType == NULL) || (encoding == NULL))
 		return;
 
   bool exists = false;
   fs->Exists(&exists);
   if (!exists)
@@ -58,25 +58,25 @@ MacGetFileType(nsIFile   *fs,
   {
     // At this point, we should call the mime service and
     // see what we can find out?
     nsresult      rv;
     nsCOMPtr <nsIURI> tURI;
     if (NS_SUCCEEDED(NS_NewFileURI(getter_AddRefs(tURI), fs)) && tURI)
     {
       nsCOMPtr<nsIMIMEService> mimeFinder (do_GetService(NS_MIMESERVICE_CONTRACTID, &rv));
-      if (NS_SUCCEEDED(rv) && mimeFinder) 
+      if (NS_SUCCEEDED(rv) && mimeFinder)
       {
         nsAutoCString mimeType;
         rv = mimeFinder->GetTypeFromURI(tURI, mimeType);
-        if (NS_SUCCEEDED(rv)) 
+        if (NS_SUCCEEDED(rv))
         {
           *fileType = ToNewCString(mimeType);
           return;
-        }        
+        }
       }
     }
 
     // If we hit here, return something...default to this...
     *fileType = strdup(APPLICATION_OCTET_STREAM);
   }
 }
 
@@ -120,59 +120,59 @@ int ap_encode_init( appledouble_encode_o
 **	--------------
 **		
 **		return :
 **			noErr	:	everything is ok
 **			errDone	:	when encoding is done.
 **			errors	:	otherwise.
 */
 int ap_encode_next(
-	appledouble_encode_object* p_ap_encode_obj, 
-	char 	*to_buff, 
-	int32_t 	buff_size, 
+	appledouble_encode_object* p_ap_encode_obj,
+	char 	*to_buff,
+	int32_t 	buff_size,
 	int32_t* 	real_size)
 {
 	int status;
 	
 	/*
 	** 	install the out buff now.
 	*/
 	p_ap_encode_obj->outbuff     = to_buff;
 	p_ap_encode_obj->s_outbuff 	 = buff_size;
 	p_ap_encode_obj->pos_outbuff = 0;
 	
 	/*
-	**	first copy the outstandind data in the overflow buff to the out buffer. 
+	**	first copy the outstandind data in the overflow buff to the out buffer.
 	*/
 	if (p_ap_encode_obj->s_overflow)
 	{
 		status = write_stream(p_ap_encode_obj,
 		                      (const char*)(p_ap_encode_obj->b_overflow),
 		                      p_ap_encode_obj->s_overflow);
 		if (status != noErr)
 			return status;
 				
 		p_ap_encode_obj->s_overflow = 0;
 	}
 
 	/*
-	** go the next processing stage based on the current state. 
+	** go the next processing stage based on the current state.
 	*/
 	switch (p_ap_encode_obj->state)
 	{
 		case kInit:
 			/*
 			** We are in the  starting position, fill out the header.
 			*/
-			status = fill_apple_mime_header(p_ap_encode_obj); 
+			status = fill_apple_mime_header(p_ap_encode_obj);
 			if (status != noErr)
 				break;					/* some error happens */
 				
 			p_ap_encode_obj->state = kDoingHeaderPortion;
-			status = ap_encode_header(p_ap_encode_obj, true); 
+			status = ap_encode_header(p_ap_encode_obj, true);
 										/* it is the first time to calling 		*/							
 			if (status == errDone)
 			{
 				p_ap_encode_obj->state = kDoneHeaderPortion;
 			}
 			else
 			{
 				break;					/* we need more work on header portion.	*/
@@ -243,17 +243,17 @@ int ap_encode_next(
 /*
 **	ap_encode_end
 **	-------------
 **
 **	clear the apple encoding.
 */
 
 int ap_encode_end(
-	appledouble_encode_object *p_ap_encode_obj, 
+	appledouble_encode_object *p_ap_encode_obj,
 	bool is_aborting)
 {
 	/*
 	** clear up the apple doubler.
 	*/
 	if (p_ap_encode_obj == NULL)
 		return noErr;
 
--- a/mailnews/compose/src/nsMsgAppleEncode.cpp
+++ b/mailnews/compose/src/nsMsgAppleEncode.cpp
@@ -22,53 +22,53 @@
 #include "nsServiceManagerUtils.h"
 #include "nsMsgAppleDouble.h"
 #include "nsMsgAppleCodes.h"
 #include "nsILocalFileMac.h"
 
 /*
 **	Local Functions prototypes.
 */
-static int output64chunk( appledouble_encode_object* p_ap_encode_obj, 
+static int output64chunk( appledouble_encode_object* p_ap_encode_obj,
 				int c1, int c2, int c3, int pads);
 				
-static int to64(appledouble_encode_object* p_ap_encode_obj, 
-				char	*p, 
+static int to64(appledouble_encode_object* p_ap_encode_obj,
+				char	*p,
 				int 	in_size);
- 
+
 static int finish64(appledouble_encode_object* p_ap_encode_obj);
 
 
 #define BUFF_LEFT(p)	((p)->s_outbuff - (p)->pos_outbuff)	
 
 /*
 **	write_stream.
 */
 int write_stream(
 	appledouble_encode_object *p_ap_encode_obj,
 	const char *out_string,
 	int len)
 {	
 	if (p_ap_encode_obj->pos_outbuff + len < p_ap_encode_obj->s_outbuff)
 	{
-		memcpy(p_ap_encode_obj->outbuff + p_ap_encode_obj->pos_outbuff, 
-		       out_string, 
+		memcpy(p_ap_encode_obj->outbuff + p_ap_encode_obj->pos_outbuff,
+		       out_string,
 		       len);
 		p_ap_encode_obj->pos_outbuff += len;
 		return noErr;
 	}
 	else
 	{
 		/*
 		**	If the buff doesn't have enough space, use the overflow buffer then.
 		*/
 		int s_len = p_ap_encode_obj->s_outbuff - p_ap_encode_obj->pos_outbuff;
 		
-		memcpy(p_ap_encode_obj->outbuff + p_ap_encode_obj->pos_outbuff, 
-		       out_string, 
+		memcpy(p_ap_encode_obj->outbuff + p_ap_encode_obj->pos_outbuff,
+		       out_string,
 		       s_len);
 		memcpy(p_ap_encode_obj->b_overflow + p_ap_encode_obj->s_overflow,
 		       out_string + s_len,
 		       p_ap_encode_obj->s_overflow += (len - s_len));
 		p_ap_encode_obj->pos_outbuff += s_len;
 		return errEOB;
 	}
 }
@@ -77,17 +77,17 @@ int fill_apple_mime_header(
 	appledouble_encode_object *p_ap_encode_obj)
 {
 	int  status;
 	
 	char tmpstr[266];
 	
 #if 0	
 //	strcpy(tmpstr, "Content-Type: multipart/mixed; boundary=\"-\"\n\n---\n");
-//	status = write_stream(p_ap_encode_env, 
+//	status = write_stream(p_ap_encode_env,
 //						tmpstr,
 //						strlen(tmpstr));
 //	if (status != noErr)
 //		return status;
 
 	PR_snprintf(tmpstr, sizeof(tmpstr),
 			"Content-Type: multipart/appledouble; boundary=\"=\"; name=\"");
 	status = write_stream(p_ap_encode_obj, (const char*)tmpstr, strlen(tmpstr));
@@ -102,29 +102,29 @@ int fill_apple_mime_header(
 		
 	PR_snprintf(tmpstr, sizeof(tmpstr),
 			"\"\r\nContent-Disposition: inline; filename=\"%s\"\r\n\r\n\r\n--=\r\n",
 			p_ap_encode_obj->fname);
 #endif /* 0 */
 	PR_snprintf(tmpstr, sizeof(tmpstr), "--%s" CRLF, p_ap_encode_obj->boundary);
 	status = write_stream(p_ap_encode_obj, (const char*)tmpstr, strlen(tmpstr));
 	return status;
-} 
+}
 
 int ap_encode_file_infor(
 	appledouble_encode_object *p_ap_encode_obj)
 {
 	ap_header	head;
 	ap_entry 	entries[NUM_ENTRIES];
 	ap_dates 	dates;
 	short 		i;
 	long 		comlen;
 	char 		comment[256];
 	int	 		status;
-    
+
     nsCOMPtr <nsIFile> resFile;
     NS_NewNativeLocalFile(nsDependentCString(p_ap_encode_obj->fname), true,
                           getter_AddRefs(resFile));
     if (!resFile)
         return errFileOpen;
 
     FSRef ref;
     nsCOMPtr <nsILocalFileMac> macFile = do_QueryInterface(resFile);
@@ -151,28 +151,28 @@ int ap_encode_file_infor(
 	memset((void *) &vinfo, '\0', sizeof (vinfo));
 	GetVolParmsInfoBuffer vp;
 	vinfo.ioCompletion  = nil;
 	vinfo.ioVRefNum 	= fpb->ioVRefNum;
 	vinfo.ioBuffer 		= (Ptr) &vp;
 	vinfo.ioReqCount 	= sizeof (vp);
 	comlen = 0;
 	if (PBHGetVolParmsSync((HParmBlkPtr) &vinfo) == noErr &&
-		((vp.vMAttrib >> bHasDesktopMgr) & 1)) 
+		((vp.vMAttrib >> bHasDesktopMgr) & 1))
 	{
 		DTPBRec 	dtp;
 		memset((void *) &dtp, '\0', sizeof (dtp));
 		dtp.ioVRefNum = fpb->ioVRefNum;
-		if (PBDTGetPath(&dtp) == noErr) 
+		if (PBDTGetPath(&dtp) == noErr)
 		{
 			dtp.ioCompletion = nil;
 			dtp.ioDTBuffer = (Ptr) comment;
 			dtp.ioNamePtr  = fpb->ioNamePtr;
 			dtp.ioDirID    = fpb->ioFlParID;
-			if (PBDTGetCommentSync(&dtp) == noErr) 
+			if (PBDTGetCommentSync(&dtp) == noErr)
 				comlen = dtp.ioDTActCount;
 		}
 	}
 #endif /* ! 1 */
 	
 	/* write header */
 //	head.magic = dfork ? APPLESINGLE_MAGIC : APPLEDOUBLE_MAGIC;
 	head.magic   = APPLEDOUBLE_MAGIC;		/* always do apple double */
@@ -198,54 +198,54 @@ int ap_encode_file_infor(
 	entries[3].id 	= ENT_COMMENT;
 	entries[3].length = comlen;
 	entries[4].id 	= ENT_RFORK;
     entries[4].length = catalogInfo.rsrcLogicalSize;
 	entries[5].id 	= ENT_DFORK;
     entries[5].length = catalogInfo.dataLogicalSize;
 
 	/* correct the link in the entries. */
-	for (i = 1; i < NUM_ENTRIES; ++i) 
+	for (i = 1; i < NUM_ENTRIES; ++i)
 	{
 		entries[i].offset = entries[i-1].offset + entries[i-1].length;
 	}
 	status = to64(p_ap_encode_obj,
 					(char *) entries,
-					sizeof (ap_entry) * head.entries); 
+					sizeof (ap_entry) * head.entries);
 	if (status != noErr)
 		return status;
 
 	/* write name */
 	status = to64(p_ap_encode_obj,
 					(char *) leafname.get(),
-					leafname.Length()); 
+					leafname.Length());
 	if (status != noErr)
 		return status;
 	
 	/* write finder info */
 	status = to64(p_ap_encode_obj,
 					(char *) &catalogInfo.finderInfo,
 					sizeof (FInfo));
 	if (status != noErr)
 		return status;
-					  
+					
 	status = to64(p_ap_encode_obj,
 					(char *) &catalogInfo.extFinderInfo,
 					sizeof (FXInfo));
 	if (status != noErr)
 		return status;
 
 	/* write dates */
     dates.create = catalogInfo.createDate.lowSeconds + CONVERT_TIME;
     dates.modify = catalogInfo.contentModDate.lowSeconds + CONVERT_TIME;
     dates.backup = catalogInfo.backupDate.lowSeconds + CONVERT_TIME;
     dates.access = catalogInfo.accessDate.lowSeconds + CONVERT_TIME;
 	status = to64(p_ap_encode_obj,
 					(char *) &dates,
-					sizeof (ap_dates)); 
+					sizeof (ap_dates));
 	if (status != noErr)
 		return status;
 	
 	/* write comment */
 	if (comlen)
 	{
 		status = to64(p_ap_encode_obj,
 					comment,
@@ -264,34 +264,34 @@ int ap_encode_file_infor(
 }
 /*
 **	ap_encode_header
 **
 **		encode the file header and the resource fork.
 **
 */
 int ap_encode_header(
-	appledouble_encode_object* p_ap_encode_obj, 
+	appledouble_encode_object* p_ap_encode_obj,
 	bool    firstime)
 {
 	char   	rd_buff[256];
     FSIORefNum fileId;
 	OSErr	retval = noErr;
 	int    	status;
     ByteCount inCount;
 	
 	if (firstime)
 	{
-    PL_strcpy(rd_buff, 
+    PL_strcpy(rd_buff,
 			"Content-Type: application/applefile\r\nContent-Transfer-Encoding: base64\r\n\r\n");
 		status = write_stream(p_ap_encode_obj, (const char*)rd_buff, strlen(rd_buff));
 		if (status != noErr)
 			return status;
 			
-		status = ap_encode_file_infor(p_ap_encode_obj); 
+		status = ap_encode_file_infor(p_ap_encode_obj);
 		if (status != noErr)
 			return status;
 		
 		/*
 		** preparing to encode the resource fork.
 		*/
         nsCOMPtr <nsIFile> myFile;
         NS_NewNativeLocalFile(nsDependentCString(p_ap_encode_obj->fname), true, getter_AddRefs(myFile));
@@ -333,20 +333,20 @@ int ap_encode_header(
         ::FSCloseFork(fileId);
         p_ap_encode_obj->fileId = 0;
 
 		status = finish64(p_ap_encode_obj);
 		if (status != noErr)
 			return status;
 		
 		/*
-		** write out the boundary 
+		** write out the boundary
 		*/
 		PR_snprintf(rd_buff, sizeof(rd_buff),
-						CRLF "--%s" CRLF, 
+						CRLF "--%s" CRLF,
 						p_ap_encode_obj->boundary);
 					
 		status = write_stream(p_ap_encode_obj, (const char*)rd_buff, strlen(rd_buff));
 		if (status == noErr)
 			status = errDone;
 	}
 	return status;
 }
@@ -385,48 +385,48 @@ static const char *default_type = APPLIC
 /*
  * Determins the format of the file "inputf".  The name
  * of the file format (or NULL on error) is returned.
  */
 static const char *magic_look(char *inbuff, int numread)
 {
     int i, j;
 
-	for (i=0; i<num_magic; i++) 
+	for (i=0; i<num_magic; i++)
 	{
-	   	if (magic[i].len == 0) 
+	   	if (magic[i].len == 0)
 	   		magic[i].len = strlen(magic[i].num);
 	}
 
-    for (i=0; i<num_magic; i++) 
+    for (i=0; i<num_magic; i++)
     {
-		if (numread >= magic[i].len) 
+		if (numread >= magic[i].len)
 		{
-	    	for (j=0; j<magic[i].len; j++) 
+	    	for (j=0; j<magic[i].len; j++)
 	    	{
 				if (inbuff[j] != magic[i].num[j]) break;
 	    	}
 	    	
-	    	if (j == magic[i].len) 
+	    	if (j == magic[i].len)
 	    		return magic[i].name;
 		}
     }
 
     return default_type;
 }
 /*
 **	ap_encode_data
 **
 **	---------------
 **
 **		encode on the data fork.
 **
 */
 int ap_encode_data(
-	appledouble_encode_object* p_ap_encode_obj, 
+	appledouble_encode_object* p_ap_encode_obj,
 	bool firstime)
 {
 	char   		rd_buff[256];
     FSIORefNum fileId;
 	OSErr		retval = noErr;
     ByteCount in_count;
 	int			status;
 	
@@ -460,18 +460,18 @@ int ap_encode_data(
 		if (!p_ap_encode_obj->text_file_type)
 		{	
       /*
       **	do a smart check for the file type.
       */
       in_count = 0;
       retval = ::FSReadFork(fileId, fsFromStart, 0, 256, rd_buff, &in_count);
       magic_type = magic_look(rd_buff, in_count);
-      
-      /* don't forget to rewind the index to start point. */ 
+
+      /* don't forget to rewind the index to start point. */
       ::FSSetForkPosition(fileId, fsFromStart, 0);
       /* and reset retVal just in case... */
       if (retval == eofErr)
         retval = noErr;
 		}
 		else
 		{
 			magic_type = text_type;		/* we already know it is a text type.	*/
@@ -521,43 +521,43 @@ int ap_encode_data(
 
 		status = finish64(p_ap_encode_obj);
 		if (status != noErr)
 			return status;
 		
 		/* write out the boundary 	*/
 		
 		PR_snprintf(rd_buff, sizeof(rd_buff),
-						CRLF "--%s--" CRLF CRLF, 
+						CRLF "--%s--" CRLF CRLF,
 						p_ap_encode_obj->boundary);
 	
 		status = write_stream(p_ap_encode_obj, (const char*)rd_buff, strlen(rd_buff));
 	
 		if (status == noErr)				
 			status = errDone;
 	}
 	return status;
 }
 
 static char basis_64[] =
    "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
 
-/* 
+/*
 **	convert the stream in the inbuff to 64 format and put it in the out buff.
 **  To make the life easier, the caller will responcable of the cheking of the outbuff's bundary.
 */
-static int 
-to64(appledouble_encode_object* p_ap_encode_obj, 
-	char	*p, 
-	int 	in_size) 
+static int
+to64(appledouble_encode_object* p_ap_encode_obj,
+	char	*p,
+	int 	in_size)
 {
 	int 	status;
     int c1, c2, c3, ct;
     unsigned char *inbuff = (unsigned char*)p;
-    
+
 	ct = p_ap_encode_obj->ct;			/* the char count left last time. */
 	
 	/*
 	**	 resume the left state of the last conversion.
 	*/
 	switch (p_ap_encode_obj->state64)
 	{
 		case 0:
@@ -587,31 +587,31 @@ to64(appledouble_encode_object* p_ap_enc
 			break;
 		case 2:
 			c1 = p_ap_encode_obj->c1;
 			c2 = p_ap_encode_obj->c2;
 			c3 = *inbuff ++;		--in_size;
 			break;
 	}
 	
-    while (in_size >= 0) 
+    while (in_size >= 0)
     {
-    	status = output64chunk(p_ap_encode_obj, 
-    							c1, 
-    							c2, 
-    							c3, 
+    	status = output64chunk(p_ap_encode_obj,
+    							c1,
+    							c2,
+    							c3,
     							0);
     	if (status != noErr)
     		return status;
     		
     	ct += 4;
-        if (ct > 71) 
-        { 
-        	status = write_stream(p_ap_encode_obj, 
-        						CRLF, 
+        if (ct > 71)
+        {
+        	status = write_stream(p_ap_encode_obj,
+        						CRLF,
         						2);
         	if (status != noErr)
         		return status;
         		
             ct = 0;
         }
 
 		if (in_size <= 0)
@@ -640,64 +640,64 @@ to64(appledouble_encode_object* p_ap_enc
     }
     p_ap_encode_obj->ct = ct;
     return status;
 }
 
 /*
 ** clear the left base64 encodes.
 */
-static int 
+static int
 finish64(appledouble_encode_object* p_ap_encode_obj)
 {
 	int status;
 	
 	switch (p_ap_encode_obj->state64)
 	{
 		case 0:
 			break;
 		case 1:
-			status = output64chunk(p_ap_encode_obj, 
-									p_ap_encode_obj->c1, 
-									0, 
-									0, 
+			status = output64chunk(p_ap_encode_obj,
+									p_ap_encode_obj->c1,
+									0,
+									0,
 									2);
 			break;
 		case 2:
-			status = output64chunk(p_ap_encode_obj, 
-									p_ap_encode_obj->c1, 
-									p_ap_encode_obj->c2, 
-									0, 
+			status = output64chunk(p_ap_encode_obj,
+									p_ap_encode_obj->c1,
+									p_ap_encode_obj->c2,
+									0,
 									1);
 			break;
 	}
 	status = write_stream(p_ap_encode_obj, CRLF, 2);
 	p_ap_encode_obj->state64 = 0;
 	p_ap_encode_obj->ct	  	 = 0;
 	return status;
 }
 
 static int output64chunk(
-	appledouble_encode_object* p_ap_encode_obj, 
+	appledouble_encode_object* p_ap_encode_obj,
 	int c1, int c2, int c3, int pads)
 {
 	char tmpstr[32];
 	char *p = tmpstr;
 	
     *p++ = basis_64[c1>>2];
     *p++ = basis_64[((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4)];
-    if (pads == 2) 
+    if (pads == 2)
     {
         *p++ = '=';
         *p++ = '=';
-    } 
-    else if (pads) 
+    }
+    else if (pads)
     {
         *p++ = basis_64[((c2 & 0xF) << 2) | ((c3 & 0xC0) >>6)];
         *p++ = '=';
-    } 
-    else 
+    }
+    else
     {
         *p++ = basis_64[((c2 & 0xF) << 2) | ((c3 & 0xC0) >>6)];
         *p++ = basis_64[c3 & 0x3F];
     }
     return write_stream(p_ap_encode_obj, (const char*) tmpstr, p-tmpstr);
 }
--- a/mailnews/compose/src/nsMsgAttachment.cpp
+++ b/mailnews/compose/src/nsMsgAttachment.cpp
@@ -251,12 +251,12 @@ nsresult nsMsgAttachment::DeleteAttachme
     {
       rv = urlFile->IsFile(&isAFile);
       NS_ASSERTION(NS_SUCCEEDED(rv), "IsFile() call failed!");
     }
   }
 
   // remove it if it's a valid file
   if (isAFile)
-	  rv = urlFile->Remove(false); 
+	  rv = urlFile->Remove(false);
 
   return rv;
 }
--- a/mailnews/compose/src/nsMsgAttachmentHandler.cpp
+++ b/mailnews/compose/src/nsMsgAttachmentHandler.cpp
@@ -49,65 +49,65 @@ extern void         MacGetFileType(nsIFi
 
 /* static */
 nsresult nsSimpleZipper::Zip(nsIFile *aInputFile, nsIFile *aOutputFile)
 {
   // create zipwriter object
   nsresult rv;
   nsCOMPtr<nsIZipWriter> zipWriter = do_CreateInstance("@mozilla.org/zipwriter;1", &rv);
   NS_ENSURE_SUCCESS(rv, rv);
-  
+
   rv = zipWriter->Open(aOutputFile, PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE);
-  NS_ENSURE_SUCCESS(rv, rv); 
-  
+  NS_ENSURE_SUCCESS(rv, rv);
+
   rv = AddToZip(zipWriter, aInputFile, EmptyCString());
   NS_ENSURE_SUCCESS(rv, rv);
 
   // we're done.
   zipWriter->Close();
   return rv;
 }
 
 /* static */
-nsresult nsSimpleZipper::AddToZip(nsIZipWriter *aZipWriter, 
+nsresult nsSimpleZipper::AddToZip(nsIZipWriter *aZipWriter,
                                   nsIFile *aFile,
                                   const nsACString &aPath)
 {
   // find out the path this file/dir should have in the zip
   nsCString leafName;
   aFile->GetNativeLeafName(leafName);
   nsCString currentPath(aPath);
   currentPath += leafName;
-    
+
   bool isDirectory;
   aFile->IsDirectory(&isDirectory);
   // append slash for a directory entry
   if (isDirectory)
     currentPath.Append('/');
-  
+
   // add the file or directory entry to the zip
   nsresult rv = aZipWriter->AddEntryFile(currentPath, nsIZipWriter::COMPRESSION_DEFAULT, aFile, false);
   NS_ENSURE_SUCCESS(rv, rv);
-  
+
   // if it's a directory, add all its contents too
   if (isDirectory) {
     nsCOMPtr<nsISimpleEnumerator> e;
     nsresult rv = aFile->GetDirectoryEntries(getter_AddRefs(e));
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsCOMPtr<nsIDirectoryEnumerator> dirEnumerator = do_QueryInterface(e, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsCOMPtr<nsIFile> currentFile;
     while (NS_SUCCEEDED(dirEnumerator->GetNextFile(getter_AddRefs(currentFile))) && currentFile) {
       rv = AddToZip(aZipWriter, currentFile, currentPath);
       NS_ENSURE_SUCCESS(rv, rv);
     }
   }
-  
+
   return NS_OK;
 }
 #endif // XP_MACOSX
 
 //
 // Class implementation...
 //
 nsMsgAttachmentHandler::nsMsgAttachmentHandler() :
@@ -124,18 +124,18 @@ nsMsgAttachmentHandler::nsMsgAttachmentH
   mSendViaCloud(false),
   mNodeIndex(-1),
   // For analyzing the attachment file...
   m_size(0),
   m_unprintable_count(0),
   m_highbit_count(0),
   m_ctl_count(0),
   m_null_count(0),
-  m_have_cr(0), 
-  m_have_lf(0), 
+  m_have_cr(0),
+  m_have_lf(0),
   m_have_crlf(0),
   m_prev_char_was_cr(false),
   m_current_column(0),
   m_max_column(0),
   m_lines(0),
   m_file_analyzed(false),
 
   // Mime
@@ -524,20 +524,20 @@ nsMsgAttachmentHandler::PickCharset()
 {
   if (!m_charset.IsEmpty() || !m_type.LowerCaseEqualsLiteral(TEXT_PLAIN))
     return NS_OK;
 
   nsCOMPtr<nsIFile> tmpFile =
     do_QueryInterface(mTmpFile);
   if (!tmpFile)
     return NS_OK;
-  
+
   return MsgDetectCharsetFromFile(tmpFile, m_charset);
 }
-    
+
 static nsresult
 FetcherURLDoneCallback(nsresult aStatus,
                        const nsACString &aContentType,
                        const nsACString &aCharset,
                        int32_t totalSize,
                        const char16_t* aMsg, void *tagData)
 {
   nsMsgAttachmentHandler *ma = (nsMsgAttachmentHandler *) tagData;
@@ -753,37 +753,37 @@ nsMsgAttachmentHandler::SnarfAttachment(
     filePath.Adopt(nsMsgGetLocalFileFromURL(sourceURISpec.get()));
     nsAutoCString unescapedFilePath;
     MsgUnescapeString(filePath, 0, unescapedFilePath);
 
     nsCOMPtr<nsIFile> sourceFile;
     NS_NewNativeLocalFile(unescapedFilePath, true, getter_AddRefs(sourceFile));
     if (!sourceFile)
       return NS_ERROR_FAILURE;
-      
-    // check if it is a bundle. if it is, we'll zip it. 
+
+    // check if it is a bundle. if it is, we'll zip it.
     // if not, we'll apple encode it (applesingle or appledouble)
     nsCOMPtr<nsILocalFileMac> macFile(do_QueryInterface(sourceFile));
     bool isPackage;
     macFile->IsPackage(&isPackage);
     if (isPackage)
       rv = ConvertToZipFile(macFile);
     else
       rv = ConvertToAppleEncoding(sourceURISpec, unescapedFilePath, macFile);
-    
+
     NS_ENSURE_SUCCESS(rv, rv);
   }
 #endif /* XP_MACOSX */
 
   //
   // Ok, here we are, we need to fire the URL off and get the data
   // in the temp file
   //
   // Create a fetcher for the URL attachment...
-  
+
   nsCOMPtr<nsIURLFetcher> fetcher = do_CreateInstance(NS_URLFETCHER_CONTRACTID, &rv);
   if (NS_FAILED(rv) || !fetcher)
   {
     if (NS_SUCCEEDED(rv))
       return NS_ERROR_UNEXPECTED;
     else
       return rv;
   }
@@ -817,23 +817,23 @@ nsMsgAttachmentHandler::ConvertToZipFile
   // set some metadata for this attachment, that will affect the MIME headers.
   m_type = APPLICATION_ZIP;
   m_realName = zippedName.get();
 
   return NS_OK;
 }
 
 nsresult
-nsMsgAttachmentHandler::ConvertToAppleEncoding(const nsCString &aFileURI, 
-                                               const nsCString &aFilePath, 
+nsMsgAttachmentHandler::ConvertToAppleEncoding(const nsCString &aFileURI,
+                                               const nsCString &aFilePath,
                                                nsILocalFileMac *aSourceFile)
 {
   // convert the apple file to AppleDouble first, and then patch the
   // address in the url.
-  
+
   //We need to retrieve the file type and creator...
 
   char fileInfo[32];
   OSType type, creator;
 
   nsresult rv = aSourceFile->GetFileType(&type);
   if (NS_FAILED(rv))
     return rv;
--- a/mailnews/compose/src/nsMsgAttachmentHandler.h
+++ b/mailnews/compose/src/nsMsgAttachmentHandler.h
@@ -28,28 +28,28 @@ public:
   char                        *buff;          // the working buff
   int32_t                     s_buff;         // the working buff size
   nsCOMPtr <nsIOutputStream>  fileStream;    // file to hold the encoding
 };
 
 class nsILocalFileMac;
 class nsIZipWriter;
 
-/* Simple utility class that will synchronously zip any file 
+/* Simple utility class that will synchronously zip any file
    (or folder hierarchy) you give it. */
 class nsSimpleZipper
 {
   public:
-    
+
     // Synchronously zips the input file/folder and writes all
     // data to the output file.
     static nsresult Zip(nsIFile *aInputFile, nsIFile *aOutputFile);
-  
+
   private:
-    
+
     // Recursively adds the file or folder to aZipWriter.
     static nsresult AddToZip(nsIZipWriter *aZipWriter,
                              nsIFile *aFile,
                              const nsACString &aPath);
 };
 #endif  // XP_MACOSX
 
 namespace mozilla {
@@ -72,90 +72,90 @@ public:
 
   nsMsgAttachmentHandler();
 public:
   nsresult              SnarfAttachment(nsMsgCompFields *compFields);
   nsresult              PickEncoding(const char *charset, nsIMsgSend* mime_delivery_state);
   nsresult              PickCharset();
   void                  AnalyzeSnarfedFile ();      // Analyze a previously-snarfed file.
                                                     // (Currently only used for plaintext
-                                                    // converted from HTML.) 
+                                                    // converted from HTML.)
   nsresult              Abort();
   nsresult              UrlExit(nsresult status, const char16_t* aMsg);
-  
+
   // if there's an intermediate temp file left, takes care to remove it from disk.
   //
   // NOTE: this takes care of the mEncodedWorkingFile temp file, but not mTmpFile which seems
   // to be used by lots of other classes at the moment.
   void                  CleanupTempFile();
 
 private:
   virtual ~nsMsgAttachmentHandler();
 
   // use when a message (e.g. original message in a reply) is attached as a rfc822 attachment.
   nsresult              SnarfMsgAttachment(nsMsgCompFields *compFields);
   bool                  UseUUEncode_p(void);
   void                  AnalyzeDataChunk (const char *chunk, int32_t chunkSize);
   nsresult              LoadDataFromFile(nsIFile *file, nsString &sigData, bool charsetConversion); //A similar function already exist in nsMsgCompose!
 #ifdef XP_MACOSX
-  nsresult              ConvertToAppleEncoding(const nsCString &aFileSpecURI, 
-                                               const nsCString &aFilePath, 
+  nsresult              ConvertToAppleEncoding(const nsCString &aFileSpecURI,
+                                               const nsCString &aFilePath,
                                                nsILocalFileMac *aSourceFile);
   // zips this attachment and does the work to make this attachment handler handle it properly.
   nsresult ConvertToZipFile(nsILocalFileMac *aSourceFile);
   bool HasResourceFork(FSRef *fsRef);
 #endif
 
   //
 public:
   nsCOMPtr<nsIURI> mURL;
-  nsCOMPtr<nsIFile>        mTmpFile;         // The temp file to which we save it 
-  nsCOMPtr<nsIOutputStream>  mOutFile;          
+  nsCOMPtr<nsIFile>        mTmpFile;         // The temp file to which we save it
+  nsCOMPtr<nsIOutputStream>  mOutFile;
   nsCOMPtr<nsIRequest> mRequest; // The live request used while fetching an attachment
   nsMsgCompFields       *mCompFields;       // Message composition fields for the sender
   bool                  m_bogus_attachment; // This is to catch problem children...
-  
+
 #ifdef XP_MACOSX
   // if we need to encode this file into for example an appledouble, or zip file,
   // this file is our working file. currently only needed on mac.
   nsCOMPtr<nsIFile> mEncodedWorkingFile;
 #endif
 
   nsCString m_xMacType;      // Mac file type
   nsCString m_xMacCreator;   // Mac file creator
 
   bool m_done;
-  nsCString m_charset;         // charset name 
+  nsCString m_charset;         // charset name
   nsCString m_contentId;      // This is for mutipart/related Content-ID's
   nsCString m_type;            // The real type, once we know it.
   nsCString m_typeParam;      // Any addition parameters to add to the content-type (other than charset, macType and maccreator)
   nsCString m_overrideType;   // The type we should assume it to be
                                             // or 0, if we should get it from the
                                             // server)
-  nsCString m_overrideEncoding; // Goes along with override_type 
+  nsCString m_overrideEncoding; // Goes along with override_type
 
-  nsCString m_desiredType;    // The type it should be converted to. 
+  nsCString m_desiredType;    // The type it should be converted to.
   nsCString m_description;     // For Content-Description header
   nsCString m_realName;       // The name for the headers, if different
-                                            // from the URL. 
+                                            // from the URL.
   nsCString m_encoding;        // The encoding, once we've decided. */
   bool                  m_already_encoded_p; // If we attach a document that is already
                                              // encoded, we just pass it through.
 
   bool                  m_decrypted_p;  /* S/MIME -- when attaching a message that was
                                            encrypted, it's necessary to decrypt it first
                                            (since nobody but the original recipient can
                                            read it -- if you forward it to someone in the
                                            raw, it will be useless to them.)  This flag
                                            indicates whether decryption occurred, so that
                                            libmsg can issue appropriate warnings about
                                            doing a cleartext forward of a message that was
                                            originally encrypted. */
 
-  bool                  mDeleteFile;      // If this is true, Delete the file...its 
+  bool                  mDeleteFile;      // If this is true, Delete the file...its
                                           // NOT the original file!
 
   bool                  mMHTMLPart;           // This is true if its an MHTML part, otherwise, false
   bool                  mPartUserOmissionOverride;  // This is true if the user send send the email without this part
   bool                  mMainBody;            // True if this is a main body.
    // true if this should be sent as a link to a file.
   bool                  mSendViaCloud;
   nsString              mHtmlAnnotation;
@@ -167,17 +167,17 @@ public:
   //
   // Vars for analyzing file data...
   //
   uint32_t              m_size;         /* Some state used while filtering it */
   uint32_t              m_unprintable_count;
   uint32_t              m_highbit_count;
   uint32_t              m_ctl_count;
   uint32_t              m_null_count;
-  uint8_t               m_have_cr, m_have_lf, m_have_crlf; 
+  uint8_t               m_have_cr, m_have_lf, m_have_crlf;
   bool                  m_prev_char_was_cr;
   uint32_t              m_current_column;
   uint32_t              m_max_column;
   uint32_t              m_lines;
   bool                  m_file_analyzed;
 
   nsAutoPtr<MimeEncoder> m_encoder;
   nsCString             m_uri; // original uri string
--- a/mailnews/compose/src/nsMsgCompFields.cpp
+++ b/mailnews/compose/src/nsMsgCompFields.cpp
@@ -55,17 +55,17 @@ static HeaderInfo kHeaders[] = {
 };
 
 static_assert(MOZ_ARRAY_LENGTH(kHeaders) ==
     nsMsgCompFields::MSG_MAX_HEADERS,
   "These two arrays need to be kept in sync or bad things will happen!");
 
 NS_IMPL_ISUPPORTS(nsMsgCompFields, nsIMsgCompFields, msgIStructuredHeaders,
   msgIWritableStructuredHeaders)
- 
+
 nsMsgCompFields::nsMsgCompFields()
 : mStructuredHeaders(do_CreateInstance(NS_ISTRUCTUREDHEADERS_CONTRACTID))
 {
   m_body.Truncate();
 
   m_attachVCard = false;
   m_forcePlainText = false;
   m_useMultipartAlternative = false;
--- a/mailnews/compose/src/nsMsgCompUtils.h
+++ b/mailnews/compose/src/nsMsgCompUtils.h
@@ -7,17 +7,17 @@
 #define _nsMsgCompUtils_H_
 
 #include "nscore.h"
 #include "nsMsgSend.h"
 #include "nsMsgCompFields.h"
 #include "nsIMsgSend.h"
 #include "nsIMsgCompUtils.h"
 
-class nsIPrompt; 
+class nsIPrompt;
 
 #define ANY_SERVER "anyfolder://"
 
 // these are msg hdr property names for storing the original
 // msg uri's and disposition(replied/forwarded) when queuing
 // messages to send later.
 #define ORIG_URI_PROPERTY "origURIs"
 #define QUEUED_DISPOSITION_PROPERTY "queuedDisposition"
@@ -40,17 +40,17 @@ PR_BEGIN_EXTERN_C
 // Create a file spec or file name using the name passed
 // in as a template
 //
 nsresult    nsMsgCreateTempFile(const char *tFileName, nsIFile **tFile);
 char        *nsMsgCreateTempFileName(const char *tFileName);
 
 
 //
-// Various utilities for building parts of MIME encoded 
+// Various utilities for building parts of MIME encoded
 // messages during message composition
 //
 
 nsresult    mime_sanity_check_fields_recipients (
                             const char *to,
                             const char *cc,
                             const char *bcc,
                             const char *newsgroups);
--- a/mailnews/compose/src/nsMsgCompose.h
+++ b/mailnews/compose/src/nsMsgCompose.h
@@ -27,17 +27,17 @@ class QuotingOutputStreamListener;
 class nsMsgComposeSendListener;
 class nsIEditorMailSupport;
 class nsIRDFService;
 class nsIArray;
 struct nsMsgMailList;
 
 class nsMsgCompose : public nsIMsgCompose, public nsSupportsWeakReference
 {
- public: 
+ public:
 
   nsMsgCompose();
 
   /* this macro defines QueryInterface, AddRef and Release for this class */
   NS_DECL_THREADSAFE_ISUPPORTS
 
   /*** nsIMsgCompose pure virtual functions */
   NS_DECL_NSIMSGCOMPOSE
@@ -99,20 +99,20 @@ protected:
 #define MAX_OF_RECIPIENT_ARRAY 3
   typedef nsTArray<nsMsgRecipient> RecipientsArray[MAX_OF_RECIPIENT_ARRAY];
   /**
    * This method parses the compose fields and associates email addresses with
    * the relevant cards from the address books.
    */
   nsresult LookupAddressBook(RecipientsArray &recipientList);
   bool IsLastWindow();
- 
+
        // Helper function. Parameters are not checked.
   bool                                      mConvertStructs;    // for TagConvertible
-  
+
   nsCOMPtr<nsIEditor>                       m_editor;
   mozIDOMWindowProxy                        *m_window;
   nsCOMPtr<nsIDocShell>                     mDocShell;
   nsCOMPtr<nsIBaseWindow>                   m_baseWindow;
   RefPtr<nsMsgCompFields>                   m_compFields;
   nsCOMPtr<nsIMsgIdentity>                  m_identity;
   bool                                      m_composeHTML;
   RefPtr<QuotingOutputStreamListener>       mQuoteStreamListener;
@@ -191,36 +191,36 @@ private:
     nsString                    mCiteReference;
     nsCOMPtr<nsIMimeConverter>  mMimeConverter;
     int32_t                     mUnicodeBufferCharacterLength;
     bool                        mQuoteOriginal;
     nsCString                   mHtmlToQuote;
 };
 
 ////////////////////////////////////////////////////////////////////////////////////
-// This is the listener class for the send operation. We have to create this class 
+// This is the listener class for the send operation. We have to create this class
 // to listen for message send completion and eventually notify the caller
 ////////////////////////////////////////////////////////////////////////////////////
 class nsMsgComposeSendListener : public nsIMsgComposeSendListener, public nsIMsgSendListener, public nsIMsgCopyServiceListener, public nsIWebProgressListener
 {
 public:
   nsMsgComposeSendListener(void);
 
   // nsISupports interface
   NS_DECL_ISUPPORTS
 
   // nsIMsgComposeSendListener interface
   NS_DECL_NSIMSGCOMPOSESENDLISTENER
 
   // nsIMsgSendListener interface
   NS_DECL_NSIMSGSENDLISTENER
-  
+
   // nsIMsgCopyServiceListener interface
   NS_DECL_NSIMSGCOPYSERVICELISTENER
-  
+
   // nsIWebProgressListener interface
   NS_DECL_NSIWEBPROGRESSLISTENER
 
   nsresult    RemoveCurrentDraftMessage(nsIMsgCompose *compObj, bool calledByCopy);
   nsresult    GetMsgFolder(nsIMsgCompose *compObj, nsIMsgFolder **msgFolder);
 
 private:
   virtual ~nsMsgComposeSendListener();
--- a/mailnews/compose/src/nsMsgComposeContentHandler.cpp
+++ b/mailnews/compose/src/nsMsgComposeContentHandler.cpp
@@ -106,17 +106,17 @@ NS_IMETHODIMP nsMsgComposeContentHandler
 
     nsCOMPtr<nsIURI> aUri;
     nsCOMPtr<nsIChannel> aChannel = do_QueryInterface(request);
     if(!aChannel) return NS_ERROR_FAILURE;
 
     rv = aChannel->GetURI(getter_AddRefs(aUri));
     if (aUri)
     {
-      nsCOMPtr<nsIMsgComposeService> composeService = 
+      nsCOMPtr<nsIMsgComposeService> composeService =
                do_GetService(kMsgComposeServiceCID, &rv);
       if (NS_SUCCEEDED(rv))
         rv = composeService->OpenComposeWindowWithURI(nullptr, aUri, identity);
     }
   } else {
     // The content-type was not application/x-mailto...
     return NS_ERROR_WONT_HANDLE_CONTENT;
   }
--- a/mailnews/compose/src/nsMsgComposeContentHandler.h
+++ b/mailnews/compose/src/nsMsgComposeContentHandler.h
@@ -3,17 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsIContentHandler.h"
 #include "nsIMsgIdentity.h"
 
 class nsMsgComposeContentHandler : public nsIContentHandler
 {
-public: 
+public:
 	nsMsgComposeContentHandler();
 
 	NS_DECL_ISUPPORTS
   NS_DECL_NSICONTENTHANDLER
 private:
 	virtual ~nsMsgComposeContentHandler();
   nsresult GetBestIdentity(nsIInterfaceRequestor* aWindowContext,
                            nsIMsgIdentity **identity);
--- a/mailnews/compose/src/nsMsgComposeParams.cpp
+++ b/mailnews/compose/src/nsMsgComposeParams.cpp
@@ -18,45 +18,45 @@ NS_IMPL_ISUPPORTS(nsMsgComposeParams, ns
 nsMsgComposeParams::~nsMsgComposeParams()
 {
 }
 
 /* attribute MSG_ComposeType type; */
 NS_IMETHODIMP nsMsgComposeParams::GetType(MSG_ComposeType *aType)
 {
   NS_ENSURE_ARG_POINTER(aType);
-  
+
   *aType = mType;
   return NS_OK;
 }
 NS_IMETHODIMP nsMsgComposeParams::SetType(MSG_ComposeType aType)
 {
   mType = aType;
   return NS_OK;
 }
 
 /* attribute MSG_ComposeFormat format; */
 NS_IMETHODIMP nsMsgComposeParams::GetFormat(MSG_ComposeFormat *aFormat)
 {
   NS_ENSURE_ARG_POINTER(aFormat);
-  
+
   *aFormat = mFormat;
   return NS_OK;
 }
 NS_IMETHODIMP nsMsgComposeParams::SetFormat(MSG_ComposeFormat aFormat)
 {
   mFormat = aFormat;
   return NS_OK;
 }
 
 /* attribute string originalMsgURI; */
 NS_IMETHODIMP nsMsgComposeParams::GetOriginalMsgURI(char * *aOriginalMsgURI)
 {
   NS_ENSURE_ARG_POINTER(aOriginalMsgURI);
-  
+
   *aOriginalMsgURI = ToNewCString(mOriginalMsgUri);
   return NS_OK;
 }
 NS_IMETHODIMP nsMsgComposeParams::SetOriginalMsgURI(const char * aOriginalMsgURI)
 {
   mOriginalMsgUri = aOriginalMsgURI;
   return NS_OK;
 }
@@ -99,17 +99,17 @@ NS_IMETHODIMP nsMsgComposeParams::SetHtm
   mHtmlToQuote = aHtmlToQuote;
   return NS_OK;
 }
 
 /* attribute nsIMsgCompFields composeFields; */
 NS_IMETHODIMP nsMsgComposeParams::GetComposeFields(nsIMsgCompFields * *aComposeFields)
 {
   NS_ENSURE_ARG_POINTER(aComposeFields);
-  
+
   if (mComposeFields)
   {
      NS_ADDREF(*aComposeFields = mComposeFields);
   }
   else
     *aComposeFields = nullptr;
   return NS_OK;
 }
@@ -118,31 +118,31 @@ NS_IMETHODIMP nsMsgComposeParams::SetCom
   mComposeFields = aComposeFields;
   return NS_OK;
 }
 
 /* attribute boolean bodyIsLink; */
 NS_IMETHODIMP nsMsgComposeParams::GetBodyIsLink(bool *aBodyIsLink)
 {
   NS_ENSURE_ARG_POINTER(aBodyIsLink);
-  
+
   *aBodyIsLink = mBodyIsLink;
   return NS_OK;
 }
 NS_IMETHODIMP nsMsgComposeParams::SetBodyIsLink(bool aBodyIsLink)
 {
   mBodyIsLink = aBodyIsLink;
   return NS_OK;
 }
 
 /* attribute nsIMsgSendLisneter sendListener; */
 NS_IMETHODIMP nsMsgComposeParams::GetSendListener(nsIMsgSendListener * *aSendListener)
 {
   NS_ENSURE_ARG_POINTER(aSendListener);
-  
+
   if (mSendListener)
   {
      NS_ADDREF(*aSendListener = mSendListener);
   }
   else
     *aSendListener = nullptr;
   return NS_OK;
 }
@@ -151,17 +151,17 @@ NS_IMETHODIMP nsMsgComposeParams::SetSen
   mSendListener = aSendListener;
   return NS_OK;
 }
 
 /* attribute string smtpPassword; */
 NS_IMETHODIMP nsMsgComposeParams::GetSmtpPassword(char * *aSmtpPassword)
 {
   NS_ENSURE_ARG_POINTER(aSmtpPassword);
-  
+
   *aSmtpPassword = ToNewCString(mSMTPPassword);
   return NS_OK;
 }
 NS_IMETHODIMP nsMsgComposeParams::SetSmtpPassword(const char * aSmtpPassword)
 {
   mSMTPPassword = aSmtpPassword;
   return NS_OK;
 }
--- a/mailnews/compose/src/nsMsgComposeParams.h
+++ b/mailnews/compose/src/nsMsgComposeParams.h
@@ -4,22 +4,22 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsIMsgComposeParams.h"
 #include "nsString.h"
 #include "nsIMsgHdr.h"
 #include "nsCOMPtr.h"
 class nsMsgComposeParams : public nsIMsgComposeParams
 {
-public: 
+public:
   nsMsgComposeParams();
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSIMSGCOMPOSEPARAMS
-  
+
 private:
   virtual ~nsMsgComposeParams();
   MSG_ComposeType               mType;
   MSG_ComposeFormat             mFormat;
   nsCString                     mOriginalMsgUri;
   nsCOMPtr<nsIMsgIdentity>      mIdentity;
   nsCOMPtr<nsIMsgCompFields>    mComposeFields;
   bool                          mBodyIsLink;
--- a/mailnews/compose/src/nsMsgComposeProgressParams.cpp
+++ b/mailnews/compose/src/nsMsgComposeProgressParams.cpp
@@ -16,31 +16,31 @@ nsMsgComposeProgressParams::nsMsgCompose
 nsMsgComposeProgressParams::~nsMsgComposeProgressParams()
 {
 }
 
 /* attribute wstring subject; */
 NS_IMETHODIMP nsMsgComposeProgressParams::GetSubject(char16_t * *aSubject)
 {
   NS_ENSURE_ARG(aSubject);
-  
+
   *aSubject = ToNewUnicode(m_subject);
   return NS_OK;
 }
 NS_IMETHODIMP nsMsgComposeProgressParams::SetSubject(const char16_t * aSubject)
 {
   m_subject = aSubject;
   return NS_OK;
 }
 
 /* attribute MSG_DeliverMode deliveryMode; */
 NS_IMETHODIMP nsMsgComposeProgressParams::GetDeliveryMode(MSG_DeliverMode *aDeliveryMode)
 {
   NS_ENSURE_ARG(aDeliveryMode);
-  
+
   *aDeliveryMode = m_deliveryMode;
   return NS_OK;
 }
 NS_IMETHODIMP nsMsgComposeProgressParams::SetDeliveryMode(MSG_DeliverMode aDeliveryMode)
 {
   m_deliveryMode = aDeliveryMode;
   return NS_OK;
 }
--- a/mailnews/compose/src/nsMsgComposeProgressParams.h
+++ b/mailnews/compose/src/nsMsgComposeProgressParams.h
@@ -2,17 +2,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsIMsgComposeProgressParams.h"
 
 class nsMsgComposeProgressParams : public nsIMsgComposeProgressParams
 {
-public: 
+public:
 	NS_DECL_ISUPPORTS
   NS_DECL_NSIMSGCOMPOSEPROGRESSPARAMS
 
 	nsMsgComposeProgressParams();
 
 private:
 	virtual ~nsMsgComposeProgressParams();
   nsString                          m_subject;
--- a/mailnews/compose/src/nsMsgComposeService.h
+++ b/mailnews/compose/src/nsMsgComposeService.h
@@ -12,39 +12,39 @@
 #include "nsIObserver.h"
 #include "nsWeakReference.h"
 #include "nsIMimeStreamConverter.h"
 #include "nsInterfaceHashtable.h"
 
 #include "nsICommandLineHandler.h"
 #define ICOMMANDLINEHANDLER nsICommandLineHandler
 
-class nsMsgComposeService : 
+class nsMsgComposeService :
   public nsIMsgComposeService,
   public ICOMMANDLINEHANDLER,
   public nsSupportsWeakReference
 {
-public: 
+public:
 	nsMsgComposeService();
 
 	NS_DECL_ISUPPORTS
   NS_DECL_NSIMSGCOMPOSESERVICE
   NS_DECL_NSICOMMANDLINEHANDLER
 
   nsresult Init();
   void Reset();
   void DeleteCachedWindows();
   nsresult AddGlobalHtmlDomains();
 
 private:
 	virtual ~nsMsgComposeService();
   bool mLogComposePerformance;
 
-  nsresult LoadDraftOrTemplate(const nsACString& aMsgURI, nsMimeOutputType aOutType, 
-                               nsIMsgIdentity * aIdentity, const char * aOriginalMsgURI, 
+  nsresult LoadDraftOrTemplate(const nsACString& aMsgURI, nsMimeOutputType aOutType,
+                               nsIMsgIdentity * aIdentity, const char * aOriginalMsgURI,
                                nsIMsgDBHdr * aOrigMsgHdr, bool aForwardInline,
                                bool overrideComposeFormat,
                                nsIMsgWindow *aMsgWindow);
 
   nsresult RunMessageThroughMimeDraft(const nsACString& aMsgURI,
                                       nsMimeOutputType aOutType,
                                       nsIMsgIdentity * aIdentity,
                                       const char * aOriginalMsgURI,
--- a/mailnews/compose/src/nsMsgCopy.h
+++ b/mailnews/compose/src/nsMsgCopy.h
@@ -19,39 +19,39 @@
 #define NS_IMSGCOPY_IID           \
 { 0x874c3b5, 0x317d, 0x11d3,      \
 { 0x8e, 0xfb, 0x0, 0xa0, 0x24, 0xa7, 0xd1, 0x44 } };
 
 // Forward declarations...
 class   nsMsgCopy;
 
 ////////////////////////////////////////////////////////////////////////////////////
-// This is the listener class for the copy operation. We have to create this class 
+// This is the listener class for the copy operation. We have to create this class
 // to listen for message copy completion and eventually notify the caller
 ////////////////////////////////////////////////////////////////////////////////////
 class CopyListener : public nsIMsgCopyServiceListener
 {
 public:
   CopyListener(void);
 
   // nsISupports interface
   NS_DECL_THREADSAFE_ISUPPORTS
 
   NS_IMETHOD OnStartCopy() override;
-  
+
   NS_IMETHOD OnProgress(uint32_t aProgress, uint32_t aProgressMax) override;
 
   NS_IMETHOD SetMessageKey(nsMsgKey aMessageKey) override;
 
   NS_IMETHOD GetMessageId(nsACString& aMessageId) override;
-  
+
   NS_IMETHOD OnStopCopy(nsresult aStatus) override;
 
   NS_IMETHOD SetMsgComposeAndSendObject(nsIMsgSend *obj);
-  
+
   bool                            mCopyInProgress;
 
 private:
   virtual ~CopyListener();
   nsCOMPtr<nsIMsgSend>       mComposeAndSend;
 };
 
 //
@@ -68,53 +68,53 @@ public:
   NS_DECL_NSIURLLISTENER
 
 
   //////////////////////////////////////////////////////////////////////
   // Object methods...
   //////////////////////////////////////////////////////////////////////
   //
   nsresult              StartCopyOperation(nsIMsgIdentity       *aUserIdentity,
-                                           nsIFile          *aFile, 
+                                           nsIFile          *aFile,
                                            nsMsgDeliverMode     aMode,
                                            nsIMsgSend           *aMsgSendObj,
                                            const char           *aSavePref,
                                            nsIMsgDBHdr          *aMsgToReplace);
 
   nsresult              DoCopy(nsIFile *aDiskFile, nsIMsgFolder *dstFolder,
                                nsIMsgDBHdr *aMsgToReplace, bool aIsDraft,
                                nsIMsgWindow *msgWindow,
                                nsIMsgSend   *aMsgSendObj);
 
   nsresult	GetUnsentMessagesFolder(nsIMsgIdentity *userIdentity, nsIMsgFolder **msgFolder, bool *waitForUrl);
   nsresult	GetDraftsFolder(nsIMsgIdentity *userIdentity, nsIMsgFolder **msgFolder, bool *waitForUrl);
   nsresult	GetTemplatesFolder(nsIMsgIdentity *userIdentity, nsIMsgFolder **msgFolder, bool *waitForUrl);
   nsresult	GetSentFolder(nsIMsgIdentity *userIdentity,  nsIMsgFolder **msgFolder, bool *waitForUrl);
   nsresult   CreateIfMissing(nsIMsgFolder **folder, bool *waitForUrl);
 
-  
+
   //
   // Vars for implementation...
   //
   nsIFile                     *mFile;     // the file we are sending...
   nsMsgDeliverMode                mMode;
   nsCOMPtr<nsIMsgFolder>          mDstFolder;
   nsCOMPtr<nsIMsgDBHdr>           mMsgToReplace;
   bool                            mIsDraft;
   nsCOMPtr<nsIMsgSend>            mMsgSendObj;
   char                            *mSavePref;
 
 private:
   virtual ~nsMsgCopy();
 };
 
 // Useful function for the back end...
-nsresult	LocateMessageFolder(nsIMsgIdentity   *userIdentity, 
+nsresult	LocateMessageFolder(nsIMsgIdentity   *userIdentity,
                                        nsMsgDeliverMode aFolderType,
                                        const char       *aSaveURI,
 				       nsIMsgFolder **msgFolder);
 
-nsresult	MessageFolderIsLocal(nsIMsgIdentity   *userIdentity, 
+nsresult	MessageFolderIsLocal(nsIMsgIdentity   *userIdentity,
                                        nsMsgDeliverMode aFolderType,
                                        const char       *aSaveURI,
 				       bool		*aResult);
 
 #endif /* _nsMsgCopy_H_ */
--- a/mailnews/compose/src/nsMsgQuote.cpp
+++ b/mailnews/compose/src/nsMsgQuote.cpp
@@ -9,17 +9,17 @@
 #include "nsIServiceManager.h"
 #include "nsIStreamListener.h"
 #include "nsIStreamConverter.h"
 #include "nsIStreamConverterService.h"
 #include "nsIMimeStreamConverter.h"
 #include "nsMimeTypes.h"
 #include "nsICharsetConverterManager.h"
 #include "prprf.h"
-#include "nsMsgQuote.h" 
+#include "nsMsgQuote.h"
 #include "nsMsgCompUtils.h"
 #include "nsIMsgMessageService.h"
 #include "nsMsgUtils.h"
 #include "nsNetUtil.h"
 #include "nsMsgMimeCID.h"
 #include "nsMsgCompCID.h"
 #include "nsMsgCompose.h"
 #include "nsMsgMailNewsUrl.h"
@@ -180,29 +180,29 @@ nsMsgQuote::QuoteMessage(const char *msg
                                       nullptr,
                                       nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                                       nsIContentPolicy::TYPE_OTHER,
                                       getter_AddRefs(mQuoteChannel));
 
   if (NS_FAILED(rv)) return rv;
   nsCOMPtr<nsISupports> ctxt = do_QueryInterface(aURL);
 
-  nsCOMPtr<nsIStreamConverterService> streamConverterService = 
+  nsCOMPtr<nsIStreamConverterService> streamConverterService =
            do_GetService("@mozilla.org/streamConverters;1", &rv);
   NS_ENSURE_SUCCESS(rv,rv);
 
   nsCOMPtr<nsIStreamListener> convertedListener;
   rv = streamConverterService->AsyncConvertData("message/rfc822",
                                                 "application/vnd.mozilla.xul+xml",
                                                 mStreamListener,
                                                 quoteSupport,
                                                 getter_AddRefs(convertedListener));
   if (NS_FAILED(rv)) return rv;
 
-  //  now try to open the channel passing in our display consumer as the listener 
+  //  now try to open the channel passing in our display consumer as the listener
   rv = mQuoteChannel->AsyncOpen(convertedListener, ctxt);
   return rv;
 }
 
 NS_IMETHODIMP
 nsMsgQuote::GetQuoteListener(nsIMimeStreamConverterListener** aQuoteListener)
 {
     if (!aQuoteListener || !mQuoteListener)
--- a/mailnews/compose/src/nsMsgQuote.h
+++ b/mailnews/compose/src/nsMsgQuote.h
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #ifndef __nsMsgQuote_h__
 #define __nsMsgQuote_h__
 
-#include "nsIMsgQuote.h" 
+#include "nsIMsgQuote.h"
 #include "nsIMsgMessageService.h"
 #include "nsIStreamListener.h"
 #include "nsIMimeStreamConverter.h"
 #include "nsIChannel.h"
 #include "nsCOMPtr.h"
 #include "nsWeakReference.h"
 
 class nsMsgQuote;
@@ -27,25 +27,25 @@ public:
   NS_DECL_NSIMSGQUOTELISTENER
 
 private:
 	virtual ~nsMsgQuoteListener();
   nsWeakPtr mMsgQuote;
 };
 
 class nsMsgQuote: public nsIMsgQuote, public nsSupportsWeakReference {
-public: 
+public:
   nsMsgQuote();
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIMSGQUOTE
 
 private:
   virtual ~nsMsgQuote();
-  // 
+  //
   // Implementation data...
   //
   nsCOMPtr<nsIMsgQuotingOutputStreamListener> mStreamListener;
   bool			mQuoteHeaders;
   nsCOMPtr<nsIMsgQuoteListener> mQuoteListener;
   nsCOMPtr<nsIChannel> mQuoteChannel;
 };
 
--- a/mailnews/compose/src/nsMsgSendLater.cpp
+++ b/mailnews/compose/src/nsMsgSendLater.cpp
@@ -222,32 +222,32 @@ nsMsgSendLater::OnStopRequest(nsIRequest
   if (NS_SUCCEEDED(status))
   {
     // Message is done...send it!
     rv = CompleteMailFileSend();
 
 #ifdef NS_DEBUG
     printf("nsMsgSendLater: Success on getting message...\n");
 #endif
-    
+
     // If the send operation failed..try the next one...
     if (NS_FAILED(rv))
     {
       rv = StartNextMailFileSend(rv);
       if (NS_FAILED(rv))
         EndSendMessages(rv, nullptr, mTotalSendCount, mTotalSentSuccessfully);
     }
   }
   else
   {
     nsCOMPtr<nsIChannel> channel = do_QueryInterface(request);
     if(!channel) return NS_ERROR_FAILURE;
 
     // extract the prompt object to use for the alert from the url....
-    nsCOMPtr<nsIURI> uri; 
+    nsCOMPtr<nsIURI> uri;
     nsCOMPtr<nsIPrompt> promptObject;
     if (channel)
     {
       channel->GetURI(getter_AddRefs(uri));
       nsCOMPtr<nsISmtpUrl> smtpUrl (do_QueryInterface(uri));
       if (smtpUrl)
         smtpUrl->GetPrompt(getter_AddRefs(promptObject));
     }
@@ -264,34 +264,34 @@ nsMsgSendLater::OnStopRequest(nsIRequest
 
 char *
 FindEOL(char *inBuf, char *buf_end)
 {
   char *buf = inBuf;
   char *findLoc = nullptr;
 
   while (buf <= buf_end)
-    if (*buf == 0) 
+    if (*buf == 0)
       return buf;
     else if ( (*buf == '\n') || (*buf == '\r') )
     {
       findLoc = buf;
       break;
     }
     else
       ++buf;
 
   if (!findLoc)
     return nullptr;
   else if ((findLoc + 1) > buf_end)
     return buf;
 
-  if ( (*findLoc == '\n' && *(findLoc+1) == '\r') || 
+  if ( (*findLoc == '\n' && *(findLoc+1) == '\r') ||
        (*findLoc == '\r' && *(findLoc+1) == '\n'))
-    findLoc++; // possibly a pair.       
+    findLoc++; // possibly a pair.
   return findLoc;
 }
 
 nsresult
 nsMsgSendLater::RebufferLeftovers(char *startBuf, uint32_t aLen)
 {
   PR_FREEIF(mLeftoverBuffer);
   mLeftoverBuffer = (char *)PR_Malloc(aLen + 1);
@@ -320,17 +320,17 @@ nsMsgSendLater::BuildNewBuffer(const cha
 }
 
 // Got data?
 NS_IMETHODIMP
 nsMsgSendLater::OnDataAvailable(nsIRequest *request, nsISupports *ctxt, nsIInputStream *inStr, uint64_t sourceOffset, uint32_t count)
 {
   NS_ENSURE_ARG_POINTER(inStr);
 
-  // This is a little bit tricky since we have to chop random 
+  // This is a little bit tricky since we have to chop random
   // buffers into lines and deliver the lines...plus keeping the
   // leftovers for next time...some fun, eh?
   //
   nsresult    rv = NS_OK;
   char        *startBuf;
   char        *endBuf;
   char        *lineEnd;
   char        *newbuf = nullptr;
@@ -392,46 +392,46 @@ nsMsgSendLater::OnStopRunningUrl(nsIURI 
 
 NS_IMETHODIMP
 nsMsgSendLater::OnStartRequest(nsIRequest *request, nsISupports *ctxt)
 {
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////////
-// This is the listener class for the send operation. We have to create this class 
+// This is the listener class for the send operation. We have to create this class
 // to listen for message send completion and eventually notify the caller
 ////////////////////////////////////////////////////////////////////////////////////
 NS_IMPL_ISUPPORTS(SendOperationListener, nsIMsgSendListener,
                    nsIMsgCopyServiceListener)
 
 SendOperationListener::SendOperationListener(nsMsgSendLater *aSendLater)
 : mSendLater(aSendLater)
 {
 }
 
-SendOperationListener::~SendOperationListener(void) 
+SendOperationListener::~SendOperationListener(void)
 {
 }
 
 NS_IMETHODIMP
 SendOperationListener::OnGetDraftFolderURI(const char *aFolderURI)
 {
   return NS_OK;
 }
-  
+
 NS_IMETHODIMP
 SendOperationListener::OnStartSending(const char *aMsgID, uint32_t aMsgSize)
 {
 #ifdef NS_DEBUG
   printf("SendOperationListener::OnStartSending()\n");
 #endif
   return NS_OK;
 }
-  
+
 NS_IMETHODIMP
 SendOperationListener::OnProgress(const char *aMsgID, uint32_t aProgress, uint32_t aProgressMax)
 {
 #ifdef NS_DEBUG
   printf("SendOperationListener::OnProgress()\n");
 #endif
   return NS_OK;
 }
@@ -446,19 +446,19 @@ SendOperationListener::OnStatus(const ch
   return NS_OK;
 }
 
 NS_IMETHODIMP
 SendOperationListener::OnSendNotPerformed(const char *aMsgID, nsresult aStatus)
 {
   return NS_OK;
 }
-  
+
 NS_IMETHODIMP
-SendOperationListener::OnStopSending(const char *aMsgID, nsresult aStatus, const char16_t *aMsg, 
+SendOperationListener::OnStopSending(const char *aMsgID, nsresult aStatus, const char16_t *aMsg,
                                      nsIFile *returnFile)
 {
   if (mSendLater && !mSendLater->OnSendStepFinished(aStatus))
     mSendLater = nullptr;
 
   return NS_OK;
 }
 
@@ -562,20 +562,20 @@ nsMsgSendLater::CompleteMailFileSend()
 
   rv = pMsgSend->SendMessageFile(identity,
                                  mAccountKey,
                                  compFields, // nsIMsgCompFields *fields,
                                  mTempFile, // nsIFile *sendFile,
                                  true, // bool deleteSendFileOnCompletion,
                                  false, // bool digest_p,
                                  nsIMsgSend::nsMsgSendUnsent, // nsMsgDeliverMode mode,
-                                 nullptr, // nsIMsgDBHdr *msgToReplace, 
+                                 nullptr, // nsIMsgDBHdr *msgToReplace,
                                  sendListener,
                                  mFeedback,
-                                 nullptr); 
+                                 nullptr);
   return rv;
 }
 
 nsresult
 nsMsgSendLater::StartNextMailFileSend(nsresult prevStatus)
 {
   bool hasMoreElements = false;
   if ((!mEnumerator) ||
@@ -597,27 +597,27 @@ nsMsgSendLater::StartNextMailFileSend(ns
   // update with 100% for both send and copy as we must have finished by now.
   if (mTotalSendCount)
     NotifyListenersOnProgress(mTotalSendCount, mMessagesToSend.Count(), 100, 100);
 
   nsCOMPtr<nsISupports> currentItem;
   nsresult rv = mEnumerator->GetNext(getter_AddRefs(currentItem));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  mMessage = do_QueryInterface(currentItem); 
+  mMessage = do_QueryInterface(currentItem);
   if (!mMessage)
     return NS_ERROR_NOT_AVAILABLE;
 
   if (!mMessageFolder)
     return NS_ERROR_UNEXPECTED;
 
   nsCString messageURI;
   mMessageFolder->GetUriForMsg(mMessage, messageURI);
 
-  rv = nsMsgCreateTempFile("nsqmail.tmp", getter_AddRefs(mTempFile)); 
+  rv = nsMsgCreateTempFile("nsqmail.tmp", getter_AddRefs(mTempFile));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIMsgMessageService> messageService;
   rv = GetMessageServiceFromURI(messageURI, getter_AddRefs(messageService));
   if (NS_FAILED(rv) && !messageService)
     return NS_ERROR_FACTORY_NOT_LOADED;
 
   ++mTotalSendCount;
@@ -651,17 +651,17 @@ nsMsgSendLater::StartNextMailFileSend(ns
   rv = messageService->DisplayMessage(messageURI.get(),
                                       static_cast<nsIStreamListener*>(this),
                                       nullptr, nullptr, nullptr,
                                       getter_AddRefs(dummyNull));
 
   return rv;
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsMsgSendLater::GetUnsentMessagesFolder(nsIMsgIdentity *aIdentity, nsIMsgFolder **folder)
 {
   nsCString uri;
   GetFolderURIFromUserPrefs(nsIMsgSend::nsMsgQueueForLater, aIdentity, uri);
   return LocateMessageFolder(aIdentity, nsIMsgSend::nsMsgQueueForLater,
                              uri.get(), folder);
 }
 
@@ -702,17 +702,17 @@ nsMsgSendLater::HasUnsentMessages(nsIMsg
   NS_ENSURE_SUCCESS(rv, rv);
 
   *aResult = totalMessages > 0;
   return NS_OK;
 }
 
 //
 // To really finalize this capability, we need to have the ability to get
-// the message from the mail store in a stream for processing. The flow 
+// the message from the mail store in a stream for processing. The flow
 // would be something like this:
 //
 //      foreach (message in Outbox folder)
 //         get stream of Nth message
 //         if (not done with headers)
 //            Tack on to current buffer of headers
 //         when done with headers
 //            BuildHeaders()
@@ -723,17 +723,17 @@ nsMsgSendLater::HasUnsentMessages(nsIMsg
 //          when done with the message
 //            do send operation
 //
 //          when send is complete
 //            Copy from Outbox to FCC folder
 //            Delete from Outbox folder
 //
 //
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsMsgSendLater::SendUnsentMessages(nsIMsgIdentity *aIdentity)
 {
   return InternalSendMessages(true, aIdentity);
 }
 
 // Returns NS_OK if the db is OK, an error otherwise, e.g., we had to reparse.
 nsresult nsMsgSendLater::ReparseDBIfNeeded(nsIUrlListener *aListener)
 {
@@ -801,17 +801,17 @@ nsMsgSendLater::InternalSendMessages(boo
           mMessagesToSend.AppendObject(messageHeader);
         else
         {
           // Else just send those that are NOT marked as Queued.
           uint32_t flags;
           rv = messageHeader->GetFlags(&flags);
           if (NS_SUCCEEDED(rv) && !(flags & nsMsgMessageFlags::Queued))
             mMessagesToSend.AppendObject(messageHeader);
-        }  
+        }
       }
     }
   }
 
   // Now get an enumerator for our array.
   rv = NS_NewArrayEnumerator(getter_AddRefs(mEnumerator), mMessagesToSend);
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -826,17 +826,17 @@ nsMsgSendLater::InternalSendMessages(boo
   return StartNextMailFileSend(NS_OK);
 }
 
 nsresult nsMsgSendLater::SetOrigMsgDisposition()
 {
   if (!mMessage)
     return NS_ERROR_NULL_POINTER;
 
-  // We're finished sending a queued message. We need to look at mMessage 
+  // We're finished sending a queued message. We need to look at mMessage
   // and see if we need to set replied/forwarded
   // flags for the original message that this message might be a reply to
   // or forward of.
   nsCString originalMsgURIs;
   nsCString queuedDisposition;
   mMessage->GetStringProperty(ORIG_URI_PROPERTY, getter_Copies(originalMsgURIs));
   mMessage->GetStringProperty(QUEUED_DISPOSITION_PROPERTY, getter_Copies(queuedDisposition));
   if (!queuedDisposition.IsEmpty())
@@ -853,17 +853,17 @@ nsresult nsMsgSendLater::SetOrigMsgDispo
         // get the folder for the message resource
         nsCOMPtr<nsIMsgFolder> msgFolder;
         msgHdr->GetFolder(getter_AddRefs(msgFolder));
         if (msgFolder)
         {
           nsMsgDispositionState dispositionSetting = nsIMsgFolder::nsMsgDispositionState_Replied;
           if (queuedDisposition.Equals("forwarded"))
             dispositionSetting = nsIMsgFolder::nsMsgDispositionState_Forwarded;
-          
+
           msgFolder->AddMessageDispositionState(msgHdr, dispositionSetting);
         }
       }
     }
   }
   return NS_OK;
 }
 
@@ -1023,17 +1023,17 @@ SEARCH_NEWLINE:
     else if (buf+2 < buf_end &&
          (buf[0] == '\r'  && buf[1] == '\n') &&
          (buf[2] == ' ' || buf[2] == '\t'))
     {
       buf += 3;
       goto SEARCH_NEWLINE;
     }
     // If "\r " or "\r\t" or "\n " or "\n\t" is next, that doesn't terminate
-    // the header either. 
+    // the header either.
     else if ((buf[0] == '\r'  || buf[0] == '\n') &&
          (buf[1] == ' ' || buf[1] == '\t'))
     {
       buf += 2;
       goto SEARCH_NEWLINE;
     }
 
     if (header)
@@ -1084,32 +1084,32 @@ SEARCH_NEWLINE:
       buf_end = to;
       m_headersFP = buf_end - m_headers;
     }
   }
 
   m_headers[m_headersFP++] = '\r';
   m_headers[m_headersFP++] = '\n';
 
-  // Now we have parsed out all of the headers we need and we 
+  // Now we have parsed out all of the headers we need and we
   // can proceed.
   return NS_OK;
 }
 
 nsresult
 DoGrowBuffer(int32_t desired_size, int32_t element_size, int32_t quantum,
             char **buffer, int32_t *size)
 {
   if (*size <= desired_size)
   {
     char *new_buf;
     int32_t increment = desired_size - *size;
-    if (increment < quantum) // always grow by a minimum of N bytes 
+    if (increment < quantum) // always grow by a minimum of N bytes
       increment = quantum;
-    
+
     new_buf = (*buffer
                 ? (char *) PR_Realloc (*buffer, (*size + increment)
                 * (element_size / sizeof(char)))
                 : (char *) PR_Malloc ((*size + increment)
                 * (element_size / sizeof(char))));
     if (! new_buf)
       return NS_ERROR_OUT_OF_MEMORY;
     *buffer = new_buf;
@@ -1123,66 +1123,66 @@ DoGrowBuffer(int32_t desired_size, int32
    DoGrowBuffer ((desired_size), sizeof(char), 1024, \
            &m_headers, &m_headersSize) \
    : NS_OK)
 
 nsresult
 nsMsgSendLater::DeliverQueuedLine(char *line, int32_t length)
 {
   int32_t flength = length;
-  
+
   m_bytesRead += length;
-  
-// convert existing newline to CRLF 
+
+// convert existing newline to CRLF
 // Don't need this because the calling routine is taking care of it.
-//  if (length > 0 && (line[length-1] == '\r' || 
+//  if (length > 0 && (line[length-1] == '\r' ||
 //     (line[length-1] == '\n' && (length < 2 || line[length-2] != '\r'))))
 //  {
 //    line[length-1] = '\r';
 //    line[length++] = '\n';
 //  }
 //
   //
-  // We are going to check if we are looking at a "From - " line. If so, 
+  // We are going to check if we are looking at a "From - " line. If so,
   // then just eat it and return NS_OK
   //
   if (!PL_strncasecmp(line, "From - ", 7))
     return NS_OK;
 
   if (m_inhead)
   {
     if (m_headersPosition == 0)
     {
       // This line is the first line in a header block.
       // Remember its position.
       m_headersPosition = m_position;
-      
+
       // Also, since we're now processing the headers, clear out the
       // slots which we will parse data into, so that the values that
       // were used the last time around do not persist.
-      
+
       // We must do that here, and not in the previous clause of this
       // `else' (the "I've just seen a `From ' line clause") because
       // that clause happens before delivery of the previous message is
       // complete, whereas this clause happens after the previous msg
       // has been delivered.  If we did this up there, then only the
       // last message in the folder would ever be able to be both
       // mailed and posted (or fcc'ed.)
       PR_FREEIF(m_to);
       PR_FREEIF(m_bcc);
       PR_FREEIF(m_newsgroups);
       PR_FREEIF(m_newshost);
       PR_FREEIF(m_fcc);
       PR_FREEIF(mIdentityKey);
     }
-    
+
     if (line[0] == '\r' || line[0] == '\n' || line[0] == 0)
     {
       // End of headers.  Now parse them; open the temp file;
-      // and write the appropriate subset of the headers out. 
+      // and write the appropriate subset of the headers out.
       m_inhead = false;
 
       nsresult rv = MsgNewBufferedFileOutputStream(getter_AddRefs(mOutFile), mTempFile, -1, 00600);
       if (NS_FAILED(rv))
         return NS_MSG_ERROR_WRITING_FILE;
 
       nsresult status = BuildHeaders();
       if (NS_FAILED(status))
@@ -1192,44 +1192,44 @@ nsMsgSendLater::DeliverQueuedLine(char *
       rv = mOutFile->Write(m_headers, m_headersFP, &n);
       if (NS_FAILED(rv) || n != (uint32_t)m_headersFP)
         return NS_MSG_ERROR_WRITING_FILE;
     }
     else
     {
       // Otherwise, this line belongs to a header.  So append it to the
       // header data.
-      
+
       if (!PL_strncasecmp (line, HEADER_X_MOZILLA_STATUS, PL_strlen(HEADER_X_MOZILLA_STATUS)))
         // Notice the position of the flags.
         m_flagsPosition = m_position;
       else if (m_headersFP == 0)
         m_flagsPosition = 0;
-      
+
       nsresult status = do_grow_headers (length + m_headersFP + 10);
-      if (NS_FAILED(status)) 
+      if (NS_FAILED(status))
         return status;
-      
+
       memcpy(m_headers + m_headersFP, line, length);
       m_headersFP += length;
     }
   }
   else
   {
     // This is a body line.  Write it to the file.
     PR_ASSERT(mOutFile);
     if (mOutFile)
     {
       uint32_t wrote;
       nsresult rv = mOutFile->Write(line, length, &wrote);
-      if (NS_FAILED(rv) || wrote < (uint32_t) length) 
+      if (NS_FAILED(rv) || wrote < (uint32_t) length)
         return NS_MSG_ERROR_WRITING_FILE;
     }
   }
-  
+
   m_position += flength;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgSendLater::AddListener(nsIMsgSendLaterListener *aListener)
 {
   NS_ENSURE_ARG_POINTER(aListener);
@@ -1314,17 +1314,17 @@ nsMsgSendLater::EndSendMessages(nsresult
   mMessagesToSend.Clear();
 
   // We don't need to keep hold of the database now we've finished sending.
   (void)mMessageFolder->SetMsgDatabase(nullptr);
 
   // or the enumerator, temp file or output stream
   mEnumerator = nullptr;
   mTempFile = nullptr;
-  mOutFile = nullptr;  
+  mOutFile = nullptr;
 
   NOTIFY_LISTENERS(OnStopSending, (aStatus, aMsg, aTotalTried, aSuccessful));
 
   // If we've got a shutdown listener, notify it that we've finished.
   if (mShutdownListener)
   {
     mShutdownListener->OnStopRunningUrl(nullptr, NS_OK);
     mShutdownListener = nullptr;
@@ -1384,17 +1384,17 @@ nsMsgSendLater::OnCopyStepFinished(nsres
 // XXX todo
 // maybe this should just live in the account manager?
 nsresult
 nsMsgSendLater::GetIdentityFromKey(const char *aKey, nsIMsgIdentity  **aIdentity)
 {
   NS_ENSURE_ARG_POINTER(aIdentity);
 
   nsresult rv;
-  nsCOMPtr<nsIMsgAccountManager> accountManager = 
+  nsCOMPtr<nsIMsgAccountManager> accountManager =
     do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv,rv);
 
   if (aKey)
   {
     nsCOMPtr<nsIArray> identities;
     if (NS_SUCCEEDED(accountManager->GetAllIdentities(getter_AddRefs(identities))))
     {
@@ -1419,17 +1419,17 @@ nsMsgSendLater::GetIdentityFromKey(const
     }
   }
 
   // if no aKey, or we failed to find the identity from the key
   // use the identity from the default account.
   nsCOMPtr<nsIMsgAccount> defaultAccount;
   rv = accountManager->GetDefaultAccount(getter_AddRefs(defaultAccount));
   NS_ENSURE_SUCCESS(rv,rv);
-  
+
   rv = defaultAccount->GetDefaultIdentity(aIdentity);
   NS_ENSURE_SUCCESS(rv,rv);
   return rv;
 }
 
 NS_IMETHODIMP
 nsMsgSendLater::OnItemAdded(nsIMsgFolder *aParentItem, nsISupports *aItem)
 {
--- a/mailnews/compose/src/nsMsgSendLater.h
+++ b/mailnews/compose/src/nsMsgSendLater.h
@@ -14,17 +14,17 @@
 #include "nsIMsgStatusFeedback.h"
 #include "nsTObserverArray.h"
 #include "nsIObserver.h"
 #include "nsITimer.h"
 #include "nsCOMPtr.h"
 #include "nsIMsgShutdown.h"
 
 ////////////////////////////////////////////////////////////////////////////////////
-// This is the listener class for the send operation. We have to create this class 
+// This is the listener class for the send operation. We have to create this class
 // to listen for message send completion and eventually notify the caller
 ////////////////////////////////////////////////////////////////////////////////////
 class nsMsgSendLater;
 
 class SendOperationListener : public nsIMsgSendListener,
                               public nsIMsgCopyServiceListener
 {
 public:
@@ -78,30 +78,30 @@ public:
                                             nsIMsgIdentity *aIdentity);
   void NotifyListenersOnProgress(uint32_t aCurrentMessage,
                                  uint32_t aTotalMessage,
                                  uint32_t aSendPercent,
                                  uint32_t aCopyPercent);
   void NotifyListenersOnMessageSendError(uint32_t aCurrentMessage,
                                          nsresult aStatus,
                                          const char16_t *aMsg);
-  void EndSendMessages(nsresult aStatus, const char16_t *aMsg, 
+  void EndSendMessages(nsresult aStatus, const char16_t *aMsg,
                        uint32_t aTotalTried, uint32_t aSuccessful);
 
   bool OnSendStepFinished(nsresult aStatus);
   void OnCopyStepFinished(nsresult aStatus);
 
-  // counters and things for enumeration 
+  // counters and things for enumeration
   uint32_t                  mTotalSentSuccessfully;
   uint32_t                  mTotalSendCount;
   nsCOMArray<nsIMsgDBHdr> mMessagesToSend;
   nsCOMPtr<nsISimpleEnumerator> mEnumerator;
   nsCOMPtr<nsIMsgFolder>    mMessageFolder;
   nsCOMPtr<nsIMsgStatusFeedback> mFeedback;
- 
+
   // Private Information
 private:
   virtual ~nsMsgSendLater();
   nsresult GetIdentityFromKey(const char *aKey, nsIMsgIdentity **aIdentity);
   nsresult ReparseDBIfNeeded(nsIUrlListener *aListener);
   nsresult InternalSendMessages(bool aUserInitiated,
                                 nsIMsgIdentity *aIdentity);
 
--- a/mailnews/compose/src/nsMsgSendPart.cpp
+++ b/mailnews/compose/src/nsMsgSendPart.cpp
@@ -36,20 +36,20 @@ nsMsgSendPart::nsMsgSendPart(nsIMsgSend*
   m_partNum = "1";
   SetMimeDeliveryState(state);
 
   m_parent = nullptr;
   m_buffer = nullptr;
   m_type = nullptr;
   m_other = nullptr;
   m_strip_sensitive_headers = false;
-  
+
   m_firstBlock = false;
   m_needIntlConversion = false;
-  
+
   m_mainpart = false;
   m_just_hit_CR = false;
 }
 
 
 nsMsgSendPart::~nsMsgSendPart()
 {
   for (int i=0 ; i < m_numchildren; i++)
@@ -59,23 +59,23 @@ nsMsgSendPart::~nsMsgSendPart()
     PR_FREEIF(m_buffer);
   PR_FREEIF(m_other);
   PR_FREEIF(m_type);
 }
 
 nsresult nsMsgSendPart::CopyString(char** dest, const char* src)
 {
   NS_ASSERTION(src, "src null");
-  
+
   PR_FREEIF(*dest);
   if (!src)
     *dest = PL_strdup("");
   else
     *dest = PL_strdup(src);
-  
+
   return *dest? NS_OK : NS_ERROR_OUT_OF_MEMORY;
 }
 
 
 nsresult nsMsgSendPart::SetFile(nsIFile *file)
 {
   m_file = file;
   return NS_OK;
@@ -105,17 +105,17 @@ nsresult nsMsgSendPart::SetOtherHeaders(
 nsresult nsMsgSendPart::SetMimeDeliveryState(nsIMsgSend *state)
 {
   m_state = state;
   if (GetNumChildren() > 0)
   {
     for (int i = 0; i < GetNumChildren(); i++)
     {
       nsMsgSendPart *part = GetChild(i);
-      if (part) 
+      if (part)
         part->SetMimeDeliveryState(state);
     }
   }
   return NS_OK;
 }
 
 nsresult nsMsgSendPart::AppendOtherHeaders(const char* more)
 {
@@ -161,51 +161,51 @@ nsresult nsMsgSendPart::AddChild(nsMsgSe
   partNum.AppendInt(m_numchildren);
   child->m_partNum = partNum;
   return NS_OK;
 }
 
 nsMsgSendPart * nsMsgSendPart::DetachChild(int32_t whichOne)
 {
   nsMsgSendPart *returnValue = nullptr;
-  
+
   NS_ASSERTION(whichOne >= 0 && whichOne < m_numchildren, "parameter out of range");
-  if (whichOne >= 0 && whichOne < m_numchildren) 
+  if (whichOne >= 0 && whichOne < m_numchildren)
   {
     returnValue = m_children[whichOne];
-    
+
     if (m_numchildren > 1)
     {
       nsMsgSendPart** tmp = new nsMsgSendPart* [m_numchildren-1];
-      if (tmp != nullptr) 
+      if (tmp != nullptr)
       {
         // move all the other kids over
-        for (int i=0 ; i<m_numchildren-1 ; i++) 
+        for (int i=0 ; i<m_numchildren-1 ; i++)
         {
           if (i >= whichOne)
             tmp[i] = m_children[i+1];
           else
             tmp[i] = m_children[i];
         }
         delete [] m_children;
         m_children = tmp;
         m_numchildren--;
       }
     }
-    else 
+    else
     {
       delete [] m_children;
       m_children = nullptr;
       m_numchildren = 0;
     }
   }
-  
+
   if (returnValue)
     returnValue->m_parent = nullptr;
-  
+
   return returnValue;
 }
 
 nsMsgSendPart* nsMsgSendPart::GetChild(int32_t which)
 {
   NS_ASSERTION(which >= 0 && which < m_numchildren, "parameter out of range");
   if (which >= 0 && which < m_numchildren) {
     return m_children[which];
@@ -248,57 +248,57 @@ nsresult nsMsgSendPart::PushBody(const c
           // we want to ignore it.
           continue;
         }
       }
       if (*in == '\r' || *in == '\n') {
         /* Write out the newline. */
         *out++ = '\r';
         *out++ = '\n';
-        
+
         status = mime_write_message_body(m_state, buffer,
           out - buffer);
         if (NS_FAILED(status)) return status;
         out = buffer;
-        
+
         if (*in == '\r') {
           m_just_hit_CR = true;
         }
-        
+
         out = buffer;
       } else {
-        
+
       /*  Fix for bug #95985. We can't assume that all lines are shorter
       than 4096 chars (MIME_BUFFER_SIZE), so we need to test
       for this here. sfraser.
         */
         if (out - buffer >= MIME_BUFFER_SIZE)
         {
           status = mime_write_message_body(m_state, buffer, out - buffer);
           if (NS_FAILED(status)) return status;
-          
+
           out = buffer;
         }
-        
+
         *out++ = *in;
       }
     }
-    
+
     /* Flush the last line. */
     if (out > buffer) {
       status = mime_write_message_body(m_state, buffer, out - buffer);
       if (NS_FAILED(status)) return status;
       out = buffer;
     }
   }
-  
+
   if (encoded_data && encoded_data != buffer) {
     PR_Free((char *) encoded_data);
   }
-  
+
   return status;
 }
 
 
 /* Partition the headers into those which apply to the message as a whole;
 those which apply to the message's contents; and the Content-Type header
 itself.  (This relies on the fact that all body-related headers begin with
 "Content-".)
@@ -311,42 +311,42 @@ divide_content_headers(const char *heade
                         char **content_headers,
                         char **content_type_header)
 {
     const char *tail;
     char *message_tail, *content_tail, *type_tail;
     int L = 0;
     if (headers)
       L = PL_strlen(headers);
-    
+
     if (L == 0)
       return NS_OK;
-    
+
     *message_headers = (char *)PR_Malloc(L+1);
     if (!*message_headers)
       return NS_ERROR_OUT_OF_MEMORY;
-    
+
     *content_headers = (char *)PR_Malloc(L+1);
     if (!*content_headers) {
       PR_Free(*message_headers);
       return NS_ERROR_OUT_OF_MEMORY;
     }
-    
+
     *content_type_header = (char *)PR_Malloc(L+1);
     if (!*content_type_header) {
       PR_Free(*message_headers);
       PR_Free(*content_headers);
       return NS_ERROR_OUT_OF_MEMORY;
     }
-    
+
     message_tail = *message_headers;
     content_tail = *content_headers;
     type_tail    = *content_type_header;
     tail = headers;
-    
+
     while (*tail)
     {
       const char *head = tail;
       char **out;
       while(true) {
       /* Loop until we reach a newline that is not followed by whitespace.
         */
         if (tail[0] == 0 ||
@@ -357,74 +357,74 @@ divide_content_headers(const char *heade
           if (tail[0] == '\r' && tail[1] == '\n')
             tail++;
           if (*tail)
             tail++;
           break;
         }
         tail++;
       }
-      
+
       /* Decide which block this header goes into.
       */
       if (!PL_strncasecmp(head, "Content-Type:", 13))
         out = &type_tail;
       else
         if (!PL_strncasecmp(head, "Content-", 8))
           out = &content_tail;
         else
           out = &message_tail;
 
       memcpy(*out, head, (tail-head));
       *out += (tail-head);
     }
-    
+
     *message_tail = 0;
     *content_tail = 0;
     *type_tail = 0;
-    
+
     if (!**message_headers) {
       PR_Free(*message_headers);
       *message_headers = 0;
     }
-    
+
     if (!**content_headers) {
       PR_Free(*content_headers);
       *content_headers = 0;
     }
-    
+
     if (!**content_type_header) {
       PR_Free(*content_type_header);
       *content_type_header = 0;
     }
-    
+
 #ifdef DEBUG
     // ### mwelch Because of the extreme difficulty we've had with
     //      duplicate part headers, I'm going to put in an
     //      ASSERT here which makes sure that no duplicate
     //      Content-Type or Content-Transfer-Encoding headers
     //      leave here undetected.
     const char* tmp;
     if (*content_type_header) {
       tmp = PL_strstr(*content_type_header, "Content-Type");
       if (tmp) {
         tmp++; // get past the first occurrence
         NS_ASSERTION(!PL_strstr(tmp, "Content-Type"), "Content-part already present");
       }
     }
-    
+
     if (*content_headers) {
       tmp = PL_strstr(*content_headers, "Content-Transfer-Encoding");
       if (tmp) {
         tmp++; // get past the first occurrence
         NS_ASSERTION(!PL_strstr(tmp, "Content-Transfer-Encoding"), "Content-Transfert already present");
       }
     }
 #endif // DEBUG
-    
+
     return NS_OK;
 }
 
 #define     SKIP_EMPTY_PART   1966
 
 nsresult
 nsMsgSendPart::Write()
 {
@@ -444,108 +444,108 @@ nsMsgSendPart::Write()
   if ( (m_parent) &&
        (m_numchildren == 0) &&
        ( (!m_buffer) || (!*m_buffer) ) &&
        (!m_file) &&
        (!m_mainpart) )
     // XXX SKIP_EMPTY_PART (= 1966) is not a valid nsresult
     return static_cast<nsresult>(SKIP_EMPTY_PART);
 
-  if (m_mainpart && m_type && PL_strcmp(m_type, TEXT_HTML) == 0) 
-  {     
-    if (m_file) 
+  if (m_mainpart && m_type && PL_strcmp(m_type, TEXT_HTML) == 0)
+  {
+    if (m_file)
     {
       // The "insert HTML links" code requires a memory buffer,
       // so read the file into memory.
       NS_ASSERTION(m_buffer == nullptr, "not-null buffer");
       int32_t           length = 0;
       int64_t fileSize;
       if (NS_SUCCEEDED(m_file->GetFileSize(&fileSize)))
           length = fileSize;
-      
+
       m_buffer = (char *) PR_Malloc(sizeof(char) * (length + 1));
-      if (m_buffer) 
+      if (m_buffer)
       {
         nsCOMPtr<nsIInputStream> inputFile;
         nsresult rv = NS_NewLocalFileInputStream(getter_AddRefs(inputFile), m_file);
-        if (NS_SUCCEEDED(rv)) 
+        if (NS_SUCCEEDED(rv))
         {
           uint32_t bytesRead;
           rv = inputFile->Read(m_buffer, length, &bytesRead);
           inputFile->Close();
           m_buffer[length] = '\0';
         }
-        else 
+        else
           PR_Free(m_buffer);
       }
     }
   }
-  
+
   if (m_parent && m_parent->m_type &&
         !PL_strcasecmp(m_parent->m_type, MULTIPART_DIGEST) &&
         m_type &&
         (!PL_strcasecmp(m_type, MESSAGE_RFC822) ||
-        !PL_strcasecmp(m_type, MESSAGE_NEWS))) 
+        !PL_strcasecmp(m_type, MESSAGE_NEWS)))
   {
     // If we're in a multipart/digest, and this document is of type
     // message/rfc822, then it's appropriate to emit no headers.
     //
   }
-  else 
+  else
   {
     char *message_headers = 0;
     char *content_headers = 0;
     char *content_type_header = 0;
     status = divide_content_headers(m_other,
                                     &message_headers,
                                     &content_headers,
                                     &content_type_header);
     if (NS_FAILED(status))
       goto FAIL;
-    
+
       /* First, write out all of the headers that refer to the message
       itself (From, Subject, MIME-Version, etc.)
     */
-    if (message_headers) 
+    if (message_headers)
     {
       PUSH(message_headers);
       PR_Free(message_headers);
       message_headers = 0;
     }
 
     /* Now allow the crypto library to (potentially) insert some text
        (it may want to wrap the body in an envelope.)           */
     if (!m_parent) {
       status = m_state->BeginCryptoEncapsulation();
       if (NS_FAILED(status)) goto FAIL;
     }
-          
+
     /* Now make sure there's a Content-Type header.
     */
-    if (!content_type_header) 
+    if (!content_type_header)
     {
       NS_ASSERTION(m_type && *m_type, "null ptr");
       bool needsCharset = mime_type_needs_charset(m_type ? m_type : TEXT_PLAIN);
-      if (needsCharset) 
+      if (needsCharset)
       {
         content_type_header = PR_smprintf("Content-Type: %s; charset=%s" CRLF,
                                           (m_type ? m_type : TEXT_PLAIN), m_charset_name);
       }
       else
         content_type_header = PR_smprintf("Content-Type: %s" CRLF,
                                           (m_type ? m_type : TEXT_PLAIN));
-      if (!content_type_header) 
+      if (!content_type_header)
       {
         if (content_headers)
           PR_Free(content_headers);
         status = NS_ERROR_OUT_OF_MEMORY;
         goto FAIL;
       }
     }
-    
+
     /* If this is a compound object, tack a boundary string onto the
     Content-Type header. this
     */
     if (m_numchildren > 0)
     {
       int L;
       char *ct2;
       NS_ASSERTION(m_type, "null ptr");
@@ -556,65 +556,65 @@ nsMsgSendPart::Write()
         if (!separator)
         {
           status = NS_ERROR_OUT_OF_MEMORY;
           goto FAIL;
         }
       }
 
       L = PL_strlen(content_type_header);
-      
+
       if (content_type_header[L-1] == '\n')
         content_type_header[--L] = 0;
       if (content_type_header[L-1] == '\r')
         content_type_header[--L] = 0;
-      
+
       ct2 = PR_smprintf("%s;\r\n boundary=\"%s\"" CRLF, content_type_header, separator);
       PR_Free(content_type_header);
-      if (!ct2) 
+      if (!ct2)
       {
         if (content_headers)
           PR_Free(content_headers);
         status = NS_ERROR_OUT_OF_MEMORY;
         goto FAIL;
       }
-      
+
       content_type_header = ct2;
     }
-    
+
     // Now write out the Content-Type header...
     NS_ASSERTION(content_type_header && *content_type_header, "null ptr");
     PUSH(content_type_header);
     PR_Free(content_type_header);
     content_type_header = 0;
-    
+
     /* ...followed by all of the other headers that refer to the body of
     the message (Content-Transfer-Encoding, Content-Dispositon, etc.)
     */
-    if (content_headers) 
+    if (content_headers)
     {
       PUSH(content_headers);
       PR_Free(content_headers);
       content_headers = 0;
     }
   }
 
   PUSH(CRLF);         // A blank line, to mark the end of headers.
 
   m_firstBlock = true;
   /* only convert if we need to tag charset */
   m_needIntlConversion = mime_type_needs_charset(m_type);
-  
-  if (m_buffer) 
+
+  if (m_buffer)
   {
     status = PushBody(m_buffer, PL_strlen(m_buffer));
     if (NS_FAILED(status))
       goto FAIL;
   }
-  else if (m_file) 
+  else if (m_file)
   {
     nsCOMPtr<nsIInputStream> inputStream;
     nsresult rv = NS_NewLocalFileInputStream(getter_AddRefs(inputStream), m_file);
     if (NS_FAILED(rv))
     {
       // mysteriously disappearing?
       nsCOMPtr<nsIMsgSendReport> sendReport;
       m_state->GetSendReport(getter_AddRefs(sendReport));
@@ -627,28 +627,28 @@ nsMsgSendPart::Write()
       status = NS_MSG_UNABLE_TO_OPEN_TMP_FILE;
       goto FAIL;
     }
 
     nsCString curLine;
     bool more = true;
 
     /* Kludge to avoid having to allocate memory on the toy computers... */
-    if (!mime_mailto_stream_read_buffer) 
+    if (!mime_mailto_stream_read_buffer)
     {
       mime_mailto_stream_read_buffer = (char *) PR_Malloc(MIME_BUFFER_SIZE);
-      if (!mime_mailto_stream_read_buffer) 
+      if (!mime_mailto_stream_read_buffer)
       {
         status = NS_ERROR_OUT_OF_MEMORY;
         goto FAIL;
       }
     }
 
     char    *buffer = mime_mailto_stream_read_buffer;
-    if (m_strip_sensitive_headers) 
+    if (m_strip_sensitive_headers)
     {
       // We are attaching a message, so we should be careful to
       // strip out certain sensitive internal header fields.
       bool skipping = false;
       nsAutoPtr<nsLineBuffer<char> > lineBuffer(new nsLineBuffer<char>);
       NS_ENSURE_TRUE(lineBuffer, NS_ERROR_OUT_OF_MEMORY);
 
       while (more)
@@ -660,52 +660,52 @@ nsMsgSendPart::Write()
 
         char *line = (char *) curLine.get();
         if (skipping) {
           if (*line == ' ' || *line == '\t')
             continue;
           else
             skipping = false;
         }
-                
+
         if (!PL_strncasecmp(line, "From -", 6) ||
             !PL_strncasecmp(line, "BCC:", 4) ||
             !PL_strncasecmp(line, "FCC:", 4) ||
             !PL_strncasecmp(line, CONTENT_LENGTH ":", CONTENT_LENGTH_LEN+1) ||
             !PL_strncasecmp(line, "Lines:", 6) ||
             !PL_strncasecmp(line, "Status:", 7) ||
             !PL_strncasecmp(line, X_MOZILLA_STATUS ":", X_MOZILLA_STATUS_LEN+1) ||
             !PL_strncasecmp(line, X_MOZILLA_STATUS2 ":", X_MOZILLA_STATUS2_LEN+1) ||
             !PL_strncasecmp(line, X_MOZILLA_DRAFT_INFO ":", X_MOZILLA_DRAFT_INFO_LEN+1) ||
             !PL_strncasecmp(line, X_MOZILLA_NEWSHOST ":", X_MOZILLA_NEWSHOST_LEN+1) ||
             !PL_strncasecmp(line, X_UIDL ":", X_UIDL_LEN+1) ||
             !PL_strncasecmp(line, "X-VM-", 5)) /* hi Kyle */
         {
           skipping = true;
           continue;
         }
-        
+
         PUSH(line);
-        
+
         if (curLine.Length() == 2) {
           nsCOMPtr <nsISeekableStream> seekableStream = do_QueryInterface(inputStream);
           // seek back the amount of data left in the line buffer...
           seekableStream->Seek(nsISeekableStream::NS_SEEK_CUR, lineBuffer->start - lineBuffer->end);
           break;  // Now can do normal reads for the body.
         }
       }
       lineBuffer = nullptr;
     }
 
     while (NS_SUCCEEDED(status))
     {
       uint32_t bytesRead;
       nsresult rv = inputStream->Read(buffer, MIME_BUFFER_SIZE, &bytesRead);
       if (NS_FAILED(rv))
-      {  
+      {
         nsCOMPtr<nsIMsgSendReport> sendReport;
         m_state->GetSendReport(getter_AddRefs(sendReport));
         if (sendReport)
         {
           nsAutoString error_msg;
           nsMsgBuildMessageWithFile(m_file, error_msg);
           sendReport->SetMessage(nsIMsgSendReport::process_Current, error_msg.get(), false);
           status = NS_MSG_UNABLE_TO_OPEN_FILE;
@@ -729,24 +729,24 @@ nsMsgSendPart::Write()
     {
       // XXX -1 is not a valid nsresult
       status = static_cast<nsresult>(-1);
       goto FAIL;
     }
   }
 
   //
-  // Ok, from here we loop and drive the the output of all children 
+  // Ok, from here we loop and drive the the output of all children
   // for this message.
   //
-  if (m_numchildren > 0) 
+  if (m_numchildren > 0)
   {
     bool    writeSeparator = true;
 
-    for (int i = 0 ; i < m_numchildren ; i ++) 
+    for (int i = 0 ; i < m_numchildren ; i ++)
     {
       if (writeSeparator)
       {
         PUSH(CRLF);
         PUSH("--");
 
         PUSH(separator);
         PUSH(CRLF);
--- a/mailnews/compose/src/nsMsgSendPart.h
+++ b/mailnews/compose/src/nsMsgSendPart.h
@@ -31,17 +31,17 @@ public:
     virtual nsresult    SetFile(nsIFile *filename);
     const nsIFile  *GetFile() {return m_file;}
 
     virtual nsresult  SetBuffer(const char* buffer);
     const char        *GetBuffer() {return m_buffer;}
 
     virtual nsresult  SetType(const char* type);
     const char        *GetType() {return m_type;}
-    
+
     const char        *GetCharsetName() {return m_charset_name;}
 
     virtual nsresult  SetOtherHeaders(const char* other);
     const char        *SetOtherHeaders() {return m_other;}
 	  virtual nsresult  AppendOtherHeaders(const char* moreother);
 
 	  virtual nsresult  SetMimeDeliveryState(nsIMsgSend* state);
 
@@ -60,17 +60,17 @@ public:
 
   virtual nsresult    AddChild(nsMsgSendPart* child);
 
 	int32_t             GetNumChildren() {return m_numchildren;}
 	nsMsgSendPart       *GetChild(int32_t which);
 	nsMsgSendPart       *DetachChild(int32_t which);
 
 	virtual nsresult    SetMainPart(bool value);
-	bool                IsMainPart() 
+	bool                IsMainPart()
                       {
                         return m_mainpart;
                       }
   nsCString           m_partNum;
 protected:
 	nsresult            CopyString(char** dest, const char* src);
 	nsresult            PushBody(const char* buffer, int32_t length);
 
--- a/mailnews/compose/src/nsMsgSendReport.cpp
+++ b/mailnews/compose/src/nsMsgSendReport.cpp
@@ -79,17 +79,17 @@ NS_IMETHODIMP nsMsgProcessReport::Reset(
 NS_IMPL_ISUPPORTS(nsMsgSendReport, nsIMsgSendReport)
 
 nsMsgSendReport::nsMsgSendReport()
 {
   uint32_t i;
   for (i = 0; i <= SEND_LAST_PROCESS; i ++)
     mProcessReport[i] = new nsMsgProcessReport();
 
-  Reset(); 
+  Reset();
 }
 
 nsMsgSendReport::~nsMsgSendReport()
 {
   uint32_t i;
   for (i = 0; i <= SEND_LAST_PROCESS; i ++)
     mProcessReport[i] = nullptr;
 }
@@ -254,17 +254,17 @@ NS_IMETHODIMP nsMsgSendReport::DisplayRe
     mozilla::services::GetStringBundleService();
   NS_ENSURE_TRUE(bundleService, NS_ERROR_UNEXPECTED);
   nsCOMPtr<nsIStringBundle> bundle;
   rv = bundleService->CreateBundle("chrome://messenger/locale/messengercompose/composeMsgs.properties", getter_AddRefs(bundle));
   if (NS_FAILED(rv))
   {
     //TODO need to display a generic hardcoded message
     mAlreadyDisplayReport = true;
-    return NS_OK;  
+    return NS_OK;
   }
 
   nsString dialogTitle;
   nsString dialogMessage;
 
   if (NS_SUCCEEDED(currError))
   {
     //TODO display a success error message
--- a/mailnews/compose/src/nsSmtpProtocol.h
+++ b/mailnews/compose/src/nsSmtpProtocol.h
@@ -51,17 +51,17 @@ SMTP_AUTH_PROCESS_STATE,                
 SMTP_AUTH_CRAM_MD5_CHALLENGE_RESPONSE,              // 22
 SMTP_SEND_AUTH_GSSAPI_FIRST,                        // 23
 SMTP_SEND_AUTH_GSSAPI_STEP,                         // 24
 SMTP_SUSPENDED,                                     // 25
 SMTP_AUTH_OAUTH2_STEP,                              // 26
 SMTP_AUTH_OAUTH2_RESPONSE,                          // 27
 } SmtpState;
 
-// State Flags (Note, I use the word state in terms of storing 
+// State Flags (Note, I use the word state in terms of storing
 // state information about the connection (authentication, have we sent
 // commands, etc. I do not intend it to refer to protocol state)
 #define SMTP_PAUSE_FOR_READ             0x00000001  /* should we pause for the next read */
 #define SMTP_ESMTP_SERVER               0x00000002
 #define SMTP_EHLO_DSN_ENABLED           0x00000004
 #define SMTP_EHLO_STARTTLS_ENABLED      0x00000008
 #define SMTP_EHLO_SIZE_ENABLED          0x00000010
 #define SMTP_EHLO_8BIT_ENABLED          0x00000020
@@ -95,20 +95,20 @@ public:
 
     // Creating a protocol instance requires the URL which needs to be run.
     nsSmtpProtocol(nsIURI * aURL);
 
     virtual nsresult LoadUrl(nsIURI * aURL, nsISupports * aConsumer = nullptr) override;
     virtual nsresult SendData(const char * dataBuffer, bool aSuppressLogging = false) override;
 
     ////////////////////////////////////////////////////////////////////////////////////////
-    // we suppport the nsIStreamListener interface 
+    // we suppport the nsIStreamListener interface
     ////////////////////////////////////////////////////////////////////////////////////////
 
-    // stop binding is a "notification" informing us that the stream associated with aURL is going away. 
+    // stop binding is a "notification" informing us that the stream associated with aURL is going away.
     NS_IMETHOD OnStopRequest(nsIRequest *request, nsISupports *ctxt, nsresult status) override;
 
 private:
     virtual ~nsSmtpProtocol();
     // if we are asked to load a url while we are blocked waiting for redirection information,
     // then we'll store the url consumer in mPendingConsumer until we can actually load
     // the url.
     nsCOMPtr<nsISupports> mPendingConsumer;
@@ -116,21 +116,21 @@ private:
     // the nsISmtpURL that is currently running
     nsCOMPtr<nsISmtpUrl> m_runningURL;
 
     // the error state we want to set on the url
     nsresult m_urlErrorState;
     nsCOMPtr<nsIMsgStatusFeedback> m_statusFeedback;
 
     // Generic state information -- What state are we in? What state do we want to go to
-    // after the next response? What was the last response code? etc. 
+    // after the next response? What was the last response code? etc.
     SmtpState m_nextState;
     SmtpState m_nextStateAfterResponse;
     int32_t m_responseCode;    /* code returned from Smtp server */
-    int32_t m_previousResponseCode; 
+    int32_t m_previousResponseCode;
     int32_t m_continuationResponse;
     nsCString m_responseText;   /* text returned from Smtp server */
     nsMsgLineStreamBuffer *m_lineStreamBuffer; // used to efficiently extract lines from the incoming data stream
 
     nsTArray<nsCString> m_addresses;
     uint32_t       m_addressesLeft;
     nsCString m_mailAddr;
     nsCString m_helloArgument;
@@ -153,33 +153,33 @@ private:
     uint32_t m_dataBufSize;
 
     int32_t   m_originalContentLength; /* the content length at the time of calling graph progress */
 
     // initialization function given a new url and transport layer
     nsresult Initialize(nsIURI * aURL);
     nsresult InitializeInternal(nsIProxyInfo* proxyInfo);
     nsresult LoadUrlInternal(nsIURI *aURL, nsISupports *aConsumer);
-    virtual nsresult ProcessProtocolState(nsIURI * url, nsIInputStream * inputStream, 
+    virtual nsresult ProcessProtocolState(nsIURI * url, nsIInputStream * inputStream,
                                           uint64_t sourceOffset, uint32_t length) override;
 
     ////////////////////////////////////////////////////////////////////////////////////////
     // Communication methods --> Reading and writing protocol
     ////////////////////////////////////////////////////////////////////////////////////////
 
     void UpdateStatus(const char* aStatusName);
     void UpdateStatusWithString(const char16_t * aStatusString);
 
     ////////////////////////////////////////////////////////////////////////////////////////
-    // Protocol Methods --> This protocol is state driven so each protocol method is 
-    //						designed to re-act to the current "state". I've attempted to 
-    //						group them together based on functionality. 
+    // Protocol Methods --> This protocol is state driven so each protocol method is
+    //						designed to re-act to the current "state". I've attempted to
+    //						group them together based on functionality.
     ////////////////////////////////////////////////////////////////////////////////////////
 
-    nsresult SmtpResponse(nsIInputStream * inputStream, uint32_t length); 
+    nsresult SmtpResponse(nsIInputStream * inputStream, uint32_t length);
     nsresult ExtensionLoginResponse(nsIInputStream * inputStream, uint32_t length);
     nsresult SendHeloResponse(nsIInputStream * inputStream, uint32_t length);
     nsresult SendEhloResponse(nsIInputStream * inputStream, uint32_t length);	
     nsresult SendQuit(SmtpState aNextStateAfterResponse = SMTP_DONE);
 
     nsresult AuthGSSAPIFirst();
     nsresult AuthGSSAPIStep();
     nsresult AuthLoginStep0();
@@ -202,18 +202,18 @@ private:
     // End of Protocol Methods
     ////////////////////////////////////////////////////////////////////////////////////////
 
     void SendMessageInFile();
 
     void AppendHelloArgument(nsACString& aResult);
     nsresult GetPassword(nsCString &aPassword);
     nsresult GetUsernamePassword(nsACString &aUsername, nsACString &aPassword);
-    nsresult PromptForPassword(nsISmtpServer *aSmtpServer, nsISmtpUrl *aSmtpUrl, 
-                               const char16_t **formatStrings, 
+    nsresult PromptForPassword(nsISmtpServer *aSmtpServer, nsISmtpUrl *aSmtpUrl,
+                               const char16_t **formatStrings,
                                nsACString &aPassword);
 
     void    InitPrefAuthMethods(int32_t authMethodPrefValue);
     nsresult ChooseAuthMethod();
     void    MarkAuthMethodAsFailed(int32_t failedAuthMethod);
     void    ResetAuthMethods();
 
     virtual const char* GetType() override {return "smtp";}
--- a/mailnews/compose/src/nsSmtpServer.h
+++ b/mailnews/compose/src/nsSmtpServer.h
@@ -12,26 +12,26 @@
 #include "nsIPrefBranch.h"
 #include "nsWeakReference.h"
 
 class nsSmtpServer : public nsISmtpServer,
                      public nsSupportsWeakReference
 {
 public:
     nsSmtpServer();
-    
+
     NS_DECL_ISUPPORTS
     NS_DECL_NSISMTPSERVER
 
 private:
     virtual ~nsSmtpServer();
     nsCString mKey;
     nsCOMPtr<nsIPrefBranch> mPrefBranch;
     nsCOMPtr<nsIPrefBranch> mDefPrefBranch;
-                                                                                                                                               
+
     nsresult getPrefs();
     void getIntPrefWithDefault(const char *prefName, int32_t *val,
                                int32_t defval);
     nsresult GetPasswordWithoutUI();
     nsCString GetServerURIInternal(const bool aIncludeUsername);
 
     nsCString m_password;
     bool m_logonFailed;
--- a/mailnews/compose/src/nsSmtpService.cpp
+++ b/mailnews/compose/src/nsSmtpService.cpp
@@ -48,17 +48,17 @@ typedef struct _findServerByHostnameEntr
 
 static NS_DEFINE_CID(kCSmtpUrlCID, NS_SMTPURL_CID);
 static NS_DEFINE_CID(kCMailtoUrlCID, NS_MAILTOURL_CID);
 
 // foward declarations...
 nsresult
 NS_MsgBuildSmtpUrl(nsIFile * aFilePath,
                    nsISmtpServer *aServer,
-                   const char* aRecipients, 
+                   const char* aRecipients,
                    nsIMsgIdentity * aSenderIdentity,
                    nsIUrlListener * aUrlListener,
                    nsIMsgStatusFeedback *aStatusFeedback,
                    nsIInterfaceRequestor* aNotificationCallbacks,
                    nsIURI ** aUrl,
                    bool aRequestDSN);
 
 nsresult NS_MsgLoadSmtpUrl(nsIURI * aUrl, nsISupports * aConsumer, nsIRequest ** aRequest);
@@ -73,20 +73,20 @@ nsSmtpService::~nsSmtpService()
     // save the SMTP servers to disk
 
 }
 
 NS_IMPL_ISUPPORTS(nsSmtpService, nsISmtpService, nsIProtocolHandler)
 
 
 NS_IMETHODIMP nsSmtpService::SendMailMessage(nsIFile * aFilePath,
-                                        const char * aRecipients, 
+                                        const char * aRecipients,
                                         nsIMsgIdentity * aSenderIdentity,
                                         const char * aPassword,
-                                        nsIUrlListener * aUrlListener, 
+                                        nsIUrlListener * aUrlListener,
                                         nsIMsgStatusFeedback *aStatusFeedback,
                                         nsIInterfaceRequestor* aNotificationCallbacks,
                                         bool aRequestDSN,
                                         nsIURI ** aURL,
                                         nsIRequest ** aRequest)
 {
   nsIURI * urlToRun = nullptr;
   nsresult rv = NS_OK;
@@ -96,17 +96,17 @@ NS_IMETHODIMP nsSmtpService::SendMailMes
 
   if (NS_SUCCEEDED(rv) && smtpServer)
   {
     if (aPassword && *aPassword)
       smtpServer->SetPassword(nsDependentCString(aPassword));
 
     // this ref counts urlToRun
     rv = NS_MsgBuildSmtpUrl(aFilePath, smtpServer, aRecipients, aSenderIdentity,
-                            aUrlListener, aStatusFeedback, 
+                            aUrlListener, aStatusFeedback,
                             aNotificationCallbacks, &urlToRun, aRequestDSN);
     if (NS_SUCCEEDED(rv) && urlToRun)	
       rv = NS_MsgLoadSmtpUrl(urlToRun, nullptr, 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);
@@ -116,19 +116,19 @@ NS_IMETHODIMP nsSmtpService::SendMailMes
 }
 
 
 // The following are two convience functions I'm using to help expedite building and running a mail to url...
 
 // short cut function for creating a mailto url...
 nsresult NS_MsgBuildSmtpUrl(nsIFile * aFilePath,
                             nsISmtpServer *aSmtpServer,
-                            const char * aRecipients, 
+                            const char * aRecipients,
                             nsIMsgIdentity * aSenderIdentity,
-                            nsIUrlListener * aUrlListener, 
+                            nsIUrlListener * aUrlListener,
                             nsIMsgStatusFeedback *aStatusFeedback,
                             nsIInterfaceRequestor* aNotificationCallbacks,
                             nsIURI ** aUrl,
                             bool aRequestDSN)
 {
   // mscott: this function is a convience hack until netlib actually dispatches
   // smtp urls. in addition until we have a session to get a password, host and
   // other stuff from, we need to use default values....
@@ -192,17 +192,17 @@ nsresult NS_MsgBuildSmtpUrl(nsIFile * aF
     NS_ENSURE_SUCCESS(rv, rv);
 
     if (!smtpPrompt)
       wwatch->GetNewPrompter(0, getter_AddRefs(smtpPrompt));
     if (!smtpAuthPrompt)
       wwatch->GetNewAuthPrompter(0, getter_AddRefs(smtpAuthPrompt));
   }
 
-  smtpUrl->SetPrompt(smtpPrompt);            
+  smtpUrl->SetPrompt(smtpPrompt);
   smtpUrl->SetAuthPrompt(smtpAuthPrompt);
 
   if (aUrlListener)
     url->RegisterListener(aUrlListener);
   if (aStatusFeedback)
     url->SetStatusFeedback(aStatusFeedback);
 
   return CallQueryInterface(smtpUrl, aUrl);
@@ -252,30 +252,30 @@ NS_IMETHODIMP nsSmtpService::VerifyLogon
       urlToRun.forget(aURL);
   }
   return rv;
 }
 
 NS_IMETHODIMP nsSmtpService::GetScheme(nsACString &aScheme)
 {
     aScheme = "mailto";
-    return NS_OK; 
+    return NS_OK;
 }
 
 NS_IMETHODIMP nsSmtpService::GetDefaultPort(int32_t *aDefaultPort)
 {
     nsresult rv = NS_OK;
     if (aDefaultPort)
         *aDefaultPort = nsISmtpUrl::DEFAULT_SMTP_PORT;
     else
         rv = NS_ERROR_NULL_POINTER;
     return rv;
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsSmtpService::AllowPort(int32_t port, const char *scheme, bool *_retval)
 {
     // allow smtp to run on any port
     *_retval = true;
     return NS_OK;
 }
 
 NS_IMETHODIMP nsSmtpService::GetProtocolFlags(uint32_t *result)
@@ -380,17 +380,17 @@ nsSmtpService::GetServers(nsISimpleEnume
   return NS_NewArrayEnumerator(aResult, mSmtpServers);
 }
 
 nsresult
 nsSmtpService::loadSmtpServers()
 {
   if (mSmtpServersLoaded)
     return NS_OK;
-    
+
   nsresult rv;
   nsCOMPtr<nsIPrefService> prefService(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
   if (NS_FAILED(rv))
     return rv;
   nsCOMPtr<nsIPrefBranch> prefRootBranch;
   prefService->GetBranch(nullptr, getter_AddRefs(prefRootBranch));
   if (NS_FAILED(rv))
     return rv;
@@ -461,50 +461,50 @@ nsSmtpService::loadSmtpServers()
 
 // save the list of keys
 nsresult
 nsSmtpService::saveKeyList()
 {
     nsresult rv;
     nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
     if (NS_FAILED(rv)) return rv;
-    
+
     return prefBranch->SetCharPref(PREF_MAIL_SMTPSERVERS, mServerKeyList.get());
 }
 
 nsresult
 nsSmtpService::createKeyedServer(const char *key, nsISmtpServer** aResult)
 {
     if (!key) return NS_ERROR_NULL_POINTER;
-    
+
     nsresult rv;
     nsCOMPtr<nsISmtpServer> server = do_CreateInstance(NS_SMTPSERVER_CONTRACTID, &rv);
     if (NS_FAILED(rv)) return rv;
-    
+
     server->SetKey(key);
     mSmtpServers.AppendObject(server);
 
     if (mServerKeyList.IsEmpty())
         mServerKeyList = key;
     else {
         mServerKeyList.Append(',');
         mServerKeyList += key;
     }
 
-    if (aResult) 
+    if (aResult)
        server.forget(aResult);
-    
+
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSmtpService::GetSessionDefaultServer(nsISmtpServer **aServer)
 {
     NS_ENSURE_ARG_POINTER(aServer);
-    
+
     if (!mSessionDefaultServer)
         return GetDefaultServer(aServer);
 
     NS_ADDREF(*aServer = mSessionDefaultServer);
     return NS_OK;
 }
 
 NS_IMETHODIMP
@@ -515,17 +515,17 @@ nsSmtpService::SetSessionDefaultServer(n
 }
 
 NS_IMETHODIMP
 nsSmtpService::GetDefaultServer(nsISmtpServer **aServer)
 {
   NS_ENSURE_ARG_POINTER(aServer);
 
   loadSmtpServers();
-  
+
   *aServer = nullptr;
   // always returns NS_OK, just leaving *aServer at nullptr
   if (!mDefaultSmtpServer) {
       nsresult rv;
       nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
       if (NS_FAILED(rv)) return rv;
 
       // try to get it from the prefs
@@ -546,67 +546,67 @@ nsSmtpService::GetDefaultServer(nsISmtpS
         // nothing in the array, we had better create a new server
         // (which will add it to the array & prefs anyway)
         if (mSmtpServers.Count() == 0)
           // if there are no smtp servers then don't create one for the default.
           return NS_OK;
 
         mDefaultSmtpServer = mSmtpServers[0];
         NS_ENSURE_TRUE(mDefaultSmtpServer, NS_ERROR_NULL_POINTER);
-          
+
         // now we have a default server, set the prefs correctly
         nsCString serverKey;
         mDefaultSmtpServer->GetKey(getter_Copies(serverKey));
         if (NS_SUCCEEDED(rv))
           prefBranch->SetCharPref(PREF_MAIL_SMTP_DEFAULTSERVER, serverKey.get());
       }
   }
 
   // at this point:
   // * mDefaultSmtpServer has a valid server
   // * the key has been set in the prefs
-    
+
   NS_IF_ADDREF(*aServer = mDefaultSmtpServer);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSmtpService::SetDefaultServer(nsISmtpServer *aServer)
 {
     NS_ENSURE_ARG_POINTER(aServer);
 
     mDefaultSmtpServer = aServer;
 
     nsCString serverKey;
     nsresult rv = aServer->GetKey(getter_Copies(serverKey));
     NS_ENSURE_SUCCESS(rv,rv);
-    
+
     nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
     NS_ENSURE_SUCCESS(rv,rv);
     prefBranch->SetCharPref(PREF_MAIL_SMTP_DEFAULTSERVER, serverKey.get());
     return NS_OK;
 }
 
 bool
 nsSmtpService::findServerByKey(nsISmtpServer *aServer, void *aData)
 {
   findServerByKeyEntry *entry = (findServerByKeyEntry*) aData;
 
   nsCString key;
   nsresult rv = aServer->GetKey(getter_Copies(key));
   if (NS_FAILED(rv))
     return true;
 
-  if (key.Equals(entry->key)) 
+  if (key.Equals(entry->key))
   {
     entry->server = aServer;
     return false;
   }
-    
+
   return true;
 }
 
 NS_IMETHODIMP
 nsSmtpService::CreateServer(nsISmtpServer **aResult)
 {
     if (!aResult) return NS_ERROR_NULL_POINTER;
 
@@ -667,24 +667,24 @@ nsSmtpService::DeleteServer(nsISmtpServe
     if (!aServer) return NS_OK;
 
     int32_t idx = mSmtpServers.IndexOf(aServer);
     if (idx == -1)
       return NS_OK;
 
     nsCString serverKey;
     aServer->GetKey(getter_Copies(serverKey));
-    
+
     mSmtpServers.RemoveObjectAt(idx);
 
     if (mDefaultSmtpServer.get() == aServer)
         mDefaultSmtpServer = nullptr;
     if (mSessionDefaultServer.get() == aServer)
         mSessionDefaultServer = nullptr;
-    
+
     nsAutoCString newServerList;
     nsCString tmpStr = mServerKeyList;
     char *newStr = tmpStr.BeginWriting();
     char *token = NS_strtok(",", &newStr);
     while (token) {
       // only re-add the string if it's not the key
       if (strcmp(token, serverKey.get()) != 0) {
           if (newServerList.IsEmpty())
@@ -717,17 +717,17 @@ nsSmtpService::findServerByHostname(nsIS
 
   nsCString username;
   rv = aServer->GetUsername(username);
   if (NS_FAILED(rv))
     return true;
 
   bool checkHostname = !entry->hostname.IsEmpty();
   bool checkUsername = !entry->username.IsEmpty();
-    
+
   if ((!checkHostname ||
        (entry->hostname.Equals(hostname, nsCaseInsensitiveCStringComparator()))) &&
        (!checkUsername ||
         entry->username.Equals(username, nsCaseInsensitiveCStringComparator())))
   {
     entry->server = aServer;
     return false;        // stop when found
   }
@@ -746,29 +746,29 @@ nsSmtpService::FindServer(const char *aU
     entry.username = aUsername;
 
     for (nsISmtpServer* s : mSmtpServers)
       findServerByHostname(s, (void *)&entry);
 
     // entry.server may be null, but that's ok.
     // just return null if no server is found
     NS_IF_ADDREF(*aResult = entry.server);
-    
+
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSmtpService::GetServerByIdentity(nsIMsgIdentity *aSenderIdentity,
                                    nsISmtpServer **aSmtpServer)
 {
   NS_ENSURE_ARG_POINTER(aSmtpServer);
   nsresult rv = NS_ERROR_FAILURE;
 
   // First try the identity's preferred server
-  if (aSenderIdentity) 
+  if (aSenderIdentity)
   {
       nsCString smtpServerKey;
       rv = aSenderIdentity->GetSmtpServerKey(smtpServerKey);
       if (NS_SUCCEEDED(rv) && !(smtpServerKey.IsEmpty()))
           rv = GetServerByKey(smtpServerKey.get(), aSmtpServer);
   }
 
   // Fallback to the default
--- a/mailnews/compose/src/nsSmtpService.h
+++ b/mailnews/compose/src/nsSmtpService.h
@@ -24,38 +24,38 @@ class nsSmtpService : public nsISmtpServ
 {
 public:
 
 	nsSmtpService();
 	
 	NS_DECL_ISUPPORTS
 
 	////////////////////////////////////////////////////////////////////////
-	// we suppport the nsISmtpService interface 
-	////////////////////////////////////////////////////////////////////////    
+	// we suppport the nsISmtpService interface
+	////////////////////////////////////////////////////////////////////////
 	NS_DECL_NSISMTPSERVICE
 
 	//////////////////////////////////////////////////////////////////////////
-	// we suppport the nsIProtocolHandler interface 
+	// we suppport the nsIProtocolHandler interface
 	//////////////////////////////////////////////////////////////////////////
   NS_DECL_NSIPROTOCOLHANDLER
 
 protected:
     nsresult loadSmtpServers();
 
-    
+
 private:
 	virtual ~nsSmtpService();
     static bool findServerByKey(nsISmtpServer *aServer, void *aData);
     static bool findServerByHostname(nsISmtpServer *aServer, void *aData);
-    
+
     nsresult createKeyedServer(const char* key,
                                nsISmtpServer **aResult = nullptr);
     nsresult saveKeyList();
-    
+
     nsCOMArray<nsISmtpServer> mSmtpServers;
     nsCOMPtr<nsISmtpServer> mDefaultSmtpServer;
     nsCOMPtr<nsISmtpServer> mSessionDefaultServer;
 
     nsCString mServerKeyList;
 
     bool mSmtpServersLoaded;
 };
--- a/mailnews/compose/src/nsSmtpUrl.h
+++ b/mailnews/compose/src/nsSmtpUrl.h
@@ -35,17 +35,17 @@ protected:
   virtual ~nsMailtoUrl();
   nsresult ParseUrl();
   nsresult CleanupMailtoState();
   nsresult ParseMailtoUrl(char * searchPart);
   nsresult CloneInternal(RefHandlingEnum aRefHandlingMode,
                          const nsACString& newRef, nsIURI** _retval);
 
   nsCOMPtr<nsIURI> m_baseURL;
-    
+
   // data retrieved from parsing the url: (Note the url could be a post from file or it could be in the url)
   nsCString m_toPart;
   nsCString m_ccPart;
   nsCString m_subjectPart;
   nsCString m_newsgroupPart;
   nsCString m_newsHostPart;
   nsCString m_referencePart;
   nsCString m_bodyPart;
--- a/mailnews/compose/src/nsURLFetcher.cpp
+++ b/mailnews/compose/src/nsURLFetcher.cpp
@@ -34,17 +34,17 @@ NS_IMPL_ISUPPORTS(nsURLFetcher,
                    nsIStreamListener,
                    nsIRequestObserver,
                    nsIURIContentListener,
                    nsIInterfaceRequestor,
                    nsIWebProgressListener,
                    nsISupportsWeakReference)
 
 
-/* 
+/*
  * Inherited methods for nsMimeConverter
  */
 nsURLFetcher::nsURLFetcher()
 {
   // Init member variables...
   mTotalWritten = 0;
   mBuffer = nullptr;
   mBufferSize = 0;
@@ -54,67 +54,67 @@ nsURLFetcher::nsURLFetcher()
   mIsFile=false;
   nsURLFetcherStreamConsumer *consumer = new nsURLFetcherStreamConsumer(this);
   mConverter = do_QueryInterface(consumer);
 }
 
 nsURLFetcher::~nsURLFetcher()
 {
   mStillRunning = false;
-  
+
   PR_FREEIF(mBuffer);
   // Remove the DocShell as a listener of the old WebProgress...
-  if (mLoadCookie) 
+  if (mLoadCookie)
   {
     nsCOMPtr<nsIWebProgress> webProgress(do_QueryInterface(mLoadCookie));
 
     if (webProgress)
       webProgress->RemoveProgressListener(this);
   }
 }
 
 NS_IMETHODIMP nsURLFetcher::GetInterface(const nsIID & aIID, void * *aInstancePtr)
 {
    NS_ENSURE_ARG_POINTER(aInstancePtr);
    return QueryInterface(aIID, aInstancePtr);
 }
 
 // nsIURIContentListener support
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsURLFetcher::OnStartURIOpen(nsIURI* aURI, bool* aAbortOpen)
 {
    return NS_OK;
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsURLFetcher::IsPreferred(const char * aContentType,
                                 char ** aDesiredContentType,
                                 bool * aCanHandleContent)
 
 {
   return CanHandleContent(aContentType, true, aDesiredContentType,
                           aCanHandleContent);
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsURLFetcher::CanHandleContent(const char * aContentType,
                                 bool aIsContentPreferred,
                                 char ** aDesiredContentType,
                                 bool * aCanHandleContent)
 
 {
     if (!mIsFile && PL_strcasecmp(aContentType, MESSAGE_RFC822) == 0)
       *aDesiredContentType = strdup("text/html");
 
     // since we explicilty loaded the url, we always want to handle it!
     *aCanHandleContent = true;
   return NS_OK;
-} 
+}
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsURLFetcher::DoContent(const nsACString& aContentType,
                       bool aIsContentPreferred,
                       nsIRequest *request,
                       nsIStreamListener ** aContentHandler,
                       bool * aAbortProcess)
 {
   nsresult rv = NS_OK;
 
@@ -133,84 +133,84 @@ nsURLFetcher::DoContent(const nsACString
     rv = InsertConverter(PromiseFlatCString(aContentType).get());
     if (NS_SUCCEEDED(rv))
       mConverterContentType = PromiseFlatCString(aContentType).get();
   }
 
   return rv;
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsURLFetcher::GetParentContentListener(nsIURIContentListener** aParent)
 {
   *aParent = nullptr;
   return NS_OK;
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsURLFetcher::SetParentContentListener(nsIURIContentListener* aParent)
 {
   return NS_OK;
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsURLFetcher::GetLoadCookie(nsISupports ** aLoadCookie)
 {
   NS_IF_ADDREF(*aLoadCookie = mLoadCookie);
   return NS_OK;
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsURLFetcher::SetLoadCookie(nsISupports * aLoadCookie)
 {
   // Remove the DocShell as a listener of the old WebProgress...
-  if (mLoadCookie) 
+  if (mLoadCookie)
   {
     nsCOMPtr<nsIWebProgress> webProgress(do_QueryInterface(mLoadCookie));
 
     if (webProgress)
       webProgress->RemoveProgressListener(this);
   }
 
   mLoadCookie = aLoadCookie;
 
   // Add the DocShell as a listener to the new WebProgress...
-  if (mLoadCookie) 
+  if (mLoadCookie)
   {
     nsCOMPtr<nsIWebProgress> webProgress(do_QueryInterface(mLoadCookie));
 
-    if (webProgress) 
+    if (webProgress)
       webProgress->AddProgressListener(this, nsIWebProgress::NOTIFY_STATE_ALL);
   }
   return NS_OK;
 
 }
 
 nsresult
 nsURLFetcher::StillRunning(bool *running)
 {
   *running = mStillRunning;
   return NS_OK;
 }
 
 
 // Methods for nsIStreamListener...
 nsresult
-nsURLFetcher::OnDataAvailable(nsIRequest *request, nsISupports * ctxt, nsIInputStream *aIStream, 
+nsURLFetcher::OnDataAvailable(nsIRequest *request, nsISupports * ctxt, nsIInputStream *aIStream,
                               uint64_t sourceOffset, uint32_t aLength)
 {
   /* let our converter or consumer process the data */
   if (!mConverter)
     return NS_ERROR_FAILURE;
 
   return mConverter->OnDataAvailable(request, ctxt, aIStream, sourceOffset, aLength);
 }
 
 
-// Methods for nsIStreamObserver 
+// Methods for nsIStreamObserver
 nsresult
 nsURLFetcher::OnStartRequest(nsIRequest *request, nsISupports *ctxt)
 {
   /* check if the user has canceld the operation */
   if (mTagData)
   {
     nsCOMPtr<nsIMsgSend> sendPtr;
     mTagData->GetMimeDeliveryState(getter_AddRefs(sendPtr));
@@ -260,60 +260,60 @@ nsURLFetcher::OnStopRequest(nsIRequest *
   //
   mStillRunning = false;
 
   // time to close the output stream...
   if (mOutStream)
   {
     mOutStream->Close();
     mOutStream = nullptr;
-  
+
     /* In case of multipart/x-mixed-replace, we need to truncate the file to the current part size */
     if (MsgLowerCaseEqualsLiteral(mConverterContentType, MULTIPART_MIXED_REPLACE))
     {
       mLocalFile->SetFileSize(mTotalWritten);
     }
   }
 
   // Now if there is a callback, we need to call it...
   if (mCallback)
     mCallback (aStatus, mContentType, mCharset, mTotalWritten, nullptr, mTagData);
 
   // Time to return...
   return NS_OK;
 }
 
-nsresult 
-nsURLFetcher::Initialize(nsIFile *localFile, 
+nsresult
+nsURLFetcher::Initialize(nsIFile *localFile,
                          nsIOutputStream *outputStream,
-                         nsAttachSaveCompletionCallback cb, 
+                         nsAttachSaveCompletionCallback cb,
                          nsMsgAttachmentHandler *tagData)
 {
   if (!outputStream || !localFile)
     return NS_ERROR_INVALID_ARG;
 
   mOutStream = outputStream;
   mLocalFile = localFile;
   mCallback = cb;     //JFD: Please, no more callback, use a listener...
   mTagData = tagData;
   return NS_OK;
 }
 
 nsresult
-nsURLFetcher::FireURLRequest(nsIURI *aURL, nsIFile *localFile, nsIOutputStream *outputStream, 
+nsURLFetcher::FireURLRequest(nsIURI *aURL, nsIFile *localFile, nsIOutputStream *outputStream,
                              nsAttachSaveCompletionCallback cb, nsMsgAttachmentHandler *tagData)
 {
   nsresult rv;
 
   rv = Initialize(localFile, outputStream, cb, tagData);
   NS_ENSURE_SUCCESS(rv, rv);
 
   //check to see if aURL is a local file or not
   aURL->SchemeIs("file", &mIsFile);
-  
+
   // we're about to fire a new url request so make sure the on stop request flag is cleared...
   mOnStopRequestProcessed = false;
 
   // let's try uri dispatching...
   nsCOMPtr<nsIURILoader> pURILoader (do_GetService(NS_URI_LOADER_CONTRACTID));
   NS_ENSURE_TRUE(pURILoader, NS_ERROR_FAILURE);
 
   nsCOMPtr<nsIChannel> channel;
@@ -380,29 +380,29 @@ nsURLFetcher::OnLocationChange(nsIWebPro
                                nsIRequest* aRequest,
                                nsIURI *aURI,
                                uint32_t aFlags)
 {
   NS_NOTREACHED("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsURLFetcher::OnStatusChange(nsIWebProgress* aWebProgress,
                              nsIRequest* aRequest,
                              nsresult aStatus,
                              const char16_t* aMessage)
 {
   NS_NOTREACHED("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
-NS_IMETHODIMP 
-nsURLFetcher::OnSecurityChange(nsIWebProgress *aWebProgress, 
-                               nsIRequest *aRequest, 
+NS_IMETHODIMP
+nsURLFetcher::OnSecurityChange(nsIWebProgress *aWebProgress,
+                               nsIRequest *aRequest,
                                uint32_t state)
 {
   NS_NOTREACHED("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
 
 /**
--- a/mailnews/compose/src/nsURLFetcher.h
+++ b/mailnews/compose/src/nsURLFetcher.h
@@ -19,36 +19,36 @@
 #include "nsIWebProgressListener.h"
 #include "nsWeakReference.h"
 #include "nsString.h"
 
 class nsMsgAttachmentHandler;
 
 class nsURLFetcher : public nsIURLFetcher,
                      public nsIStreamListener,
-                     public nsIURIContentListener, 
+                     public nsIURIContentListener,
                      public nsIInterfaceRequestor,
                      public nsIWebProgressListener,
                      public nsSupportsWeakReference
-{ 
-public: 
+{
+public:
   nsURLFetcher();
 
   /* this macro defines QueryInterface, AddRef and Release for this class */
   NS_DECL_ISUPPORTS
 
   // Methods for nsIURLFetcher
   NS_DECL_NSIURLFETCHER
 
   // Methods for nsIStreamListener
   NS_DECL_NSISTREAMLISTENER
 
   // Methods for nsIRequestObserver
   NS_DECL_NSIREQUESTOBSERVER
-  
+
   // Methods for nsIURICOntentListener
   NS_DECL_NSIURICONTENTLISTENER
 
   // Methods for nsIInterfaceRequestor
   NS_DECL_NSIINTERFACEREQUESTOR
 
   // Methods for nsIWebProgressListener
   NS_DECL_NSIWEBPROGRESSLISTENER
@@ -70,17 +70,17 @@ private:
   nsCString                  mCharset;                 // The charset retrieved from the server
   RefPtr<nsMsgAttachmentHandler> mTagData;      // Tag data for callback...
   nsAttachSaveCompletionCallback  mCallback;      // Callback to call once the file is saved...
   nsCOMPtr<nsISupports>           mLoadCookie;    // load cookie used by the uri loader when we fetch the url
   bool                            mOnStopRequestProcessed; // used to prevent calling OnStopRequest multiple times
   bool                            mIsFile;        // This is used to check whether the URI is a local file.
 
   friend class nsURLFetcherStreamConsumer;
-}; 
+};
 
 
 /**
  * Stream consumer used for handling special content type like multipart/x-mixed-replace
  */
 
 class nsURLFetcherStreamConsumer : public nsIStreamListener
 {
@@ -90,12 +90,12 @@ public:
   /* additional members */
   NS_DECL_ISUPPORTS
   NS_DECL_NSISTREAMLISTENER
   NS_DECL_NSIREQUESTOBSERVER
 
 private:
   virtual ~nsURLFetcherStreamConsumer();
   nsURLFetcher* mURLFetcher;
-}; 
+};
 
 
 #endif /* nsURLFetcher_h_ */