Bug 1487572 - Rename mailServices.js to MailServices.jsm. r=mkmelin
authorGeoff Lankow <geoff@darktrojan.net>
Fri, 31 Aug 2018 12:43:20 +1200
changeset 32102 aa9abd3271f5776ebcd7b547ba0a78498239eaa0
parent 32101 909cf6e1db3fe2ee1bfc5f678f72627e283f8bd2
child 32103 547cb0b1d12be54b4b82ee223d3019b40b9b8109
push id2308
push userclokep@gmail.com
push dateWed, 05 Sep 2018 00:34:58 +0000
treeherdercomm-beta@e326b2dcd127 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin
bugs1487572
Bug 1487572 - Rename mailServices.js to MailServices.jsm. r=mkmelin
calendar/base/modules/utils/calEmailUtils.jsm
calendar/base/modules/utils/calItipUtils.jsm
calendar/base/modules/utils/calProviderUtils.jsm
calendar/itip/calItipEmailTransport.js
calendar/lightning/content/lightning-item-panel.js
calendar/lightning/content/lightning-utils.js
calendar/lightning/modules/ltnInvitationUtils.jsm
calendar/test/unit/test_ltninvitationutils.js
mail/base/content/ABSearchDialog.js
mail/base/content/FilterListDialog.js
mail/base/content/editContactPanel.js
mail/base/content/folderPane.js
mail/base/content/glodaFacetBindings.xml
mail/base/content/macMessengerMenu.js
mail/base/content/mail3PaneWindowCommands.js
mail/base/content/mailCommands.js
mail/base/content/mailContextMenus.js
mail/base/content/mailCore.js
mail/base/content/mailWidgets.xml
mail/base/content/mailWindow.js
mail/base/content/mailWindowOverlay.js
mail/base/content/msgHdrView.js
mail/base/content/msgMail3PaneWindow.js
mail/base/content/multimessageview.js
mail/base/content/newTagDialog.js
mail/base/modules/MailUtils.js
mail/base/modules/dbViewWrapper.js
mail/base/modules/displayNameUtils.js
mail/base/modules/mailInstrumentation.js
mail/base/modules/mailMigrator.js
mail/base/modules/quickFilterManager.js
mail/base/modules/searchSpec.js
mail/base/test/unit/head_mailbase.js
mail/base/test/unit/test_alertHook.js
mail/base/test/unit/test_viewWrapper_virtualFolderCustomTerm.js
mail/components/about-support/content/aboutSupport.js
mail/components/about-support/content/accounts.js
mail/components/accountcreation/content/createInBackend.js
mail/components/accountcreation/content/emailWizard.js
mail/components/accountcreation/content/fetchConfig.js
mail/components/accountcreation/content/verifyConfig.js
mail/components/activity/modules/alertHook.js
mail/components/activity/modules/moveCopy.js
mail/components/activity/modules/pop3Download.js
mail/components/addrbook/content/abCard.js
mail/components/addrbook/content/abCommon.js
mail/components/addrbook/content/abTrees.js
mail/components/addrbook/content/addressbook.js
mail/components/compose/content/MsgComposeCommands.js
mail/components/compose/content/addressingWidgetOverlay.js
mail/components/im/content/imAccountWizard.js
mail/components/im/content/imAccounts.js
mail/components/im/modules/chatHandler.jsm
mail/components/im/modules/index_im.js
mail/components/newmailaccount/content/accountProvisioner.js
mail/components/nsMailDefaultHandler.js
mail/components/preferences/preferences.js
mail/components/search/searchCommon.js
mail/components/test/unit/head_mailcomponents.js
mail/extensions/mailviews/content/msgViewPickerOverlay.js
mail/extensions/smime/content/msgCompSMIMEOverlay.js
mail/test/mozmill/account/test-mail-account-setup-wizard.js
mail/test/mozmill/addrbook/test-address-book.js
mail/test/mozmill/addrbook/test-update-mailing-list.js
mail/test/mozmill/cloudfile/test-cloudfile-attachment-urls.js
mail/test/mozmill/composition/test-attachment-reminder.js
mail/test/mozmill/composition/test-blocked-content.js
mail/test/mozmill/composition/test-charset-edit.js
mail/test/mozmill/composition/test-charset-upgrade.js
mail/test/mozmill/composition/test-draft-identity.js
mail/test/mozmill/composition/test-drafts.js
mail/test/mozmill/composition/test-eml-actions.js
mail/test/mozmill/composition/test-forward-rfc822-attach.js
mail/test/mozmill/composition/test-forward-utf8.js
mail/test/mozmill/composition/test-forwarded-eml-actions.js
mail/test/mozmill/composition/test-multipart-related.js
mail/test/mozmill/composition/test-newmsg-compose-identity.js
mail/test/mozmill/composition/test-reply-addresses.js
mail/test/mozmill/composition/test-reply-format-flowed.js
mail/test/mozmill/content-policy/test-general-content-policy.js
mail/test/mozmill/folder-display/test-message-commands-on-msgstore.js
mail/test/mozmill/folder-display/test-recent-menu.js
mail/test/mozmill/folder-pane/test-folder-pane-consumers.js
mail/test/mozmill/folder-pane/test-folder-pane.js
mail/test/mozmill/folder-tree-modes/test-extension/bootstrap.js
mail/test/mozmill/message-header/test-message-header.js
mail/test/mozmill/message-window/test-commands.js
mail/test/mozmill/multiple-identities/test-display-names.js
mail/test/mozmill/newmailaccount/test-newmailaccount.js
mail/test/mozmill/notification/test-notification.js
mail/test/mozmill/shared-modules/test-address-book-helpers.js
mail/test/mozmill/shared-modules/test-folder-display-helpers.js
mail/test/mozmill/shared-modules/test-newmailaccount-helpers.js
mail/test/mozmill/shared-modules/test-nntp-helpers.js
mailnews/addrbook/content/abAddressBookNameDialog.js
mailnews/addrbook/content/addrbookWidgets.xml
mailnews/addrbook/prefs/content/pref-directory-add.js
mailnews/addrbook/prefs/content/pref-editdirectories.js
mailnews/addrbook/src/nsAbAutoCompleteMyDomain.js
mailnews/addrbook/src/nsAbAutoCompleteSearch.js
mailnews/addrbook/src/nsAbLDAPAutoCompleteSearch.js
mailnews/addrbook/test/unit/head_addrbook.js
mailnews/base/content/folderWidgets.xml
mailnews/base/content/junkCommands.js
mailnews/base/content/virtualFolderProperties.js
mailnews/base/prefs/content/AccountManager.js
mailnews/base/prefs/content/AccountWizard.js
mailnews/base/prefs/content/SmtpServerEdit.js
mailnews/base/prefs/content/accountUtils.js
mailnews/base/prefs/content/am-identity-edit.js
mailnews/base/prefs/content/am-junk.js
mailnews/base/prefs/content/am-server-advanced.js
mailnews/base/prefs/content/am-smtp.js
mailnews/base/prefs/content/amUtils.js
mailnews/base/prefs/content/aw-done.js
mailnews/base/prefs/content/aw-outgoing.js
mailnews/base/prefs/content/removeAccount.js
mailnews/base/search/content/FilterEditor.js
mailnews/base/src/newMailNotificationService.js
mailnews/base/src/virtualFolderWrapper.js
mailnews/base/test/unit/head_mailbase.js
mailnews/base/test/unit/test_accountMgr.js
mailnews/base/test/unit/test_acctRepair.js
mailnews/base/test/unit/test_bccInDatabase.js
mailnews/base/test/unit/test_bug366491.js
mailnews/base/test/unit/test_bug404489.js
mailnews/base/test/unit/test_bug428427.js
mailnews/base/test/unit/test_bug465805.js
mailnews/base/test/unit/test_bug471682.js
mailnews/base/test/unit/test_compactColumnSave.js
mailnews/base/test/unit/test_copyChaining.js
mailnews/base/test/unit/test_copyThenMoveManual.js
mailnews/base/test/unit/test_copyToInvalidDB.js
mailnews/base/test/unit/test_detachToFile.js
mailnews/base/test/unit/test_emptyTrash.js
mailnews/base/test/unit/test_fix_deferred_accounts.js
mailnews/base/test/unit/test_folderCompact.js
mailnews/base/test/unit/test_folderLookupService.js
mailnews/base/test/unit/test_headerFoldingInDatabase.js
mailnews/base/test/unit/test_junkWhitelisting.js
mailnews/base/test/unit/test_junkingWhenDisabled.js
mailnews/base/test/unit/test_loadVirtualFolders.js
mailnews/base/test/unit/test_mailServices.js
mailnews/base/test/unit/test_mimemaltdetach.js
mailnews/base/test/unit/test_newMailNotification.js
mailnews/base/test/unit/test_nsIMsgFolder.js
mailnews/base/test/unit/test_nsIMsgFolderListener.js
mailnews/base/test/unit/test_nsIMsgTagService.js
mailnews/base/test/unit/test_nsMsgMailSession_Alerts.js
mailnews/base/test/unit/test_nsMsgMailSession_Listeners.js
mailnews/base/test/unit/test_quarantineFilterMove.js
mailnews/base/test/unit/test_search.js
mailnews/base/test/unit/test_searchAddressInAb.js
mailnews/base/test/unit/test_searchBody.js
mailnews/base/test/unit/test_searchBoolean.js
mailnews/base/test/unit/test_searchChaining.js
mailnews/base/test/unit/test_searchCustomTerm.js
mailnews/base/test/unit/test_searchJunk.js
mailnews/base/test/unit/test_searchTag.js
mailnews/base/test/unit/test_searchUint32HdrProperty.js
mailnews/base/test/unit/test_viewSortByAddresses.js
mailnews/base/util/MailServices.jsm
mailnews/base/util/folderUtils.jsm
mailnews/base/util/mailServices.js
mailnews/base/util/mailnewsMigrator.js
mailnews/base/util/mailstoreConverter.jsm
mailnews/base/util/moz.build
mailnews/base/util/msgDBCacheManager.js
mailnews/compose/test/unit/head_compose.js
mailnews/compose/test/unit/test_autoReply.js
mailnews/compose/test/unit/test_bug155172.js
mailnews/compose/test/unit/test_bug235432.js
mailnews/compose/test/unit/test_bug474774.js
mailnews/compose/test/unit/test_detectAttachmentCharset.js
mailnews/compose/test/unit/test_expandMailingLists.js
mailnews/compose/test/unit/test_longLines.js
mailnews/compose/test/unit/test_messageHeaders.js
mailnews/compose/test/unit/test_nsMsgCompose3.js
mailnews/compose/test/unit/test_sendBackground.js
mailnews/compose/test/unit/test_sendMailMessage.js
mailnews/compose/test/unit/test_sendMessageFile.js
mailnews/compose/test/unit/test_sendMessageLater.js
mailnews/compose/test/unit/test_sendMessageLater2.js
mailnews/compose/test/unit/test_sendMessageLater3.js
mailnews/compose/test/unit/test_sendObserver.js
mailnews/compose/test/unit/test_smtp8bitMime.js
mailnews/compose/test/unit/test_smtpAuthMethods.js
mailnews/compose/test/unit/test_smtpPassword.js
mailnews/compose/test/unit/test_smtpPasswordFailure1.js
mailnews/compose/test/unit/test_smtpPasswordFailure2.js
mailnews/compose/test/unit/test_smtpPasswordFailure3.js
mailnews/db/gloda/modules/datamodel.js
mailnews/db/gloda/modules/explattr.js
mailnews/db/gloda/modules/gloda.js
mailnews/db/gloda/modules/index_ab.js
mailnews/db/gloda/modules/index_msg.js
mailnews/db/gloda/modules/noun_tag.js
mailnews/db/gloda/modules/utils.js
mailnews/db/gloda/test/unit/base_index_junk.js
mailnews/db/gloda/test/unit/head_gloda.js
mailnews/db/gloda/test/unit/resources/glodaTestHelper.js
mailnews/db/gloda/test/unit/test_index_addressbook.js
mailnews/db/msgdb/test/unit/head_maildb.js
mailnews/db/msgdb/test/unit/test_enumerator_cleanup.js
mailnews/db/msgdb/test/unit/test_propertyEnumerator.js
mailnews/db/msgdb/test/unit/test_references_parsing.js
mailnews/extensions/bayesian-spam-filter/test/unit/head_bayes.js
mailnews/extensions/bayesian-spam-filter/test/unit/test_bug228675.js
mailnews/extensions/bayesian-spam-filter/test/unit/test_customTokenization.js
mailnews/extensions/bayesian-spam-filter/test/unit/test_junkAsTraits.js
mailnews/extensions/bayesian-spam-filter/test/unit/test_traitAliases.js
mailnews/extensions/mdn/test/unit/head_mdn.js
mailnews/extensions/newsblog/content/FeedUtils.jsm
mailnews/extensions/newsblog/content/feed-subscriptions.js
mailnews/extensions/newsblog/content/newsblogOverlay.js
mailnews/imap/test/unit/head_server.js
mailnews/imap/test/unit/test_copyThenMove.js
mailnews/imap/test/unit/test_dontStatNoSelect.js
mailnews/imap/test/unit/test_imapAttachmentSaves.js
mailnews/imap/test/unit/test_imapAuthMethods.js
mailnews/imap/test/unit/test_imapAutoSync.js
mailnews/imap/test/unit/test_imapContentLength.js
mailnews/imap/test/unit/test_imapCopyTimeout.js
mailnews/imap/test/unit/test_imapFilterActionsPostplugin.js
mailnews/imap/test/unit/test_imapFolderCopy.js
mailnews/imap/test/unit/test_imapHdrChunking.js
mailnews/imap/test/unit/test_imapHighWater.js
mailnews/imap/test/unit/test_imapMove.js
mailnews/imap/test/unit/test_imapRename.js
mailnews/imap/test/unit/test_imapUndo.js
mailnews/imap/test/unit/test_localToImapFilter.js
mailnews/imap/test/unit/test_localToImapFilterQuarantine.js
mailnews/imap/test/unit/test_nsIMsgFolderListenerIMAP.js
mailnews/imap/test/unit/test_offlineDraftDataloss.js
mailnews/imap/test/unit/test_offlinePlayback.js
mailnews/imap/test/unit/test_offlineStoreLocking.js
mailnews/imap/test/unit/test_preserveDataOnMove.js
mailnews/imap/test/unit/test_saveImapDraft.js
mailnews/imap/test/unit/test_saveTemplate.js
mailnews/imap/test/unit/test_starttlsFailure.js
mailnews/imap/test/unit/test_stopMovingToLocalFolder.js
mailnews/imap/test/unit/test_trustSpamAssassin.js
mailnews/import/content/importDialog.js
mailnews/import/test/unit/head_import.js
mailnews/import/test/unit/resources/import_helper.js
mailnews/import/test/unit/test_bug_263304.js
mailnews/import/test/unit/test_ldif_import.js
mailnews/import/test/unit/test_outlook_settings.js
mailnews/import/test/unit/test_shiftjis_csv.js
mailnews/import/test/unit/test_utf16_csv.js
mailnews/jsaccount/test/unit/head_jsaccount.js
mailnews/jsaccount/test/unit/test_jaMsgFolder.js
mailnews/local/test/unit/head_maillocal.js
mailnews/local/test/unit/test_bug457168.js
mailnews/local/test/unit/test_fileName.js
mailnews/local/test/unit/test_movemailDownload.js
mailnews/local/test/unit/test_msgIDParsing.js
mailnews/local/test/unit/test_nsIMsgLocalMailFolder.js
mailnews/local/test/unit/test_pop3AuthMethods.js
mailnews/local/test/unit/test_pop3FilterActions.js
mailnews/local/test/unit/test_pop3GSSAPIFail.js
mailnews/local/test/unit/test_pop3MoveFilter.js
mailnews/local/test/unit/test_pop3MoveFilter2.js
mailnews/local/test/unit/test_pop3Password.js
mailnews/local/test/unit/test_pop3Password2.js
mailnews/local/test/unit/test_pop3Password3.js
mailnews/local/test/unit/test_pop3PasswordFailure.js
mailnews/local/test/unit/test_pop3PasswordFailure2.js
mailnews/local/test/unit/test_pop3PasswordFailure3.js
mailnews/local/test/unit/test_pop3ServerBrokenCRAMDisconnect.js
mailnews/local/test/unit/test_pop3ServerBrokenCRAMFail.js
mailnews/local/test/unit/test_undoDelete.js
mailnews/local/test/unit/test_verifyLogon.js
mailnews/mime/test/unit/head_mime.js
mailnews/mime/test/unit/test_EncodeMimePartIIStr_UTF8.js
mailnews/mime/test/unit/test_bug493544.js
mailnews/mime/test/unit/test_nsIMsgHeaderParser1.js
mailnews/mime/test/unit/test_nsIMsgHeaderParser2.js
mailnews/mime/test/unit/test_nsIMsgHeaderParser3.js
mailnews/mime/test/unit/test_nsIMsgHeaderParser4.js
mailnews/mime/test/unit/test_nsIMsgHeaderParser5.js
mailnews/mime/test/unit/test_parseHeadersWithArray.js
mailnews/news/content/downloadheaders.js
mailnews/news/src/nsNewsAutoCompleteSearch.js
mailnews/news/test/unit/head_server_setup.js
mailnews/news/test/unit/test_biff.js
mailnews/news/test/unit/test_bug37465.js
mailnews/news/test/unit/test_bug695309.js
mailnews/news/test/unit/test_internalUris.js
mailnews/news/test/unit/test_newsAutocomplete.js
mailnews/news/test/unit/test_nntpPassword2.js
mailnews/news/test/unit/test_nntpPassword3.js
mailnews/news/test/unit/test_nntpPasswordFailure.js
mailnews/news/test/unit/test_nntpPost.js
mailnews/news/test/unit/test_nntpUrl.js
mailnews/test/resources/IMAPpump.js
mailnews/test/resources/NetworkTestUtils.jsm
mailnews/test/resources/POP3pump.js
mailnews/test/resources/PromiseTestUtils.jsm
mailnews/test/resources/folderEventLogHelper.js
mailnews/test/resources/localAccountUtils.js
mailnews/test/resources/mailTestUtils.js
mailnews/test/resources/messageInjection.js
mailnews/test/resources/messageModifier.js
mailnews/test/resources/msgFolderListenerSetup.js
suite/mailnews/addrbook/abCommon.js
suite/mailnews/addrbook/addressbook.js
suite/mailnews/compose/MsgComposeCommands.js
suite/mailnews/compose/addressingWidgetOverlay.js
suite/mailnews/mailContextMenus.js
suite/mailnews/mailWindowOverlay.js
suite/mailnews/search/ABSearchDialog.js
suite/mailnews/search/FilterListDialog.js
--- a/calendar/base/modules/utils/calEmailUtils.jsm
+++ b/calendar/base/modules/utils/calEmailUtils.jsm
@@ -1,13 +1,13 @@
 /* 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/. */
 
-const { MailServices } = ChromeUtils.import("resource:///modules/mailServices.js", null);
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "cal", "resource://calendar/modules/calUtils.jsm", "cal");
 
 /*
  * Functions for processing email addresses and sending email
  */
 
--- a/calendar/base/modules/utils/calItipUtils.jsm
+++ b/calendar/base/modules/utils/calItipUtils.jsm
@@ -1,16 +1,16 @@
 /* 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/. */
 
 ChromeUtils.import("resource://gre/modules/Preferences.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
-const { MailServices } = ChromeUtils.import("resource:///modules/mailServices.js", null);
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "cal", "resource://calendar/modules/calUtils.jsm", "cal");
 
 /*
  * Scheduling and iTIP helper code
  */
 
 // NOTE: This module should not be loaded directly, it is available when
--- a/calendar/base/modules/utils/calProviderUtils.jsm
+++ b/calendar/base/modules/utils/calProviderUtils.jsm
@@ -1,13 +1,13 @@
 /* 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/. */
 
-const { MailServices } = ChromeUtils.import("resource:///modules/mailServices.js", null);
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Preferences.jsm");
 const { fixIterator } = ChromeUtils.import("resource:///modules/iteratorUtils.jsm", null);
 
 XPCOMUtils.defineLazyModuleGetter(this, "cal", "resource://calendar/modules/calUtils.jsm", "cal");
 ChromeUtils.defineModuleGetter(this, "Deprecated", "resource://gre/modules/Deprecated.jsm");
 
--- a/calendar/itip/calItipEmailTransport.js
+++ b/calendar/itip/calItipEmailTransport.js
@@ -1,13 +1,13 @@
 /* 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/. */
 
-var { MailServices } = ChromeUtils.import("resource:///modules/mailServices.js", null);
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm", null);
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Preferences.jsm");
 const { ltn } = ChromeUtils.import("resource://calendar/modules/ltnInvitationUtils.jsm", null);
 
 /**
  * Constructor of calItipEmailTransport object
--- a/calendar/lightning/content/lightning-item-panel.js
+++ b/calendar/lightning/content/lightning-item-panel.js
@@ -10,17 +10,17 @@
  *          onCommandViewToolbar, onCommandCustomize, attachFileByAccountKey,
  *          onUnloadLightningItemPanel, openNewEvent, openNewTask,
  *          openNewMessage, openNewCardDialog
  */
 
 // XXX Need to determine which of these we really need here.
 var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm", null);
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-var { MailServices } = ChromeUtils.import("resource:///modules/mailServices.js", null);
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 // gTabmail is null if we are in a dialog window and not in a tab.
 var gTabmail = document.getElementById("tabmail") || null;
 
 if (!gTabmail) {
     // In a dialog window the following menu item functions need to be
     // defined.  In a tab they are defined elsewhere.  To prevent errors in
     // the log they are defined here (before the onLoad function is called).
--- a/calendar/lightning/content/lightning-utils.js
+++ b/calendar/lightning/content/lightning-utils.js
@@ -2,17 +2,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/. */
 
 /* exported ltnInitMailIdentitiesRow, ltnGetMailIdentitySelection,
  *          ltnSaveMailIdentitySelection, ltnNotifyOnIdentitySelection
  */
 
 var { fixIterator } = ChromeUtils.import("resource:///modules/iteratorUtils.jsm", null);
-var { MailServices } = ChromeUtils.import("resource:///modules/mailServices.js", null);
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm", null);
 
 /**
  * Initializing the email identity row
  * (shared between calendar creation wizard and properties dialog)
  */
 function ltnInitMailIdentitiesRow() {
     if (!gCalendar) {
--- a/calendar/lightning/modules/ltnInvitationUtils.jsm
+++ b/calendar/lightning/modules/ltnInvitationUtils.jsm
@@ -1,16 +1,16 @@
 /* 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/. */
 
 const { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm", null);
 const { recurrenceRule2String } = ChromeUtils.import("resource://calendar/modules/calRecurrenceUtils.jsm", null);
 ChromeUtils.import("resource://gre/modules/Preferences.jsm");
-const { MailServices } = ChromeUtils.import("resource:///modules/mailServices.js", null);
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 this.EXPORTED_SYMBOLS = ["ltn"]; /* exported ltn */
 var ltn = {};
 
 ltn.invitation = {
     /**
      * Returns a header title for an ITIP item depending on the response method
      * @param  {calItipItem}     aItipItem  the itip item to check
--- a/calendar/test/unit/test_ltninvitationutils.js
+++ b/calendar/test/unit/test_ltninvitationutils.js
@@ -1,14 +1,14 @@
 /* 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/. */
 
 const { ltn } = ChromeUtils.import("resource://calendar/modules/ltnInvitationUtils.jsm", null);
-var { MailServices } = ChromeUtils.import("resource:///modules/mailServices.js", null);
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Preferences.jsm");
 
 function run_test() {
     do_calendar_startup(run_next_test);
 }
 
 // tests for ltnInvitationUtils.jsm
 
--- a/mail/base/content/ABSearchDialog.js
+++ b/mail/base/content/ABSearchDialog.js
@@ -1,14 +1,14 @@
 /* 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/. */
 
 ChromeUtils.import("resource:///modules/ABQueryUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var searchSessionContractID = "@mozilla.org/messenger/searchSession;1";
 var gSearchSession;
 
 var nsMsgSearchScope = Ci.nsMsgSearchScope;
 var nsIMsgSearchTerm = Ci.nsIMsgSearchTerm;
--- a/mail/base/content/FilterListDialog.js
+++ b/mail/base/content/FilterListDialog.js
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; 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/. */
 
 ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var gFilterListMsgWindow = null;
 var gCurrentFilterList;
 var gServerMenu = null;
 var gFilterListbox = null;
 var gEditButton = null;
 var gDeleteButton = null;
--- a/mail/base/content/editContactPanel.js
+++ b/mail/base/content/editContactPanel.js
@@ -1,14 +1,14 @@
 /* -*- Mode: Java; tab-width: 2; 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/. */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var editContactInlineUI = {
   _overlayLoaded: false,
   _overlayLoading: false,
   _cardDetails: null,
   _writeable: true,
   _blockedCommands: ["cmd_close"],
--- a/mail/base/content/folderPane.js
+++ b/mail/base/content/folderPane.js
@@ -4,17 +4,17 @@
 
 // Implements a tree of folders. It shows icons depending on folder type
 // and other fancy styling.
 // This is used in the main folder pane, but also some dialogs that need
 // to show a nice list of folders.
 
 ChromeUtils.import("resource:///modules/folderUtils.jsm");
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/MailUtils.js");
 ChromeUtils.import("resource:///modules/IOUtils.js");
 ChromeUtils.import("resource:///modules/FeedUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 if (typeof FeedMessageHandler != "object")
   Services.scriptloader.loadSubScript("chrome://messenger-newsblog/content/newsblogOverlay.js");
 
--- a/mail/base/content/glodaFacetBindings.xml
+++ b/mail/base/content/glodaFacetBindings.xml
@@ -13,17 +13,17 @@
 
 <!-- ===== Constraints ===== -->
 
 <binding id="query-explanation">
   <content>
   </content>
   <implementation>
     <constructor><![CDATA[
-      ChromeUtils.import("resource:///modules/mailServices.js");
+      ChromeUtils.import("resource:///modules/MailServices.jsm");
     ]]></constructor>
     <!-- Indicate that we are based on a fulltext search-->
     <method name="setFulltext">
       <parameter name="aMsgSearcher" />
       <body><![CDATA[
         while (this.hasChildNodes())
           this.lastChild.remove();
 
@@ -1502,17 +1502,17 @@
         </html:div>
       </html:div>
     </html:div>
     <html:pre anonid="snippet" class="message-body"></html:pre>
       <html:div anonid="attachments" class="message-attachments"></html:div>
   </content>
   <implementation>
     <constructor><![CDATA[
-      ChromeUtils.import("resource:///modules/mailServices.js");
+      ChromeUtils.import("resource:///modules/MailServices.jsm");
       this.build();
     ]]></constructor>
     <method name="build">
       <body><![CDATA[
         let message = this.message;
         let dis = this;
         function anonElem(aAnonId) {
           return document.getAnonymousElementByAttribute(dis, "anonid",
--- a/mail/base/content/macMessengerMenu.js
+++ b/mail/base/content/macMessengerMenu.js
@@ -1,15 +1,15 @@
 /* -*- Mode: Javascript; tab-width: 2; 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/. */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 // Load and add the menu item to the OS X Dock icon menu.
 addEventListener("load", function() {
   let dockMenuElement = document.getElementById("menu_mac_dockmenu");
   let nativeMenu = Cc["@mozilla.org/widget/standalonenativemenu;1"]
                     .createInstance(Ci.nsIStandaloneNativeMenu);
 
   nativeMenu.init(dockMenuElement);
--- a/mail/base/content/mail3PaneWindowCommands.js
+++ b/mail/base/content/mail3PaneWindowCommands.js
@@ -2,17 +2,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/. */
 
 /**
  * Functionality for the main application window (aka the 3pane) usually
  * consisting of folder pane, thread pane and message pane.
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/MailUtils.js");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
 
 // Controller object for folder pane
 var FolderPaneController =
 {
   supportsCommand: function(command)
--- a/mail/base/content/mailCommands.js
+++ b/mail/base/content/mailCommands.js
@@ -1,14 +1,14 @@
 /* -*- Mode: Javascript; tab-width: 2; 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/. */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/MailUtils.js");
 
 /**
  * Get the identity that most likely is the best one to use, given the hint.
  * @param identities    nsIArray<nsIMsgIdentity> of identities
  * @param optionalHint  string containing comma separated mailboxes
  * @param useDefault    If true, use the default identity of the default
  *                      account as last choice. This is useful when all
--- a/mail/base/content/mailContextMenus.js
+++ b/mail/base/content/mailContextMenus.js
@@ -1,15 +1,15 @@
 /* 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/. */
 
 ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var mailtolength = 7;
 
 /**
  * Function to change the highlighted row back to the row that is currently
  * outline/dotted without loading the contents of either rows. This is
  * triggered when the context menu for a given row is hidden/closed
  * (onpopuphiding).
--- a/mail/base/content/mailCore.js
+++ b/mail/base/content/mailCore.js
@@ -12,17 +12,17 @@
  * to be used by all of the main mail windows?
  */
 
 ChromeUtils.import("resource://gre/modules/BrowserUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/CharsetMenu.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "gViewSourceUtils", function() {
   let scope = {};
   Services.scriptloader.loadSubScript("chrome://global/content/viewSourceUtils.js", scope);
   scope.gViewSourceUtils.viewSource = async function (aArgs) {
     // Check if external view source is enabled. If so, try it. If it fails,
     // fallback to internal view source.
     if (Services.prefs.getBoolPref("view_source.editor.external")) {
--- a/mail/base/content/mailWidgets.xml
+++ b/mail/base/content/mailWidgets.xml
@@ -1296,17 +1296,17 @@
 
               headerValueNode.appendChild(label);
             }
         ]]>
         </body>
       </method>
       <constructor>
         <![CDATA[
-          ChromeUtils.import("resource:///modules/mailServices.js");
+          ChromeUtils.import("resource:///modules/MailServices.jsm");
         ]]>
       </constructor>
     </implementation>
   </binding>
 
   <binding id="search-menulist-abstract" name="searchMenulistAbstract" extends="xul:box">
     <content>
       <xul:menulist class="search-menulist" xbl:inherits="flex,disabled" oncommand="this.parentNode.onSelect(event)">
@@ -1624,17 +1624,17 @@
                                this.validityManager.getAttributeProperty(ids[i]));
             }
             return strings;
           ]]>
         </getter>
       </property>
       <constructor>
       <![CDATA[
-        ChromeUtils.import("resource:///modules/mailServices.js");
+        ChromeUtils.import("resource:///modules/MailServices.jsm");
         ChromeUtils.import("resource://gre/modules/Services.jsm", this);
         initializeTermFromId(this.id);
       ]]>
       </constructor>
     </implementation>
   </binding>
 
   <!-- searchoperator - Contains, Is Less than, etc -->
@@ -1698,17 +1698,17 @@
         <getter>
           <![CDATA[
             return this.searchAttribute;
           ]]>
         </getter>
       </property>
       <constructor>
         <![CDATA[
-          ChromeUtils.import("resource:///modules/mailServices.js");
+          ChromeUtils.import("resource:///modules/MailServices.jsm");
           ChromeUtils.import("resource://gre/modules/Services.jsm", this);
         ]]>
       </constructor>
     </implementation>
   </binding>
 
   <!-- searchvalue - a widget which dynamically changes its user interface
        depending on what type of data it's supposed to be showing
@@ -2113,17 +2113,17 @@
         <body>
           <![CDATA[
             this.fillStringsForChildren(menulist.firstChild, bundle);
           ]]>
         </body>
       </method>
       <constructor>
       <![CDATA[
-        ChromeUtils.import("resource:///modules/mailServices.js");
+        ChromeUtils.import("resource:///modules/MailServices.jsm");
         ChromeUtils.import("resource://gre/modules/Services.jsm", this);
 
         // initialize strings
         var bundle = this.Services.strings.createBundle("chrome://messenger/locale/messenger.properties");
 
         // initialize the priority picker
         this.initialize(document.getAnonymousNodes(this)[1], bundle);
 
@@ -2605,17 +2605,17 @@
             var containingBox = document.getAnonymousNodes(this)[0];
             while (containingBox.hasChildNodes())
               containingBox.lastChild.remove();
           ]]>
         </body>
       </method>
       <constructor>
         <![CDATA[
-          ChromeUtils.import("resource:///modules/mailServices.js");
+          ChromeUtils.import("resource:///modules/MailServices.jsm");
           ChromeUtils.import("resource://gre/modules/Services.jsm", this);
         ]]>
       </constructor>
     </implementation>
   </binding>
 
   <binding id="folderSummary-location">
     <content>
--- a/mail/base/content/mailWindow.js
+++ b/mail/base/content/mailWindow.js
@@ -1,14 +1,14 @@
 /**
  * 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/. */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/appIdleManager.js");
 ChromeUtils.import("resource:///modules/MailUtils.js");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/gloda/log4moz.js");
 ChromeUtils.import("resource:///modules/gloda/public.js");
 
 //This file stores variables common to mail windows
--- a/mail/base/content/mailWindowOverlay.js
+++ b/mail/base/content/mailWindowOverlay.js
@@ -1,17 +1,17 @@
 /* -*- 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/. */
 
 ChromeUtils.import("resource:///modules/FeedUtils.jsm");
 ChromeUtils.import("resource:///modules/gloda/dbview.js");
 ChromeUtils.import("resource:///modules/MailConsts.js");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/MailUtils.js");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
 ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 
 ChromeUtils.defineModuleGetter(this, "BrowserToolboxProcess", "resource://devtools/client/framework/ToolboxProcess.jsm");
 ChromeUtils.defineModuleGetter(this, "ScratchpadManager","resource://devtools/client/scratchpad/scratchpad-manager.jsm");
 Object.defineProperty(this, "HUDService", {
--- a/mail/base/content/msgHdrView.js
+++ b/mail/base/content/msgHdrView.js
@@ -5,17 +5,17 @@
 /**
  * Functions related to displaying the headers for a selected message in the
  * message pane.
  */
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource:///modules/displayNameUtils.js");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/gloda/utils.js");
 var {Status: statusUtils} =
   ChromeUtils.import("resource:///modules/imStatusUtils.jsm");
 
 ////////////////////////////////////////////////////////////////////////////////////
 // Warning: It's critical that the code in here for displaying the message
 // headers for a selected message remain as fast as possible. In particular,
 // right now, we only introduce one reflow per message. i.e. if you click on
--- a/mail/base/content/msgMail3PaneWindow.js
+++ b/mail/base/content/msgMail3PaneWindow.js
@@ -6,17 +6,17 @@
 ChromeUtils.import("resource:///modules/activity/activityModules.js");
 ChromeUtils.import("resource:///modules/errUtils.js");
 ChromeUtils.import("resource:///modules/folderUtils.jsm");
 ChromeUtils.import("resource:///modules/IOUtils.js");
 ChromeUtils.import("resource:///modules/jsTreeSelection.js");
 ChromeUtils.import("resource:///modules/MailConsts.js");
 ChromeUtils.import("resource:///modules/mailInstrumentation.js");
 ChromeUtils.import("resource:///modules/mailnewsMigrator.js");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/msgDBCacheManager.js");
 ChromeUtils.import("resource:///modules/sessionStoreManager.js");
 ChromeUtils.import("resource:///modules/summaryFrameManager.js");
 ChromeUtils.import("resource:///modules/MailUtils.js");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 ChromeUtils.import("resource://gre/modules/Color.jsm");
 
--- a/mail/base/content/multimessageview.js
+++ b/mail/base/content/multimessageview.js
@@ -2,17 +2,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/. */
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/gloda/gloda.js");
 ChromeUtils.import("resource:///modules/gloda/connotent.js");
 ChromeUtils.import("resource:///modules/gloda/mimemsg.js");
 ChromeUtils.import("resource:///modules/displayNameUtils.js");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/templateUtils.js");
 
 var gMessenger = Cc["@mozilla.org/messenger;1"]
                    .createInstance(Ci.nsIMessenger);
 
 // Set up our string formatter for localizing strings.
 XPCOMUtils.defineLazyGetter(this, "formatString", function() {
   let formatter = new PluralStringFormatter(
--- a/mail/base/content/newTagDialog.js
+++ b/mail/base/content/newTagDialog.js
@@ -1,15 +1,15 @@
 /* -*- Mode: Java; tab-width: 2; 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/. */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var dialog;
 
 /**
  * Pass in keyToEdit as a window argument to turn this dialog into an edit
  * tag dialog.
  */
--- a/mail/base/modules/MailUtils.js
+++ b/mail/base/modules/MailUtils.js
@@ -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/. */
 
 var EXPORTED_SYMBOLS = ["MailUtils"];
 
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
 ChromeUtils.import("resource:///modules/MailConsts.js");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
 
 var MC = MailConsts;
 
 /**
  * This module has several utility functions for use by both core and
  * third-party code. Some functions are aimed at code that doesn't have a
--- a/mail/base/modules/dbViewWrapper.js
+++ b/mail/base/modules/dbViewWrapper.js
@@ -1,15 +1,15 @@
 /* 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/. */
 
 this.EXPORTED_SYMBOLS = ['DBViewWrapper', 'IDBViewWrapperListener'];
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/mailViewManager.js");
 ChromeUtils.import("resource:///modules/searchSpec.js");
 ChromeUtils.import("resource:///modules/virtualFolderWrapper.js");
 
 var nsMsgFolderFlags = Ci.nsMsgFolderFlags;
 var nsMsgViewType = Ci.nsMsgViewType;
 var nsMsgViewFlagsType = Ci.nsMsgViewFlagsType;
 var nsMsgViewSortType = Ci.nsMsgViewSortType;
--- a/mail/base/modules/displayNameUtils.js
+++ b/mail/base/modules/displayNameUtils.js
@@ -1,14 +1,14 @@
 /* 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/. */
 
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/StringBundle.js");
 
 var EXPORTED_SYMBOLS = [
   "GetCardForEmail", "FormatDisplayName", "FormatDisplayNameList",
 ];
 
 // XXX: Maybe the strings for this file should go in a separate bundle?
 var gMessengerBundle = new StringBundle(
--- a/mail/base/modules/mailInstrumentation.js
+++ b/mail/base/modules/mailInstrumentation.js
@@ -9,17 +9,17 @@
 /* :::::::: Constants and Helpers ::::::::::::::: */
 
 this.EXPORTED_SYMBOLS = ["mailInstrumentationManager"];
 
 var nsIMFNService = Ci.nsIMsgFolderNotificationService;
 
 ChromeUtils.import("resource:///modules/errUtils.js");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 Cu.importGlobalProperties(["XMLHttpRequest"]);
 
 /* :::::::: The Module ::::::::::::::: */
 
 var mailInstrumentationManager =
 {
   // JS object containing the current state object
--- a/mail/base/modules/mailMigrator.js
+++ b/mail/base/modules/mailMigrator.js
@@ -7,17 +7,17 @@
  * This module handles migrating mail-specific preferences, etc. Migration has
  * traditionally been a part of msgMail3PaneWindow.js, but separating the code
  * out into a module makes unit testing much easier.
  */
 
 var EXPORTED_SYMBOLS = ["MailMigrator"];
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/IOUtils.js");
 
 ChromeUtils.defineModuleGetter(this, "LoginHelper",
                                "resource://gre/modules/LoginHelper.jsm");
 
 var MailMigrator = {
   /**
    * Switch the given fonts to the given encodings, but only if the current fonts
--- a/mail/base/modules/quickFilterManager.js
+++ b/mail/base/modules/quickFilterManager.js
@@ -6,17 +6,17 @@ this.EXPORTED_SYMBOLS = ["QuickFilterSta
                           "MessageTextFilter", "QuickFilterSearchListener"];
 
 ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
 ChromeUtils.import("resource:///modules/errUtils.js");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/searchSpec.js");
 
 var nsMsgSearchAttrib = Ci.nsMsgSearchAttrib;
 var nsMsgMessageFlags = Ci.nsMsgMessageFlags;
 var nsMsgSearchOp = Ci.nsMsgSearchOp;
 
 // XXX we need to know whether the gloda indexer is enabled for upsell reasons,
 // but this should really just be exposed on the main Gloda public interface.
--- a/mail/base/modules/searchSpec.js
+++ b/mail/base/modules/searchSpec.js
@@ -1,16 +1,16 @@
 /* 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/. */
 
 this.EXPORTED_SYMBOLS = ['SearchSpec'];
 
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var nsMsgSearchScope = Ci.nsMsgSearchScope;
 var nsIMsgSearchTerm = Ci.nsIMsgSearchTerm;
 var nsIMsgLocalMailFolder = Ci.nsIMsgLocalMailFolder;
 var nsMsgFolderFlags = Ci.nsMsgFolderFlags;
 var nsMsgSearchAttrib = Ci.nsMsgSearchAttrib;
 
--- a/mail/base/test/unit/head_mailbase.js
+++ b/mail/base/test/unit/head_mailbase.js
@@ -1,10 +1,10 @@
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://testing-common/mailnews/mailTestUtils.js");
 
 var CC = Components.Constructor;
 
 // Ensure the profile directory is set up
 do_get_profile();
 
--- a/mail/base/test/unit/test_alertHook.js
+++ b/mail/base/test/unit/test_alertHook.js
@@ -1,15 +1,15 @@
 /* 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/. */
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/activity/alertHook.js");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://testing-common/mailnews/MockFactory.js");
 alertHook.init();
 
 // Replace the alerts service with our own. This will let us check if we're
 // prompting or not.
 var gAlertShown = false;
 
 var mockAlertsService = {
--- a/mail/base/test/unit/test_viewWrapper_virtualFolderCustomTerm.js
+++ b/mail/base/test/unit/test_viewWrapper_virtualFolderCustomTerm.js
@@ -11,17 +11,17 @@ load("../../../../mailnews/resources/log
 load("../../../../mailnews/resources/asyncTestUtils.js");
 
 load("../../../../mailnews/resources/messageGenerator.js");
 load("../../../../mailnews/resources/messageModifier.js");
 load("../../../../mailnews/resources/messageInjection.js");
 
 load("resources/viewWrapperTestUtils.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 initViewWrapperTestUtils({mode: "imap", offline: false});
 
 /**
  * A custom search term, that just does Subject Contains
  */
 var gCustomSearchTermSubject = {
   id: "mailnews@mozilla.org#test",
--- a/mail/components/about-support/content/aboutSupport.js
+++ b/mail/components/about-support/content/aboutSupport.js
@@ -9,17 +9,17 @@
 
 "use strict";
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/Troubleshoot.jsm");
 ChromeUtils.import("resource://gre/modules/ResetProfile.jsm");
 ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 // added for TB
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 // end of TB addition
 
 ChromeUtils.defineModuleGetter(this, "PluralForm",
                                "resource://gre/modules/PluralForm.jsm");
 ChromeUtils.defineModuleGetter(this, "PlacesDBUtils",
                                "resource://gre/modules/PlacesDBUtils.jsm");
 
 // added for TB
--- a/mail/components/about-support/content/accounts.js
+++ b/mail/components/about-support/content/accounts.js
@@ -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/. */
 
 /* globals CLASS_DATA_PRIVATE, CLASS_DATA_PUBLIC, fixIterator, MailServices */
 
 "use strict";
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 // Platform-specific includes
 if ("@mozilla.org/windows-registry-key;1" in Cc)
   ChromeUtils.import("resource:///modules/aboutSupportWin32.js");
 else if ("nsILocalFileMac" in Ci)
   ChromeUtils.import("resource:///modules/aboutSupportMac.js");
--- a/mail/components/accountcreation/content/createInBackend.js
+++ b/mail/components/accountcreation/content/createInBackend.js
@@ -7,17 +7,17 @@
  * Takes an |AccountConfig| JS object and creates that account in the
  * Thunderbird backend (which also writes it to prefs).
  *
  * @param config {AccountConfig} The account to create
  *
  * @return - the account created.
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 /* eslint-disable complexity */
 function createAccountInBackend(config) {
   // incoming server
   let inServer = MailServices.accounts.createIncomingServer(
       config.incoming.username,
       config.incoming.hostname,
--- a/mail/components/accountcreation/content/emailWizard.js
+++ b/mail/components/accountcreation/content/emailWizard.js
@@ -1,14 +1,14 @@
 /* -*- Mode: Java; tab-width: 2; 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/. */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource:///modules/hostnameUtils.jsm");
 ChromeUtils.import("resource:///modules/OAuth2Providers.jsm");
 
 /**
  * This is the dialog opened by menu File | New account | Mail... .
  *
  * It gets the user's realname, email address and password,
--- a/mail/components/accountcreation/content/fetchConfig.js
+++ b/mail/components/accountcreation/content/fetchConfig.js
@@ -4,17 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tries to find a configuration for this ISP on the local harddisk, in the
  * application install directory's "isp" subdirectory.
  * Params @see fetchConfigFromISP()
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource:///modules/JXON.js");
 
 function fetchConfigFromDisk(domain, successCallback, errorCallback) {
   return new TimeoutAbortable(runAsync(function() {
     try {
       // <TB installdir>/isp/example.com.xml
       var configLocation = Services.dirsvc.get("CurProcD", Ci.nsIFile);
--- a/mail/components/accountcreation/content/verifyConfig.js
+++ b/mail/components/accountcreation/content/verifyConfig.js
@@ -24,17 +24,17 @@
  *   For accountConfig, see below.
  * @param errorCallback function(ex)
  *   Called when we could guess not the config, either
  *   because we have not found anything or
  *   because there was an error (e.g. no network connection).
  *   The ex.message will contain a user-presentable message.
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/OAuth2Providers.jsm");
 
 if (typeof gEmailWizardLogger == "undefined") {
   ChromeUtils.import("resource:///modules/gloda/log4moz.js");
   var gEmailWizardLogger = Log4Moz.getConfiguredLogger("mail.wizard");
 }
 
 function verifyConfig(config, alter, msgWindow, successCallback, errorCallback) {
--- a/mail/components/activity/modules/alertHook.js
+++ b/mail/components/activity/modules/alertHook.js
@@ -4,17 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 this.EXPORTED_SYMBOLS = ['alertHook'];
 
 var nsActWarning = Components.Constructor("@mozilla.org/activity-warning;1",
                                             "nsIActivityWarning", "init");
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 // This module provides a link between the send later service and the activity
 // manager.
 var alertHook =
 {
   get activityMgr() {
     delete this.activityMgr;
--- a/mail/components/activity/modules/moveCopy.js
+++ b/mail/components/activity/modules/moveCopy.js
@@ -9,17 +9,17 @@ var nsActProcess = Components.Constructo
                                             "nsIActivityProcess", "init");
 var nsActEvent = Components.Constructor("@mozilla.org/activity-event;1",
                                           "nsIActivityEvent", "init");
 var nsActWarning = Components.Constructor("@mozilla.org/activity-warning;1",
                                             "nsIActivityWarning", "init");
 var nsMsgFolderFlags = Ci.nsMsgFolderFlags;
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
 ChromeUtils.import("resource:///modules/gloda/log4moz.js");
 
 // This module provides a link between the move/copy code and the activity
 // manager.
 var moveCopyModule =
 {
--- a/mail/components/activity/modules/pop3Download.js
+++ b/mail/components/activity/modules/pop3Download.js
@@ -8,17 +8,17 @@ this.EXPORTED_SYMBOLS = ['pop3DownloadMo
 var nsActProcess = Components.Constructor("@mozilla.org/activity-process;1",
                                             "nsIActivityProcess", "init");
 var nsActEvent = Components.Constructor("@mozilla.org/activity-event;1",
                                           "nsIActivityEvent", "init");
 var nsActWarning = Components.Constructor("@mozilla.org/activity-warning;1",
                                             "nsIActivityWarning", "init");
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
 ChromeUtils.import("resource:///modules/gloda/log4moz.js");
 
 // This module provides a link between the pop3 service code and the activity
 // manager.
 var pop3DownloadModule =
 {
--- a/mail/components/addrbook/content/abCard.js
+++ b/mail/components/addrbook/content/abCard.js
@@ -1,15 +1,15 @@
 /* -*- Mode: Javascript; tab-width: 2; 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/. */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-var { MailServices } = ChromeUtils.import("resource:///modules/mailServices.js", null);
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var kNonVcardFields =
         ["NickNameContainer", "SecondaryEmailContainer", "ScreenNameContainer",
          "customFields", "preferDisplayName"];
 
 var kPhoneticFields =
         ["PhoneticLastName", "PhoneticLabel1", "PhoneticSpacer1",
          "PhoneticFirstName", "PhoneticLabel2", "PhoneticSpacer2"];
--- a/mail/components/addrbook/content/abCommon.js
+++ b/mail/components/addrbook/content/abCommon.js
@@ -13,17 +13,17 @@
 /* globals goSetMenuValue */
 
 // mailnews/addrbook/content/abResultsPane.js
 /* globals kCardsOnly, kListsAndCards, kMultipleListsOnly, kNothingSelected, kSingleListOnly */
 
 // toolkit/content/globalOverlay.js
 /* globals goUpdateCommand */
 
-var { MailServices } = ChromeUtils.import("resource:///modules/mailServices.js", null);
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/IOUtils.js");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
 ChromeUtils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
 
 var gDirTree;
 var abList = null;
 var gAbResultsTree = null;
--- a/mail/components/addrbook/content/abTrees.js
+++ b/mail/components/addrbook/content/abTrees.js
@@ -8,17 +8,17 @@
 /* globals PROTO_TREE_VIEW */
 
 /**
  * This file contains our implementation for various addressbook trees.  It
  * depends on jsTreeView.js being loaded before this script is loaded.
  */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-var { MailServices } = ChromeUtils.import("resource:///modules/mailServices.js", null);
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/IOUtils.js");
 
 // Tree Sort helper methods.
 var AB_ORDER = ["aab", "pab", "mork", "ldap", "mapi+other", "anyab", "cab"];
 
 function getDirectoryValue(aDir, aKey) {
   if (aKey == "ab_type") {
     if (aDir._directory.URI == kAllDirectoryRoot + "?")
--- a/mail/components/addrbook/content/addressbook.js
+++ b/mail/components/addrbook/content/addressbook.js
@@ -22,17 +22,17 @@
 /* globals getModelQuery, getSearchTokens, generateQueryURI */
 
 // toolkit/content/globalOverlay.js
 /* globals goUpdateCommand */
 
 // Ensure the activity modules are loaded for this window.
 ChromeUtils.import("resource:///modules/activity/activityModules.js");
 ChromeUtils.import("resource:///modules/ABQueryUtils.jsm");
-var { MailServices } = ChromeUtils.import("resource:///modules/mailServices.js", null);
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
 ChromeUtils.import("resource://gre/modules/Preferences.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetters(this, {
   LightweightThemeManager: "resource://gre/modules/LightweightThemeManager.jsm",
 });
--- a/mail/components/compose/content/MsgComposeCommands.js
+++ b/mail/components/compose/content/MsgComposeCommands.js
@@ -9,17 +9,17 @@
 // Ensure the activity modules are loaded for this window.
 ChromeUtils.import("resource:///modules/activity/activityModules.js");
 ChromeUtils.import("resource:///modules/attachmentChecker.js");
 ChromeUtils.import("resource:///modules/cloudFileAccounts.js");
 ChromeUtils.import("resource:///modules/mimeParser.jsm");
 ChromeUtils.import("resource:///modules/errUtils.js");
 ChromeUtils.import("resource:///modules/folderUtils.jsm");
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/MailUtils.js");
 ChromeUtils.import("resource://gre/modules/InlineSpellChecker.jsm");
 ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 
 ChromeUtils.defineModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm");
--- a/mail/components/compose/content/addressingWidgetOverlay.js
+++ b/mail/components/compose/content/addressingWidgetOverlay.js
@@ -1,15 +1,15 @@
 /* -*- Mode: Javascript; tab-width: 2; 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/. */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 top.MAX_RECIPIENTS = 1; /* for the initial listitem created in the XUL */
 
 var inputElementType = "";
 var selectElementType = "";
 var selectElementIndexTable = null;
 
 var gNumberOfCols = 0;
--- a/mail/components/im/content/imAccountWizard.js
+++ b/mail/components/im/content/imAccountWizard.js
@@ -1,14 +1,14 @@
 /* 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/. */
 
 ChromeUtils.import("resource:///modules/imServices.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var PREF_EXTENSIONS_GETMOREPROTOCOLSURL = "extensions.getMoreProtocolsURL";
 
 var accountWizard = {
   onload: function aw_onload() {
     // Ensure the im core is initialized before we get a list of protocols.
     Services.core.init();
 
--- a/mail/components/im/content/imAccounts.js
+++ b/mail/components/im/content/imAccounts.js
@@ -1,15 +1,15 @@
 /* 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/. */
 
 ChromeUtils.import("resource:///modules/imServices.jsm");
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/DownloadUtils.jsm");
 
 // This is the list of notifications that the account manager window observes
 var events = [
   "prpl-quit",
   "account-list-updated",
   "account-added",
   "account-updated",
--- a/mail/components/im/modules/chatHandler.jsm
+++ b/mail/components/im/modules/chatHandler.jsm
@@ -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/. */
 
 this.EXPORTED_SYMBOLS = ["allContacts", "onlineContacts", "ChatCore"];
 
 ChromeUtils.import("resource:///modules/imServices.jsm");
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var allContacts = {};
 var onlineContacts = {};
 
 var ChatCore = {
   initialized: false,
   _initializing: false,
   init: function() {
--- a/mail/components/im/modules/index_im.js
+++ b/mail/components/im/modules/index_im.js
@@ -7,17 +7,17 @@ this.EXPORTED_SYMBOLS = [];
 var CC = Components.Constructor;
 
 ChromeUtils.import("resource:///modules/gloda/public.js");
 ChromeUtils.import("resource:///modules/gloda/datamodel.js");
 ChromeUtils.import("resource:///modules/gloda/indexer.js");
 ChromeUtils.import("resource:///modules/imServices.jsm");
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
 ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 ChromeUtils.defineModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm");
 ChromeUtils.defineModuleGetter(this, "Task", "resource://gre/modules/Task.jsm");
 ChromeUtils.defineModuleGetter(this, "AsyncShutdown",
                                "resource://gre/modules/AsyncShutdown.jsm");
--- a/mail/components/newmailaccount/content/accountProvisioner.js
+++ b/mail/components/newmailaccount/content/accountProvisioner.js
@@ -2,17 +2,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/. */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
 ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
 ChromeUtils.import("resource:///modules/StringBundle.js");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/gloda/log4moz.js");
 
 // Get a configured logger for this component.
 // To debug, set mail.provider.logging.dump (or .console)="All"
 var gLog = Log4Moz.getConfiguredLogger("mail.provider");
 var stringBundle = new StringBundle("chrome://messenger/locale/newmailaccount/accountProvisioner.properties");
 
 var isOSX = (Services.appinfo.OS == 'Darwin');
--- a/mail/components/nsMailDefaultHandler.js
+++ b/mail/components/nsMailDefaultHandler.js
@@ -1,17 +1,17 @@
 /* -*- 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/. */
 
 ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var nsISupports              = Ci.nsISupports;
 
 var nsICommandLine           = Ci.nsICommandLine;
 var nsICommandLineHandler    = Ci.nsICommandLineHandler;
 var nsICommandLineValidator  = Ci.nsICommandLineValidator;
 var nsIFactory               = Ci.nsIFactory;
 var nsIFileURL               = Ci.nsIFileURL;
--- a/mail/components/preferences/preferences.js
+++ b/mail/components/preferences/preferences.js
@@ -1,15 +1,15 @@
 /* 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/. */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 window.addEventListener("load", function () {
   let prefWindow = document.getElementById("MailPreferences");
   if (!Services.prefs.getBoolPref("mail.chat.enabled")) {
     let radio =
       document.getAnonymousElementByAttribute(prefWindow, "pane", "paneChat");
     if (radio.selected)
       prefWindow.showPane(document.getElementById("paneGeneral"));
--- a/mail/components/search/searchCommon.js
+++ b/mail/components/search/searchCommon.js
@@ -13,17 +13,17 @@
  * - gFileExt: the file extension to be used for support files
  * - gPrefBase: the base for preferences that are stored
  * - gStreamListener: an nsIStreamListener to read message text
  */
 #endif
 
 ChromeUtils.import("resource:///modules/gloda/log4moz.js");
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/MailUtils.js");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var PERM_DIRECTORY = parseInt("0755", 8);
 var PERM_FILE = parseInt("0644", 8);
 
 var SearchSupport =
 {
--- a/mail/components/test/unit/head_mailcomponents.js
+++ b/mail/components/test/unit/head_mailcomponents.js
@@ -1,10 +1,10 @@
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://testing-common/mailnews/mailTestUtils.js");
 
 var CC = Components.Constructor;
 
 // Ensure the profile directory is set up
 do_get_profile();
 
--- a/mail/extensions/mailviews/content/msgViewPickerOverlay.js
+++ b/mail/extensions/mailviews/content/msgViewPickerOverlay.js
@@ -1,13 +1,13 @@
 /* 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/. */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/mailViewManager.js");
 
 // these constants are now authoritatively defined in mailViewManager.js (above)
 // tag views have kViewTagMarker + their key as value
 var kViewItemAll         = MailViewConstants.kViewItemAll;
 var kViewItemUnread      = MailViewConstants.kViewItemUnread;
 var kViewItemTags        = MailViewConstants.kViewItemTags; // former labels used values 2-6
 var kViewItemNotDeleted  = MailViewConstants.kViewItemNotDeleted;
--- a/mail/extensions/smime/content/msgCompSMIMEOverlay.js
+++ b/mail/extensions/smime/content/msgCompSMIMEOverlay.js
@@ -1,15 +1,15 @@
 /* -*- Mode: Java; tab-width: 2; 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/. */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 // Account encryption policy values:
 // const kEncryptionPolicy_Never = 0;
 // 'IfPossible' was used by ns4.
 // const kEncryptionPolicy_IfPossible = 1;
 var kEncryptionPolicy_Always = 2;
 
 var gEncryptedURIService =
--- a/mail/test/mozmill/account/test-mail-account-setup-wizard.js
+++ b/mail/test/mozmill/account/test-mail-account-setup-wizard.js
@@ -4,17 +4,17 @@
 
 var MODULE_NAME = "test-mail-account-setup-wizard";
 
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
                        "account-manager-helpers", "keyboard-helpers"];
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var elib = {};
 ChromeUtils.import("chrome://mozmill/content/modules/elementslib.js", elib);
 
 var user = {
   name: "Yamato Nadeshiko",
   email: "yamato.nadeshiko@example.com",
   password: "abc12345",
--- a/mail/test/mozmill/addrbook/test-address-book.js
+++ b/mail/test/mozmill/addrbook/test-address-book.js
@@ -10,17 +10,17 @@ var MODULE_NAME = 'test-address-book';
 
 var RELATIVE_ROOT = '../shared-modules';
 var MODULE_REQUIRES = ['address-book-helpers', 'folder-display-helpers',
                        'compose-helpers', 'window-helpers',
                        'prompt-helpers'];
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var abController = null;
 var addrBook1, addrBook2, addrBook3, addrBook4;
 var mListA, mListB, mListC, mListD, mListE;
 var windowHelper;
 
 function setupModule(module)
 {
--- a/mail/test/mozmill/addrbook/test-update-mailing-list.js
+++ b/mail/test/mozmill/addrbook/test-update-mailing-list.js
@@ -8,17 +8,17 @@
  */
 
 var MODULE_NAME = 'test-update-mailing-list';
 
 var RELATIVE_ROOT = '../shared-modules';
 var MODULE_REQUIRES = ['address-book-helpers',
                        'folder-display-helpers',];
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 function setupModule(module) {
   collector.getModule('folder-display-helpers').installInto(module);
   collector.getModule('address-book-helpers').installInto(module);
 }
 
 function test_contact_in_mailing_list_updated() {
   const kOldAddress = "before@example.com";
--- a/mail/test/mozmill/cloudfile/test-cloudfile-attachment-urls.js
+++ b/mail/test/mozmill/cloudfile/test-cloudfile-attachment-urls.js
@@ -12,17 +12,17 @@ var RELATIVE_ROOT = '../shared-modules';
 var MODULE_REQUIRES = ['folder-display-helpers',
                        'compose-helpers',
                        'cloudfile-helpers',
                        'attachment-helpers',
                        'dom-helpers',
                        'window-helpers'];
 
 ChromeUtils.import('resource://gre/modules/Services.jsm');
-ChromeUtils.import('resource:///modules/mailServices.js');
+ChromeUtils.import('resource:///modules/MailServices.jsm');
 
 var kUploadedFile = "attachment-uploaded";
 var kHtmlPrefKey = "mail.identity.default.compose_html";
 var kReplyOnTopKey = "mail.identity.default.reply_on_top";
 var kReplyOnTop = 1;
 var kReplyOnBottom = 0;
 var kTextNodeType = 3;
 var kSigPrefKey = "mail.identity.id1.htmlSigText";
--- a/mail/test/mozmill/composition/test-attachment-reminder.js
+++ b/mail/test/mozmill/composition/test-attachment-reminder.js
@@ -13,17 +13,17 @@ var MODULE_NAME = "test-attachment-remin
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers",
                          "compose-helpers",
                          "window-helpers",
                          "notificationbox-helpers",
                          "keyboard-helpers"];
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var kBoxId = "attachmentNotificationBox";
 var kNotificationId = "attachmentReminder";
 var kReminderPref = "mail.compose.attachment_reminder";
 var gDrafts;
 var gOutbox;
 
 function setupModule(module) {
--- a/mail/test/mozmill/composition/test-blocked-content.js
+++ b/mail/test/mozmill/composition/test-blocked-content.js
@@ -16,17 +16,17 @@ var MODULE_REQUIRES = [
    "window-helpers",
    "compose-helpers",
    "notificationbox-helpers"
 ];
 
 var os = {};
 ChromeUtils.import("chrome://mozmill/content/stdlib/os.js", os);
 ChromeUtils.import('resource://gre/modules/Services.jsm');
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/osfile.jsm");
 
 var gOutboxFolder;
 
 var kBoxId = "attachmentNotificationBox";
 var kNotificationId = "blockedContent";
 
 function setupModule(module) {
--- a/mail/test/mozmill/composition/test-charset-edit.js
+++ b/mail/test/mozmill/composition/test-charset-edit.js
@@ -13,17 +13,17 @@ var MODULE_NAME = "test-charset-edit";
 
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers",
                        "window-helpers", "notificationbox-helpers"];
 
 var os = {};
 ChromeUtils.import("chrome://mozmill/content/stdlib/os.js", os);
 ChromeUtils.import('resource://gre/modules/Services.jsm');
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/mimeParser.jsm");
 var elib = {};
 ChromeUtils.import("chrome://mozmill/content/modules/elementslib.js", elib);
 var utils = {};
 ChromeUtils.import("chrome://mozmill/content/modules/utils.js", utils);
 
 var gDrafts;
 
--- a/mail/test/mozmill/composition/test-charset-upgrade.js
+++ b/mail/test/mozmill/composition/test-charset-upgrade.js
@@ -10,17 +10,17 @@
 // make SOLO_TEST=composition/test-charset-upgrade.js mozmill-one
 
 var MODULE_NAME = "test-charset-upgrade";
 
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "compose-helpers"];
 
 ChromeUtils.import('resource://gre/modules/Services.jsm');
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var gDrafts;
 var gOutbox;
 
 function setupModule(module) {
   for (let req of MODULE_REQUIRES) {
     collector.getModule(req).installInto(module);
   }
--- a/mail/test/mozmill/composition/test-draft-identity.js
+++ b/mail/test/mozmill/composition/test-draft-identity.js
@@ -10,17 +10,17 @@
 // make SOLO_TEST=composition/test-draft-identity.js mozmill-one
 
 var MODULE_NAME = "test-draft-identity";
 
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
                        "compose-helpers", "notificationbox-helpers"];
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
 
 var gDrafts;
 var gAccount;
 
 // The first identity should become the default in the account.
 var gIdentities = [ { email: "x@example.invalid" },
                     { email: "y@example.invalid", fullname: "User Y" },
--- a/mail/test/mozmill/composition/test-drafts.js
+++ b/mail/test/mozmill/composition/test-drafts.js
@@ -11,17 +11,17 @@
 
 var MODULE_NAME = "test-drafts";
 
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers",
                        "window-helpers", "notificationbox-helpers"];
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var kBoxId = "msgNotificationBar";
 var draftsFolder;
 
 function setupModule(module) {
   for (let lib of MODULE_REQUIRES) {
     collector.getModule(lib).installInto(module);
   }
--- a/mail/test/mozmill/composition/test-eml-actions.js
+++ b/mail/test/mozmill/composition/test-eml-actions.js
@@ -10,17 +10,17 @@
 
 var MODULE_NAME = "test-eml-actions";
 
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "compose-helpers"];
 
 var os = {};
 ChromeUtils.import("chrome://mozmill/content/stdlib/os.js", os);
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 var elib = {};
 ChromeUtils.import("chrome://mozmill/content/modules/elementslib.js", elib);
 
 var gDrafts;
 
 function setupModule(module) {
   for (let lib of MODULE_REQUIRES) {
     collector.getModule(lib).installInto(module);
--- a/mail/test/mozmill/composition/test-forward-rfc822-attach.js
+++ b/mail/test/mozmill/composition/test-forward-rfc822-attach.js
@@ -10,17 +10,17 @@
 // mozmake SOLO_TEST=composition/test-forward-rfc822-attach.js mozmill-one
 
 var MODULE_NAME = "test-forward-rfc822-attach";
 
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers"];
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 var os = {};
 ChromeUtils.import("chrome://mozmill/content/stdlib/os.js", os);
 
 var gDrafts;
 
 function setupModule(module) {
   for (let lib of MODULE_REQUIRES) {
     collector.getModule(lib).installInto(module);
--- a/mail/test/mozmill/composition/test-forward-utf8.js
+++ b/mail/test/mozmill/composition/test-forward-utf8.js
@@ -9,17 +9,17 @@
 // mozmake SOLO_TEST=composition/test-forward-utf8.js mozmill-one
 
 var MODULE_NAME = "test-forward-utf8";
 
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers"];
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 var elib = {};
 ChromeUtils.import("chrome://mozmill/content/modules/elementslib.js", elib);
 var os = {};
 ChromeUtils.import("chrome://mozmill/content/stdlib/os.js", os);
 
 var folderToSendFrom;
 
 function setupModule(module) {
--- a/mail/test/mozmill/composition/test-forwarded-eml-actions.js
+++ b/mail/test/mozmill/composition/test-forwarded-eml-actions.js
@@ -10,17 +10,17 @@
 // make SOLO_TEST=composition/test-forwarded-eml-actions.js mozmill-one
 
 var MODULE_NAME = "test-forwarded-eml-actions";
 
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
                          "compose-helpers"];
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 var elib = {};
 ChromeUtils.import("chrome://mozmill/content/modules/elementslib.js", elib);
 
 var folder;
 
 var msgsubject = "mail client suggestions";
 var msgbodyA = "know of a good email client?";
 var msgbodyB = "hi, i think you may know of an email client to recommend?";
--- a/mail/test/mozmill/composition/test-multipart-related.js
+++ b/mail/test/mozmill/composition/test-multipart-related.js
@@ -11,17 +11,17 @@
 var MODULE_NAME = "test-multipart-related";
 
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "compose-helpers"];
 
 var os = {};
 ChromeUtils.import("chrome://mozmill/content/stdlib/os.js", os);
 ChromeUtils.import('resource://gre/modules/Services.jsm');
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/mimeParser.jsm");
 var elib = {};
 ChromeUtils.import("chrome://mozmill/content/modules/elementslib.js", elib);
 var utils = {};
 ChromeUtils.import("chrome://mozmill/content/modules/utils.js", utils);
 
 var gDrafts;
 
--- a/mail/test/mozmill/composition/test-newmsg-compose-identity.js
+++ b/mail/test/mozmill/composition/test-newmsg-compose-identity.js
@@ -8,17 +8,17 @@
  */
 
 var MODULE_NAME = "test-newmsg-compose-identity";
 
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers",
                        "window-helpers", "compose-helpers"];
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var gInbox;
 var gDrafts;
 var account;
 
 var identityKey1;
 var identity1Email = "x@example.invalid";
 var identityKey2;
--- a/mail/test/mozmill/composition/test-reply-addresses.js
+++ b/mail/test/mozmill/composition/test-reply-addresses.js
@@ -20,17 +20,17 @@ var folder;
 var i = 0;
 
 var myEmail = "me@example.com";
 var myEmail2 = "otherme@example.com";
 
 var identity;
 var identity2;
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 function setupModule(module) {
   collector.getModule("folder-display-helpers").installInto(module);
   collector.getModule("window-helpers").installInto(module);
   collector.getModule("compose-helpers").installInto(module);
 
   // Now set up an account with some identities.
   let acctMgr = MailServices.accounts;
--- a/mail/test/mozmill/composition/test-reply-format-flowed.js
+++ b/mail/test/mozmill/composition/test-reply-format-flowed.js
@@ -9,17 +9,17 @@
 // make SOLO_TEST=composition/test-reply-format-flowed.js mozmill-one
 
 var MODULE_NAME = "test-reply-format-flowed";
 
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers"];
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var os = {};
 ChromeUtils.import("chrome://mozmill/content/stdlib/os.js", os);
 
 var gDrafts;
 
 function setupModule(module) {
   for (let lib of MODULE_REQUIRES) {
--- a/mail/test/mozmill/content-policy/test-general-content-policy.js
+++ b/mail/test/mozmill/content-policy/test-general-content-policy.js
@@ -28,17 +28,17 @@ var MODULE_REQUIRES = ['folder-display-h
                          'notificationbox-helpers'];
 
 var elib = {};
 ChromeUtils.import("chrome://mozmill/content/modules/elementslib.js", elib);
 var os = {};
 ChromeUtils.import("chrome://mozmill/content/stdlib/os.js", os);
 
 ChromeUtils.import('resource://gre/modules/Services.jsm');
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var folder = null;
 var gMsgNo = 0;
 
 // RELATIVE_ROOT messes with the collector, so we have to bring the path back
 // so we get the right path for the resources.
 var url = collector.addHttpResource('../content-policy/html', 'content');
 
--- a/mail/test/mozmill/folder-display/test-message-commands-on-msgstore.js
+++ b/mail/test/mozmill/folder-display/test-message-commands-on-msgstore.js
@@ -11,17 +11,17 @@
 var MODULE_NAME = "test-message-commands-on-msgstore";
 
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers",
                          "compose-helpers",
                          "window-helpers"];
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/IOUtils.js");
 
 var statusHeader = "X-Mozilla-Status: ";
 var nsMsgMessageFlags = Ci.nsMsgMessageFlags;
 
 var gInbox;
 var gOutbox;
 var gAutoRead;
--- a/mail/test/mozmill/folder-display/test-recent-menu.js
+++ b/mail/test/mozmill/folder-display/test-recent-menu.js
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * This tests the move/copy to recent folder menus to make sure
  * that they get updated when messages are moved to folders, and
  * don't get updated when we archive.
  */
 ChromeUtils.import("resource:///modules/MailUtils.js");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var MODULE_NAME = 'test-recent-menu';
 
 var RELATIVE_ROOT = '../shared-modules';
 var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
 
 var folder1, folder2;
 var gInitRecentMenuCount;
--- a/mail/test/mozmill/folder-pane/test-folder-pane-consumers.js
+++ b/mail/test/mozmill/folder-pane/test-folder-pane-consumers.js
@@ -7,17 +7,17 @@
  */
 
 var MODULE_NAME = 'test-folder-pane';
 
 var RELATIVE_ROOT = '../shared-modules';
 var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
                        "nntp-helpers"];
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var nntpAccount;
 
 function setupModule(module) {
   for (let lib of MODULE_REQUIRES) {
     collector.getModule(lib).installInto(module);
   }
 
--- a/mail/test/mozmill/folder-pane/test-folder-pane.js
+++ b/mail/test/mozmill/folder-pane/test-folder-pane.js
@@ -8,17 +8,17 @@
  * there don't influence the results here.
  */
 
 var MODULE_NAME = 'test-folder-pane';
 
 var RELATIVE_ROOT = '../shared-modules';
 var MODULE_REQUIRES = ['folder-display-helpers'];
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 function setupModule(module) {
   collector.getModule('folder-display-helpers').installInto(module);
 }
 
 /**
  * Assert the Folder Pane is in All Folder mode by default.  Check that the
  * correct number of rows for accounts and folders are always shown as new
--- a/mail/test/mozmill/folder-tree-modes/test-extension/bootstrap.js
+++ b/mail/test/mozmill/folder-tree-modes/test-extension/bootstrap.js
@@ -23,17 +23,17 @@ function startup(data, reason) {
 function shutdown(data, reason) {
   ExtensionSupport.unregisterWindowListener(data.id);
 }
 
 function setupFolderMode(aWindow) {
   let testFolderTreeMode = {
     __proto__: aWindow.IFolderTreeMode,
     generateMap: function(aFTV) {
-      ChromeUtils.import("resource:///modules/mailServices.js");
+      ChromeUtils.import("resource:///modules/MailServices.jsm");
       // Pick the tinderbox@foo.invalid inbox and use it as the only folder
       let server = MailServices.accounts.FindServer("tinderbox", "tinderbox123", "pop3");
       let item = new aWindow.ftvItem(server.rootFolder.getChildNamed("Inbox"));
       item.__defineGetter__("children", () => []);
       return [item];
     },
   };
 
--- a/mail/test/mozmill/message-header/test-message-header.js
+++ b/mail/test/mozmill/message-header/test-message-header.js
@@ -12,17 +12,17 @@
 var MODULE_NAME = 'test-message-header';
 
 var RELATIVE_ROOT = '../shared-modules';
 var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers',
                        'address-book-helpers', 'dom-helpers'];
 
 var elib = {};
 ChromeUtils.import("chrome://mozmill/content/modules/elementslib.js", elib);
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var folder, folderMore;
 var gInterestingMessage;
 
 function setupModule(module) {
   let fdh = collector.getModule('folder-display-helpers');
   fdh.installInto(module);
--- a/mail/test/mozmill/message-window/test-commands.js
+++ b/mail/test/mozmill/message-window/test-commands.js
@@ -2,17 +2,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/. */
 
 var MODULE_NAME = "test-commands";
 
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 var elib = {};
 ChromeUtils.import("chrome://mozmill/content/modules/elementslib.js", elib);
 var os = {};
 ChromeUtils.import("chrome://mozmill/content/stdlib/os.js", os);
 
 var folder1, folder2;
 
 var setupModule = function(module) {
--- a/mail/test/mozmill/multiple-identities/test-display-names.js
+++ b/mail/test/mozmill/multiple-identities/test-display-names.js
@@ -6,17 +6,17 @@
  * Test that we can open and close a standalone message display window from the
  *  folder pane.
  */
 var MODULE_NAME = "test-display-names";
 
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "address-book-helpers"];
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var folder;
 var decoyFolder;
 var localAccount;
 var secondIdentity;
 var myEmail = "sender@nul.invalid"; // Dictated by messagerInjector.js
 var friendEmail = "carl@sagan.invalid";
--- a/mail/test/mozmill/newmailaccount/test-newmailaccount.js
+++ b/mail/test/mozmill/newmailaccount/test-newmailaccount.js
@@ -15,17 +15,17 @@ var MODULE_REQUIRES = ['folder-display-h
                        'newmailaccount-helpers',
                        'keyboard-helpers',
                        'dom-helpers'];
 
 var elib = {};
 ChromeUtils.import("chrome://mozmill/content/modules/elementslib.js", elib);
 ChromeUtils.import('resource://gre/modules/Services.jsm');
 ChromeUtils.import('resource:///modules/iteratorUtils.jsm');
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("chrome://mozmill/content/stdlib/httpd.js");
 
 // RELATIVE_ROOT messes with the collector, so we have to bring the path back
 // so we get the right path for the resources.
 var url = collector.addHttpResource('../newmailaccount/html', '');
 var kProvisionerUrl = "chrome://messenger/content/newmailaccount/accountProvisioner.xhtml";
 var kProvisionerEnabledPref = "mail.provider.enabled";
 var kSuggestFromNamePref = "mail.provider.suggestFromName";
--- a/mail/test/mozmill/notification/test-notification.js
+++ b/mail/test/mozmill/notification/test-notification.js
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var MODULE_NAME = 'test-notifications';
 
 var RELATIVE_ROOT = '../shared-modules';
 var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 // Our global folder variables...
 var gFolder = null;
 var gFolder2 = null;
 
 // An object to keep track of the boolean preferences we change, so that
 // we can put them back.
--- a/mail/test/mozmill/shared-modules/test-address-book-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-address-book-helpers.js
@@ -2,17 +2,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/. */
 
 var MODULE_NAME = "address-book-helpers";
 
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var ABMDB_PREFIX = "moz-abmdbdirectory://";
 var ABLDAP_PREFIX = "moz-abldapdirectory://";
 
 var collectedAddresses;
 
 var abController;
--- a/mail/test/mozmill/shared-modules/test-folder-display-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-folder-display-helpers.js
@@ -18,17 +18,17 @@ var os = {};
 ChromeUtils.import("chrome://mozmill/content/stdlib/os.js", os);
 var utils = {};
 ChromeUtils.import("chrome://mozmill/content/modules/utils.js", utils);
 
 ChromeUtils.import("resource:///modules/gloda/log4moz.js");
 
 var nsMsgViewIndex_None = 0xffffffff;
 ChromeUtils.import('resource:///modules/MailConsts.js');
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import('resource:///modules/MailUtils.js');
 ChromeUtils.import('resource:///modules/mailViewManager.js');
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var FILE_LOAD_PATHS = [
   "../",
   "../../",
   "../../../../mailnews/test/",
--- a/mail/test/mozmill/shared-modules/test-newmailaccount-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-newmailaccount-helpers.js
@@ -7,17 +7,17 @@ var MODULE_NAME = "newmailaccount-helper
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "keyboard-helpers",
                        "dom-helpers"];
 
 var elib = {};
 ChromeUtils.import("chrome://mozmill/content/modules/elementslib.js", elib);
 ChromeUtils.import('resource://gre/modules/Services.jsm');
 ChromeUtils.import('resource:///modules/iteratorUtils.jsm');
-ChromeUtils.import('resource:///modules/mailServices.js');
+ChromeUtils.import('resource:///modules/MailServices.jsm');
 ChromeUtils.import('resource://gre/modules/XPCOMUtils.jsm');
 
 var mc, fdh, kbh, dh;
 
 function setupModule(module) {
   fdh = collector.getModule('folder-display-helpers');
   fdh.installInto(module);
   kbh = collector.getModule('keyboard-helpers');
--- a/mail/test/mozmill/shared-modules/test-nntp-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-nntp-helpers.js
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var MODULE_NAME = "nntp-helpers";
 
 var RELATIVE_ROOT = "../shared-modules";
 var MODULES_REQUIRES = ["folder-display-helpers", "window-helpers"];
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var kSimpleNewsArticle =
   "From: John Doe <john.doe@example.com>\n"+
   "Date: Sat, 24 Mar 1990 10:59:24 -0500\n"+
   "Newsgroups: test.subscribe.simple\n"+
   "Subject: H2G2 -- What does it mean?\n"+
   "Message-ID: <TSS1@nntp.invalid>\n"+
   "\n"+
--- a/mailnews/addrbook/content/abAddressBookNameDialog.js
+++ b/mailnews/addrbook/content/abAddressBookNameDialog.js
@@ -1,13 +1,13 @@
 /* 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/. */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var gOkButton;
 var gNameInput;
 var gDirectory = null;
 
 var kPersonalAddressbookURI = "moz-abmdbdirectory://abook.mab";
--- a/mailnews/addrbook/content/addrbookWidgets.xml
+++ b/mailnews/addrbook/content/addrbookWidgets.xml
@@ -17,17 +17,17 @@
       <!-- Represents the nsIAbDirectory attribute used as the value of the
            parent menulist. Defaults to URI but can be e.g. dirPrefId -->
       <field name="_value">this.getAttribute("value") || "URI"</field>
 
       <field name="_stringBundle">null</field>
 
       <constructor>
         <![CDATA[
-          ChromeUtils.import("resource:///modules/mailServices.js", this);
+          ChromeUtils.import("resource:///modules/MailServices.jsm", this);
           ChromeUtils.import("resource:///modules/iteratorUtils.jsm", this);
           ChromeUtils.import("resource:///modules/StringBundle.js", this);
           this._stringBundle = new this
               .StringBundle("chrome://messenger/locale/addressbook/addressBook.properties");
 
           this._rebuild();
           const nsIAbListener = Ci.nsIAbListener;
           // Add a listener so we can update correctly if the list should change
--- a/mailnews/addrbook/prefs/content/pref-directory-add.js
+++ b/mailnews/addrbook/prefs/content/pref-directory-add.js
@@ -1,16 +1,16 @@
 /* -*- Mode: Java; 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/. */
 
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/hostnameUtils.jsm");
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
 
 var gCurrentDirectory = null;
 var gReplicationBundle = null;
 var gReplicationService =
   Cc["@mozilla.org/addressbook/ldap-replication-service;1"].
              getService(Ci.nsIAbLDAPReplicationService);
--- a/mailnews/addrbook/prefs/content/pref-editdirectories.js
+++ b/mailnews/addrbook/prefs/content/pref-editdirectories.js
@@ -1,15 +1,15 @@
 /* -*- Mode: Java; tab-width: 2; 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/. */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 // Listener to refresh the list items if something changes. In all these
 // cases we just rebuild the list as it is easier than searching/adding in the
 // correct places an would be an infrequent operation.
 var gAddressBookAbListener = {
   onItemAdded: function(parentDir, item) {
     if (item instanceof Ci.nsIAbDirectory) {
       fillDirectoryList();
--- a/mailnews/addrbook/src/nsAbAutoCompleteMyDomain.js
+++ b/mailnews/addrbook/src/nsAbAutoCompleteMyDomain.js
@@ -1,13 +1,13 @@
 /* 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/. */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 function nsAbAutoCompleteMyDomain() {}
 
 nsAbAutoCompleteMyDomain.prototype = {
   classID: Components.ID("{5b259db2-e451-4de9-8a6f-cfba91402973}"),
   QueryInterface: ChromeUtils.generateQI([
       Ci.nsIAutoCompleteSearch]),
--- a/mailnews/addrbook/src/nsAbAutoCompleteSearch.js
+++ b/mailnews/addrbook/src/nsAbAutoCompleteSearch.js
@@ -1,14 +1,14 @@
 /* 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/. */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/ABQueryUtils.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 var ACR = Ci.nsIAutoCompleteResult;
 var nsIAbAutoCompleteResult = Ci.nsIAbAutoCompleteResult;
 
 function nsAbAutoCompleteResult(aSearchString) {
   // Can't create this in the prototype as we'd get the same array for
--- a/mailnews/addrbook/src/nsAbLDAPAutoCompleteSearch.js
+++ b/mailnews/addrbook/src/nsAbLDAPAutoCompleteSearch.js
@@ -1,14 +1,14 @@
 /* -*- Mode: Java; tab-width: 2; 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/. */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 var ACR = Ci.nsIAutoCompleteResult;
 var nsIAbAutoCompleteResult = Ci.nsIAbAutoCompleteResult;
 var nsIAbDirectoryQueryResultListener =
   Ci.nsIAbDirectoryQueryResultListener;
 
--- a/mailnews/addrbook/test/unit/head_addrbook.js
+++ b/mailnews/addrbook/test/unit/head_addrbook.js
@@ -1,10 +1,10 @@
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 var CC = Components.Constructor;
 
 // Ensure the profile directory is set up
 do_get_profile();
 
 // Import the required setup scripts.
--- a/mailnews/base/content/folderWidgets.xml
+++ b/mailnews/base/content/folderWidgets.xml
@@ -12,17 +12,17 @@
 
   <binding id="folder-menupopup"
            extends="chrome://global/content/bindings/popup.xml#popup">
     <implementation>
       <constructor><![CDATA[
         ChromeUtils.import("resource:///modules/FeedUtils.jsm", this);
         ChromeUtils.import("resource:///modules/folderUtils.jsm", this);
         ChromeUtils.import("resource:///modules/iteratorUtils.jsm", this);
-        ChromeUtils.import("resource:///modules/mailServices.js", this);
+        ChromeUtils.import("resource:///modules/MailServices.jsm", this);
         ChromeUtils.import("resource:///modules/MailUtils.js", this);
         ChromeUtils.import("resource:///modules/StringBundle.js", this);
         this._stringBundle = new this
             .StringBundle("chrome://messenger/locale/folderWidgets.properties");
 
         // Get the displayformat if set.
         if (this.parentNode && this.parentNode.localName == "menulist")
           this._displayformat = this.parentNode.getAttribute("displayformat");
--- a/mailnews/base/content/junkCommands.js
+++ b/mailnews/base/content/junkCommands.js
@@ -20,17 +20,17 @@
   *   gDBView
   *   either gMsgFolderSelected or gFolderDisplay
   *   MsgJunkMailInfo(aCheckFirstUse)
   *   SetNextMessageAfterDelete()
   *   pref
   *   msgWindow
   */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/MailUtils.js");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 /*
  * determineActionsForJunkMsgs
  *
  * Determines the actions that should be carried out on the messages
  * that are being marked as junk
--- a/mailnews/base/content/virtualFolderProperties.js
+++ b/mailnews/base/content/virtualFolderProperties.js
@@ -9,17 +9,17 @@ var msgWindow; // important, don't chang
 var gSearchTermSession; // really an in memory temporary filter we use to read in and write out the search terms
 var gSearchFolderURIs = "";
 var gMessengerBundle = null;
 
 var nsMsgSearchScope = Ci.nsMsgSearchScope;
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/virtualFolderWrapper.js");
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
 ChromeUtils.import("resource:///modules/MailUtils.js");
 
 function onLoad()
 {
   var windowArgs = window.arguments[0];
   var acceptButton = document.documentElement.getButton("accept");
--- a/mailnews/base/prefs/content/AccountManager.js
+++ b/mailnews/base/prefs/content/AccountManager.js
@@ -23,17 +23,17 @@
  * - in the IFRAME inside the page, if there is an onInit() method,
  *   it is called. The onInit method can further update this page based
  *   on values set in the previous step.
  */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/BrowserUtils.jsm");
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/folderUtils.jsm");
 ChromeUtils.import("resource:///modules/hostnameUtils.jsm");
 
 // If Local directory has changed the app needs to restart. Once this is set
 // a restart will be attempted at each attempt to close the Account manager with OK.
 var gRestartNeeded = false;
 
 // This is a hash-map for every account we've touched in the pane. Each entry
--- a/mailnews/base/prefs/content/AccountWizard.js
+++ b/mailnews/base/prefs/content/AccountWizard.js
@@ -35,17 +35,17 @@ var okCallback = null;
 
    accounttype -> identity -> server -> login -> accname -> done
                              \-> newsserver ----/
 
    where the accounttype determines which path to take
    (server vs. newsserver)
 */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var contentWindow;
 
 var gPageData;
 
 var nsIMsgIdentity = Ci.nsIMsgIdentity;
 var nsIMsgIncomingServer = Ci.nsIMsgIncomingServer;
 var gPrefsBundle, gMessengerBundle;
--- a/mailnews/base/prefs/content/SmtpServerEdit.js
+++ b/mailnews/base/prefs/content/SmtpServerEdit.js
@@ -1,16 +1,16 @@
 /* -*- Mode: Java; tab-width: 2; 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/. */
 
 ChromeUtils.import("resource:///modules/hostnameUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var gSmtpServer;
 var gSmtpUsername;
 var gSmtpDescription;
 var gSmtpUsernameLabel;
 var gSmtpHostname;
 var gSmtpPort;
 var gSmtpAuthMethod;
--- a/mailnews/base/prefs/content/accountUtils.js
+++ b/mailnews/base/prefs/content/accountUtils.js
@@ -1,16 +1,16 @@
 /* -*- Mode: Java; 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/. */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var gAnyValidIdentity = false; //If there are no valid identities for any account
 // returns the first account with an invalid server or identity
 
 var gNewAccountToLoad = null;   // used to load new messages if we come from the mail3pane
 
 function getInvalidAccounts(accounts)
 {
--- a/mailnews/base/prefs/content/am-identity-edit.js
+++ b/mailnews/base/prefs/content/am-identity-edit.js
@@ -1,14 +1,14 @@
 /* -*- Mode: Java; tab-width: 2; 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/. */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var gIdentity = null;  // the identity we are editing (may be null for a new identity)
 var gAccount = null;   // the account the identity is (or will be) associated with
 
 function onLoadIdentityProperties()
 {
   // extract the account
--- a/mailnews/base/prefs/content/am-junk.js
+++ b/mailnews/base/prefs/content/am-junk.js
@@ -1,14 +1,14 @@
 /* -*- Mode: Java; tab-width: 2; 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/.
  */
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
 ChromeUtils.import("resource:///modules/MailUtils.js");
 
 var gDeferredToAccount = "";
 
 function onInit(aPageId, aServerId)
 {
   // manually adjust several pref UI elements
--- a/mailnews/base/prefs/content/am-server-advanced.js
+++ b/mailnews/base/prefs/content/am-server-advanced.js
@@ -1,14 +1,14 @@
 /* -*- Mode: Java; tab-width: 2; 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/. */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 // pull stuff out of window.arguments
 var gServerSettings = window.arguments[0];
 
 var gFirstDeferredAccount;
 // initialize the controls with the "gServerSettings" argument
 
--- a/mailnews/base/prefs/content/am-smtp.js
+++ b/mailnews/base/prefs/content/am-smtp.js
@@ -1,15 +1,15 @@
 /* -*- Mode: Java; 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/. */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var gSmtpServerListWindow =
 {
   mBundle: null,
   mServerList: null,
   mAddButton: null,
   mEditButton: null,
   mDeleteButton: null,
--- a/mailnews/base/prefs/content/amUtils.js
+++ b/mailnews/base/prefs/content/amUtils.js
@@ -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/. */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/MailUtils.js");
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
 
 function BrowseForLocalFolders()
 {
   const nsIFilePicker = Ci.nsIFilePicker;
   const nsIFile = Ci.nsIFile;
 
--- a/mailnews/base/prefs/content/aw-done.js
+++ b/mailnews/base/prefs/content/aw-done.js
@@ -1,14 +1,14 @@
 /* -*- 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/. */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var gPrefsBundle;
 
 function donePageInit() {
     var pageData = parent.GetPageData();
     var currentAccountData = gCurrentAccountData;
 
     if ("testingIspServices" in this) {
--- a/mailnews/base/prefs/content/aw-outgoing.js
+++ b/mailnews/base/prefs/content/aw-outgoing.js
@@ -1,15 +1,15 @@
 /* -*- Mode: Java; tab-width: 2; 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/. */
 
 ChromeUtils.import("resource:///modules/hostnameUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var gProtocolInfo = null;
 var gPrefsBundle;
 
 function outgoingPageValidate() {
   let canAdvance = true;
 
   let smtpServer = document.getElementById("smtphostname").value;
--- a/mailnews/base/prefs/content/removeAccount.js
+++ b/mailnews/base/prefs/content/removeAccount.js
@@ -1,14 +1,14 @@
 /* -*- Mode: Java; tab-width: 2; 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/. */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var gServer;
 var gDialog;
 
 function onLoad(event) {
   gServer = window.arguments[0].account.incomingServer;
   gDialog = document.documentElement;
--- a/mailnews/base/search/content/FilterEditor.js
+++ b/mailnews/base/search/content/FilterEditor.js
@@ -1,15 +1,15 @@
 /* -*- Mode: Java; tab-width: 2; 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/. */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/MailUtils.js");
 
 // The actual filter that we're editing if it is a _saved_ filter or prefill;
 // void otherwise.
 var gFilter;
 // cache the key elements we need
 var gFilterList;
 // The filter name as it appears in the "Filter Name" field of dialog.
--- a/mailnews/base/src/newMailNotificationService.js
+++ b/mailnews/base/src/newMailNotificationService.js
@@ -9,17 +9,17 @@
  * Logging for this module uses the TB version of log4moz. Default logging is at the Warn
  * level. Other possibly interesting messages are at Error, Info and Debug. To configure, set the
  * preferences "mail.notification.logging.console" (for the error console) or
  * "mail.notification.logging.dump" (for stderr) to the string indicating the level you want.
  */
 
 ChromeUtils.import("resource:///modules/gloda/log4moz.js");
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 var NMNS = Ci.mozINewMailNotificationService;
 
 var countInboxesPref = "mail.notification.count.inbox_only";
 // Old name for pref
 var countNewMessagesPref = "mail.biff.use_new_count_in_mac_dock";
--- a/mailnews/base/src/virtualFolderWrapper.js
+++ b/mailnews/base/src/virtualFolderWrapper.js
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Wrap everything about virtual folders.
  */
 
 this.EXPORTED_SYMBOLS = ['VirtualFolderHelper'];
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
 
 var VirtualFolderHelper = {
   /**
    * Create a new virtual folder (an actual nsIMsgFolder that did not previously
    *  exist), wrapping it in a VirtualFolderWrapper, and returning that wrapper.
    *
    * If the call to addSubfolder fails (and therefore throws), we will NOT catch
--- a/mailnews/base/test/unit/head_mailbase.js
+++ b/mailnews/base/test/unit/head_mailbase.js
@@ -1,10 +1,10 @@
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://testing-common/mailnews/mailTestUtils.js");
 ChromeUtils.import("resource://testing-common/mailnews/localAccountUtils.js");
 
 var CC = Components.Constructor;
 
 // Ensure the profile directory is set up
 do_get_profile();
--- a/mailnews/base/test/unit/test_accountMgr.js
+++ b/mailnews/base/test/unit/test_accountMgr.js
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * This tests that we cleanup the account prefs when the account manager is
  * loaded. This entails removing duplicate accounts from
  * mail.accountmanager.accounts list, and removing duplicate accounts with
  * the same server.
  */
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 function run_test()
 {
   // Create account prefs with both kinds of duplication.
 
   Services.prefs.setCharPref("mail.account.account1.identities", "id1");
   Services.prefs.setCharPref("mail.account.account1.server", "server1");
   Services.prefs.setCharPref("mail.account.account2.identities", "id2");
--- a/mailnews/base/test/unit/test_acctRepair.js
+++ b/mailnews/base/test/unit/test_acctRepair.js
@@ -2,17 +2,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/. */
 
 /**
  * This tests that we recover from having a local folders server
  * without having an account that points at it.
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 function run_test()
 {
   // Create account prefs with both kinds of duplication.
 
   Services.prefs.setCharPref("mail.account.account2.identities", "id2");
   Services.prefs.setCharPref("mail.account.account2.server", "server1");
   Services.prefs.setCharPref("mail.account.account6.identities", "id3");
--- a/mailnews/base/test/unit/test_bccInDatabase.js
+++ b/mailnews/base/test/unit/test_bccInDatabase.js
@@ -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/. */
 
 /*
  * Testing of bcc in message summary file added in bug 481667
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var hdr;
 
 function run_test()
 {
   localAccountUtils.loadLocalMailAccount();
 
   var copyListener =
--- a/mailnews/base/test/unit/test_bug366491.js
+++ b/mailnews/base/test/unit/test_bug366491.js
@@ -4,17 +4,17 @@
 
 // tests return of junk percent from bayesian filter
 
 // main setup
 
 // only needed during debug
 //do_import_script("mailnews/extensions/bayesian-spam-filter/test/resources/trainingfile.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 // local constants
 var kUnclassified = MailServices.junk.UNCLASSIFIED;
 var kJunk = MailServices.junk.JUNK;
 var kGood = MailServices.junk.GOOD;
 
 /*
  * This test is not intended to check the spam calculations,
--- a/mailnews/base/test/unit/test_bug404489.js
+++ b/mailnews/base/test/unit/test_bug404489.js
@@ -1,15 +1,15 @@
 /* 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/. */
 
 // Tests that custom headers like "Sender" work (bug 404489)
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var nsMsgSearchScope = Ci.nsMsgSearchScope;
 var nsMsgSearchAttrib = Ci.nsMsgSearchAttrib;
 var nsMsgSearchOp = Ci.nsMsgSearchOp;
 var Contains = nsMsgSearchOp.Contains;
 var offlineMail = nsMsgSearchScope.offlineMail;
 var gArrayHdrs = ["X-Bugzilla-Who", "Sender"];
 var gFirstHeader = nsMsgSearchAttrib.OtherHeader + 1;
--- a/mailnews/base/test/unit/test_bug428427.js
+++ b/mailnews/base/test/unit/test_bug428427.js
@@ -1,15 +1,15 @@
 /* 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/. */
 
 // Test of message count changes in virtual folder views
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var dbviewContractId = "@mozilla.org/messenger/msgdbview;1?type=" + "quicksearch";
 var dbView = Cc[dbviewContractId].createInstance(Ci.nsIMsgDBView);
 var bugmail1 = do_get_file("../../../data/bugmail1");
 // main test
 
 // the headers for the test messages. All messages are identical, but
 // have different properties set on them.
--- a/mailnews/base/test/unit/test_bug465805.js
+++ b/mailnews/base/test/unit/test_bug465805.js
@@ -2,17 +2,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/. */
 
 // This tests that we do not crash when loading the email bodySearchCrash,
 // which was fixed in bug 465805
 
 load("../../../resources/searchTestUtils.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var nsMsgSearchScope = Ci.nsMsgSearchScope;
 var nsMsgSearchAttrib = Ci.nsMsgSearchAttrib;
 var nsMsgSearchOp = Ci.nsMsgSearchOp;
 
 var Contains = nsMsgSearchOp.Contains;
 
 var offlineMail = nsMsgSearchScope.offlineMail;
--- a/mailnews/base/test/unit/test_bug471682.js
+++ b/mailnews/base/test/unit/test_bug471682.js
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Test of message database validity on local copy from bug 471682. What
  * we want to do here is to copy a couple of message to a new folder, and
  * then compare the date and filesize of the folder file with the
  * stored result in dbfolderinfo. If they don't match, that's bad.
  */
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var bugmail1 = do_get_file("../../../data/bugmail1");
 var gHdr; // header of test message in local folder
 
 localAccountUtils.loadLocalMailAccount();
 // create a subfolder as a target for copies
 var gSubfolder = localAccountUtils.inboxFolder.createLocalSubfolder("subfolder");
 
--- a/mailnews/base/test/unit/test_compactColumnSave.js
+++ b/mailnews/base/test/unit/test_compactColumnSave.js
@@ -19,17 +19,17 @@
   *   Remove one message
   *   Compact folder2
   *   Close folder2
   *   Reopen folder2
   *   Check whether custom column headings are still there
   *
   */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 Services.prefs.setCharPref("mail.serverDefaultStoreContractID",
                            "@mozilla.org/msgstore/berkeleystore;1");
 
 // Globals
 var gMsgFile1, gMsgFile2, gMsgFile3;
 var gLocalFolder2;
 
--- a/mailnews/base/test/unit/test_copyChaining.js
+++ b/mailnews/base/test/unit/test_copyChaining.js
@@ -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/. */
 
 // Test of chaining copies between the same folders
 
 load("../../../resources/messageGenerator.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var gCopySource;
 var gCopyDest;
 var gMsgEnumerator;
 var gCurTestNum = 1;
 
 // main test
 
--- a/mailnews/base/test/unit/test_copyThenMoveManual.js
+++ b/mailnews/base/test/unit/test_copyThenMoveManual.js
@@ -2,17 +2,17 @@
  * This file tests copy followed by a move in a single filter.
  * Tests fix from bug 448337.
  *
  * Original author: Kent James <kent@caspia.com>
  */
 
 load("../../../resources/POP3pump.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://testing-common/mailnews/PromiseTestUtils.jsm");
 
 var gFiles = ["../../../data/bugmail1"];
 var gCopyFolder;
 var gMoveFolder;
 var gFilter; // the test filter
 var gFilterList;
 var gTestArray =
--- a/mailnews/base/test/unit/test_copyToInvalidDB.js
+++ b/mailnews/base/test/unit/test_copyToInvalidDB.js
@@ -5,17 +5,17 @@
 
 load("../../../resources/logHelper.js");
 load("../../../resources/asyncTestUtils.js");
 
 load("../../../resources/messageGenerator.js");
 load("../../../resources/messageModifier.js");
 load("../../../resources/messageInjection.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var gMsg1;
 var gMessages = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
 var gCurTestNum;
 var gMsgId1;
 
 var gTestFolder, gTestFolder2;
 
--- a/mailnews/base/test/unit/test_detachToFile.js
+++ b/mailnews/base/test/unit/test_detachToFile.js
@@ -6,17 +6,17 @@
  * Tests nsIMessenger's detachAttachmentsWOPrompts
  */
 
 load("../../../resources/logHelper.js");
 load("../../../resources/asyncTestUtils.js");
 
 // javascript mime emitter functions
 var mimeMsg = {};
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/gloda/mimemsg.js", mimeMsg);
 
 var tests = [
   startCopy,
   startMime,
   startDetach,
   testDetach,
 ]
--- a/mailnews/base/test/unit/test_emptyTrash.js
+++ b/mailnews/base/test/unit/test_emptyTrash.js
@@ -11,17 +11,17 @@
   *
   * Currently tested:
   * - Empty local trash
   * TODO
   * - Empty imap trash
   */
 
 // Globals
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var gMsgFile1;
 var gLocalTrashFolder;
 var gCurTestNum;
 var gMsgHdrs = new Array();
 var gRootFolder;
 
 var nsIMFNService = Ci.nsIMsgFolderNotificationService;
--- a/mailnews/base/test/unit/test_fix_deferred_accounts.js
+++ b/mailnews/base/test/unit/test_fix_deferred_accounts.js
@@ -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/. */
 
 /**
  * This tests that we cleanup the account prefs when a pop3 account has
  * been deferred to a hidden account.
  */
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 function run_test()
 {
   // Create account prefs with a pop3 account deferred to a hidden account.
 
   Services.prefs.setCharPref("mail.account.account1.identities", "id1");
   Services.prefs.setCharPref("mail.account.account1.server", "server1");
   Services.prefs.setCharPref("mail.account.account2.server", "server2");
--- a/mailnews/base/test/unit/test_folderCompact.js
+++ b/mailnews/base/test/unit/test_folderCompact.js
@@ -10,17 +10,17 @@
   * Test suite for folder compaction
   *
   * Currently tested:
   * - Compacting local folders
   * TODO
   * - Compacting imap offline stores.
   */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://testing-common/mailnews/PromiseTestUtils.jsm");
 
 Services.prefs.setCharPref("mail.serverDefaultStoreContractID",
                            "@mozilla.org/msgstore/berkeleystore;1");
 
 // Globals
 var gMsgFile1, gMsgFile2, gMsgFile3;
 var gMsg1ID = "200806061706.m56H6RWT004933@mrapp54.mozilla.org";
--- a/mailnews/base/test/unit/test_folderLookupService.js
+++ b/mailnews/base/test/unit/test_folderLookupService.js
@@ -1,16 +1,16 @@
 /* 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/. */
 
 /**
  * This tests that nsIFolderLookupService works according to specification.
  */
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var kRootURI = "mailbox://nobody@Local%20Folders";
 
 function run_test() {
   let fls = Cc["@mozilla.org/mail/folder-lookup;1"]
               .getService(Ci.nsIFolderLookupService);
 
   // Make sure that the local mail account exists.
--- a/mailnews/base/test/unit/test_headerFoldingInDatabase.js
+++ b/mailnews/base/test/unit/test_headerFoldingInDatabase.js
@@ -2,17 +2,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/. */
 
 /*
  * Testing header folding in nsParseMailMessageState::ParseHeaders(),
  * see bug 1454257 and bug 1456001.
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var hdr;
 
 function run_test()
 {
   localAccountUtils.loadLocalMailAccount();
 
   var copyListener =
--- a/mailnews/base/test/unit/test_junkWhitelisting.js
+++ b/mailnews/base/test/unit/test_junkWhitelisting.js
@@ -7,17 +7,17 @@
  */
 
 // add address book setup
 load("../../../resources/abSetup.js");
 
 // add fake POP3 server driver
 load("../../../resources/POP3pump.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 /*
  * The address available in the test address book is "PrimaryEmail1@test.invalid"
  * Test emails may also include the address "invalid@example.com"
  *
  * Map of test email contents: (P is "Prim...", I is "inva.." address)
  *
  *  Index  Bugmail#      From
--- a/mailnews/base/test/unit/test_junkingWhenDisabled.js
+++ b/mailnews/base/test/unit/test_junkingWhenDisabled.js
@@ -9,17 +9,17 @@ load("../../../resources/asyncTestUtils.
 
 load("../../../resources/messageGenerator.js");
 load("../../../resources/messageModifier.js");
 load("../../../resources/messageInjection.js");
 
 ChromeUtils.import("resource:///modules/jsTreeSelection.js");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var nsIMFNService = Ci.nsIMsgFolderNotificationService;
 
 // fake objects needed to get nsMsgDBView to operate on selected messages.
 // Warning: these are partial implementations. If someone adds additional
 // calls to these objects in nsMsgDBView and friends, it will also
 // be necessary to add fake versions of those calls here.
 
--- a/mailnews/base/test/unit/test_loadVirtualFolders.js
+++ b/mailnews/base/test/unit/test_loadVirtualFolders.js
@@ -1,16 +1,16 @@
 /* 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/. */
 
 // Test loading of virtualFolders.dat, including verification of the search
 // scopes, i.e., folder uri's.
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 // As currently written, this test will only work with Berkeley store.
 Services.prefs.setCharPref("mail.serverDefaultStoreContractID",
                            "@mozilla.org/msgstore/berkeleystore;1");
 
 // main test
 
 function run_test()
--- a/mailnews/base/test/unit/test_mailServices.js
+++ b/mailnews/base/test/unit/test_mailServices.js
@@ -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/. */
 
 /*
  * Tests for the MailServices module.
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 function check_service(aService, aInterface) {
   Assert.ok(aService in MailServices);
   Assert.ok(MailServices[aService] instanceof aInterface);
 }
 
 function check_services() {
   check_service("mailSession", Ci.nsIMsgMailSession);
@@ -26,11 +26,17 @@ function check_services() {
   check_service("mfn", Ci.nsIMsgFolderNotificationService);
   check_service("headerParser", Ci.nsIMsgHeaderParser);
   check_service("mimeConverter", Ci.nsIMimeConverter);
   check_service("tags", Ci.nsIMsgTagService);
   check_service("filters", Ci.nsIMsgFilterService);
   check_service("junk", Ci.nsIJunkMailPlugin);
 }
 
+function check_shim() {
+  let { MailServices: oldMailServices } = ChromeUtils.import("resource:///modules/mailServices.js", null);
+  Assert.equal(oldMailServices, MailServices);
+}
+
 function run_test() {
   check_services();
+  check_shim();
 }
--- a/mailnews/base/test/unit/test_mimemaltdetach.js
+++ b/mailnews/base/test/unit/test_mimemaltdetach.js
@@ -8,17 +8,17 @@
  */
 
 load("../../../resources/logHelper.js");
 load("../../../resources/asyncTestUtils.js");
 
 // javascript mime emitter functions
 var mimeMsg = {};
 ChromeUtils.import("resource:///modules/gloda/mimemsg.js", mimeMsg);
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var tests = [
   startCopy,
   startMime,
   startDetach,
   testDetach,
 ]
 
--- a/mailnews/base/test/unit/test_newMailNotification.js
+++ b/mailnews/base/test/unit/test_newMailNotification.js
@@ -1,17 +1,17 @@
 /* -*- Mode: Java; tab-width: 2; 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/. */
 
 /* Tests for platform-independent code to count new and unread messages and pass the
  * information to platform-specific notification modules */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var iNMNS = Ci.mozINewMailNotificationService;
 
 /*
  * Register listener for a particular event, make sure it shows up in the right lists
  * of listeners (and not the wrong ones) and doesn't show up after being removed
  */
 add_test(function testListeners() {
--- a/mailnews/base/test/unit/test_nsIMsgFolder.js
+++ b/mailnews/base/test/unit/test_nsIMsgFolder.js
@@ -1,14 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /*
  * Test suite for nsIMsgFolder functions.
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 function run_test() {
   // Create a local mail account (we need this first)
   MailServices.accounts.createLocalMailAccount();
 
   // Get the account
   let account = MailServices.accounts.accounts.queryElementAt(0, Ci.nsIMsgAccount);
 
--- a/mailnews/base/test/unit/test_nsIMsgFolderListener.js
+++ b/mailnews/base/test/unit/test_nsIMsgFolderListener.js
@@ -5,17 +5,17 @@
  * http://creativecommons.org/licenses/publicdomain/
  *
  * ***** END LICENSE BLOCK ***** */
 
 /*
  * Test suite for basic functionality with nsIMsgFolderListeners.
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var nsIMFNService = Ci.nsIMsgFolderNotificationService;
 var nsIMFListener = Ci.nsIMsgFolderListener;
 
 
 var gIndividualFlags =
 [
   nsIMFNService.msgAdded,
--- a/mailnews/base/test/unit/test_nsIMsgTagService.js
+++ b/mailnews/base/test/unit/test_nsIMsgTagService.js
@@ -5,17 +5,17 @@
 /*
  * Tests of nsIMsgTagService.
  *
  * Specifically tests changes implemented in bug 217034
  * Does not do comprehensive testing.
  *
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 function run_test()
 {
   // These are both tags and keys. Note keys are forced to be lower case
   const tag1 = "istag";
   const tag2 = "notistag";
   const tag3 = "istagnot";
   const tag4 = "istagtoo";
--- a/mailnews/base/test/unit/test_nsMsgMailSession_Alerts.js
+++ b/mailnews/base/test/unit/test_nsMsgMailSession_Alerts.js
@@ -1,15 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /*
  * Test suite for nsMsgMailSession functions relating to alerts and their
  * listeners.
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 load("../../../resources/alertTestUtils.js");
 
 var gDialogTitle = null;
 var gText = null;
 
 function reset() {
--- a/mailnews/base/test/unit/test_nsMsgMailSession_Listeners.js
+++ b/mailnews/base/test/unit/test_nsMsgMailSession_Listeners.js
@@ -1,14 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /*
  * Test suite for nsMsgMailSession functions relating to listeners.
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var nsIFolderListener = Ci.nsIFolderListener;
 var numListenerFunctions = 8;
 
 var gMailSessionNotifier = MailServices.mailSession.QueryInterface(nsIFolderListener);
 
 var gFLAll;
 var gFLSingle = new Array(numListenerFunctions);
--- a/mailnews/base/test/unit/test_quarantineFilterMove.js
+++ b/mailnews/base/test/unit/test_quarantineFilterMove.js
@@ -4,17 +4,17 @@
 
 /*
  * tests message moves with filter and quarantine enabled per bug 582918.
  * It then tests that subsequent moves of the filtered messages work.
  *
  * adapted from test_copyThenMoveManual.js
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://testing-common/mailnews/PromiseTestUtils.jsm");
 load("../../../resources/POP3pump.js");
 
 var gFiles = ["../../../data/bugmail1", "../../../data/bugmail10"];
 
 var gMoveFolder, gMoveFolder2;
 var gFilter; // the test filter
 var gFilterList;
--- a/mailnews/base/test/unit/test_search.js
+++ b/mailnews/base/test/unit/test_search.js
@@ -5,17 +5,17 @@
 /*
  * Testing of general mail search features.
  *
  * This tests some search attributes not tested by other specific tests,
  * e.g., test_searchTag.js or test_searchJunk.js
  */
 load("../../../resources/searchTestUtils.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var nsMsgSearchScope = Ci.nsMsgSearchScope;
 var nsMsgSearchAttrib = Ci.nsMsgSearchAttrib;
 var nsMsgSearchOp = Ci.nsMsgSearchOp;
 
 var Isnt = nsMsgSearchOp.Isnt;
 var Is = nsMsgSearchOp.Is;
 var IsEmpty = nsMsgSearchOp.IsEmpty;
--- a/mailnews/base/test/unit/test_searchAddressInAb.js
+++ b/mailnews/base/test/unit/test_searchAddressInAb.js
@@ -5,17 +5,17 @@
 // Testing of to, cc, toorcc in addressbook search features added in bug 187768
 // Added testing of AllAddresses from bug 310359
 
 load("../../../resources/searchTestUtils.js");
 
 // add address book setup
 load("../../../resources/abSetup.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var ABUri = kPABData.URI;
 
 var nsMsgSearchScope = Ci.nsMsgSearchScope;
 var nsMsgSearchAttrib = Ci.nsMsgSearchAttrib;
 var nsMsgSearchOp = Ci.nsMsgSearchOp;
 
 var IsntInAB = nsMsgSearchOp.IsntInAB;
--- a/mailnews/base/test/unit/test_searchBody.js
+++ b/mailnews/base/test/unit/test_searchBody.js
@@ -2,17 +2,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/. */
 
 /*
  * This tests various body search criteria.
  */
 load("../../../resources/searchTestUtils.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var nsMsgSearchScope = Ci.nsMsgSearchScope;
 var nsMsgSearchAttrib = Ci.nsMsgSearchAttrib;
 var nsMsgSearchOp = Ci.nsMsgSearchOp;
 
 var Isnt = nsMsgSearchOp.Isnt;
 var Is = nsMsgSearchOp.Is;
 var IsEmpty = nsMsgSearchOp.IsEmpty;
--- a/mailnews/base/test/unit/test_searchBoolean.js
+++ b/mailnews/base/test/unit/test_searchBoolean.js
@@ -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/. */
 
 /*
  * Demonstrates and tests the use of grouped boolean expressions in search terms
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var gSearchSession = Cc["@mozilla.org/messenger/searchSession;1"]
                         .createInstance(Ci.nsIMsgSearchSession);
 
 var gHdr; // the message header for the one mailbox message
 
 var Tests =
 [
--- a/mailnews/base/test/unit/test_searchChaining.js
+++ b/mailnews/base/test/unit/test_searchChaining.js
@@ -5,17 +5,17 @@
 // Test of chaining of search scopes in a search session. In particular,
 //  Bug 541969 made us not search an imap folder if the search scope before it
 // there was an empty local folder.
 
 // main test
 
 load("../../../resources/messageGenerator.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://testing-common/mailnews/IMAPpump.js");
 ChromeUtils.import("resource://testing-common/mailnews/imapd.js");
 ChromeUtils.import("resource://testing-common/mailnews/PromiseTestUtils.jsm");
 
 async function setupFolder()
 {
   // add a single message to the imap inbox.
   let messages = [];
--- a/mailnews/base/test/unit/test_searchCustomTerm.js
+++ b/mailnews/base/test/unit/test_searchCustomTerm.js
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Testing of custom search features.
  *
  */
 load("../../../resources/searchTestUtils.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var kCustomId = "xpcomtest@mozilla.org#test";
 var gHdr;
 
 var Tests =
 [
   { setValue: "iamgood",
     testValue: "iamnotgood",
--- a/mailnews/base/test/unit/test_searchJunk.js
+++ b/mailnews/base/test/unit/test_searchJunk.js
@@ -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/. */
 
 // Testing of search by junk percent and junk score origin
 
 load("../../../resources/searchTestUtils.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var nsMsgSearchScope = Ci.nsMsgSearchScope;
 var nsMsgSearchAttrib = Ci.nsMsgSearchAttrib;
 var nsMsgSearchOp = Ci.nsMsgSearchOp;
 
 var IsGreaterThan = nsMsgSearchOp.IsGreaterThan;
 var IsLessThan = nsMsgSearchOp.IsLessThan;
 var Is = nsMsgSearchOp.Is;
--- a/mailnews/base/test/unit/test_searchTag.js
+++ b/mailnews/base/test/unit/test_searchTag.js
@@ -6,17 +6,17 @@
  * Testing of tag search features.
  *
  * Specifically tests changes implemented in bug 217034
  * Does not do comprehensive testing.
  *
  */
 load("../../../resources/searchTestUtils.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var nsMsgSearchScope = Ci.nsMsgSearchScope;
 var nsMsgSearchAttrib = Ci.nsMsgSearchAttrib;
 var nsMsgSearchOp = Ci.nsMsgSearchOp;
 
 var Isnt = nsMsgSearchOp.Isnt;
 var Is = nsMsgSearchOp.Is;
 var IsEmpty = nsMsgSearchOp.IsEmpty;
--- a/mailnews/base/test/unit/test_searchUint32HdrProperty.js
+++ b/mailnews/base/test/unit/test_searchUint32HdrProperty.js
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Testing of Uint32HdrProperty search attribute. Adapted from test_search.js
  */
 
 load("../../../resources/searchTestUtils.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var nsMsgSearchAttrib = Ci.nsMsgSearchAttrib;
 var nsMsgSearchOp = Ci.nsMsgSearchOp;
 
 var Isnt = nsMsgSearchOp.Isnt;
 var Is = nsMsgSearchOp.Is;
 var IsGreaterThan = nsMsgSearchOp.IsGreaterThan;
 var IsLessThan = nsMsgSearchOp.IsLessThan;
--- a/mailnews/base/test/unit/test_viewSortByAddresses.js
+++ b/mailnews/base/test/unit/test_viewSortByAddresses.js
@@ -7,17 +7,17 @@ load("../../../resources/logHelper.js");
 load("../../../resources/asyncTestUtils.js");
 
 load("../../../resources/messageGenerator.js");
 load("../../../resources/messageModifier.js");
 load("../../../resources/messageInjection.js");
 load("../../../resources/abSetup.js");
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var gMessageGenerator = new MessageGenerator();
 var gScenarioFactory = new MessageScenarioFactory(gMessageGenerator);
 
 Services.prefs.setBoolPref("mail.showCondensedAddresses", true);
 
 var gTestFolder;
 
copy from mailnews/base/util/mailServices.js
copy to mailnews/base/util/MailServices.jsm
--- a/mailnews/base/util/folderUtils.jsm
+++ b/mailnews/base/util/folderUtils.jsm
@@ -5,17 +5,17 @@
 /**
  * This file contains helper methods for dealing with nsIMsgFolders.
  */
 
 this.EXPORTED_SYMBOLS = ["getFolderProperties", "getSpecialFolderString",
                           "getFolderFromUri", "allAccountsSorted",
                           "getMostRecentFolders", "folderNameCompare"];
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
 
 /**
  * Returns a string representation of a folder's "special" type.
  *
  * @param aFolder  the nsIMsgFolder whose special type should be returned
  */
 function getSpecialFolderString(aFolder) {
--- a/mailnews/base/util/mailServices.js
+++ b/mailnews/base/util/mailServices.js
@@ -1,73 +1,14 @@
 /* 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/. */
 
 var EXPORTED_SYMBOLS = ["MailServices"];
 
-ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-
-var MailServices = {};
-
-XPCOMUtils.defineLazyServiceGetter(MailServices, "mailSession",
-                                   "@mozilla.org/messenger/services/session;1",
-                                   "nsIMsgMailSession");
-
-XPCOMUtils.defineLazyServiceGetter(MailServices, "accounts",
-                                   "@mozilla.org/messenger/account-manager;1",
-                                   "nsIMsgAccountManager");
-
-XPCOMUtils.defineLazyServiceGetter(MailServices, "pop3",
-                                   "@mozilla.org/messenger/popservice;1",
-                                   "nsIPop3Service");
-
-XPCOMUtils.defineLazyServiceGetter(MailServices, "imap",
-                                   "@mozilla.org/messenger/imapservice;1",
-                                   "nsIImapService");
-
-XPCOMUtils.defineLazyServiceGetter(MailServices, "nntp",
-                                   "@mozilla.org/messenger/nntpservice;1",
-                                   "nsINntpService");
-
-XPCOMUtils.defineLazyServiceGetter(MailServices, "smtp",
-                                   "@mozilla.org/messengercompose/smtp;1",
-                                   "nsISmtpService");
-
-XPCOMUtils.defineLazyServiceGetter(MailServices, "compose",
-                                   "@mozilla.org/messengercompose;1",
-                                   "nsIMsgComposeService");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
-XPCOMUtils.defineLazyServiceGetter(MailServices, "ab",
-                                   "@mozilla.org/abmanager;1",
-                                   "nsIAbManager");
-
-XPCOMUtils.defineLazyServiceGetter(MailServices, "copy",
-                                   "@mozilla.org/messenger/messagecopyservice;1",
-                                   "nsIMsgCopyService");
-
-XPCOMUtils.defineLazyServiceGetter(MailServices, "mfn",
-                                   "@mozilla.org/messenger/msgnotificationservice;1",
-                                   "nsIMsgFolderNotificationService");
-
-XPCOMUtils.defineLazyServiceGetter(MailServices, "headerParser",
-                                   "@mozilla.org/messenger/headerparser;1",
-                                   "nsIMsgHeaderParser");
-
-XPCOMUtils.defineLazyServiceGetter(MailServices, "mimeConverter",
-                                   "@mozilla.org/messenger/mimeconverter;1",
-                                   "nsIMimeConverter");
-
-XPCOMUtils.defineLazyServiceGetter(MailServices, "tags",
-                                   "@mozilla.org/messenger/tagservice;1",
-                                   "nsIMsgTagService");
-
-XPCOMUtils.defineLazyServiceGetter(MailServices, "filters",
-                                   "@mozilla.org/messenger/services/filters;1",
-                                   "nsIMsgFilterService");
-
-XPCOMUtils.defineLazyServiceGetter(MailServices, "junk",
-                                   "@mozilla.org/messenger/filter-plugin;1?name=bayesianfilter",
-                                   "nsIJunkMailPlugin");
-
-XPCOMUtils.defineLazyServiceGetter(MailServices, "newMailNotification",
-                                   "@mozilla.org/newMailNotificationService;1",
-                                   "mozINewMailNotificationService");
+ChromeUtils.import("resource://gre/modules/Deprecated.jsm");
+Deprecated.warning(
+    "mailServices.js has been renamed MailServices.jsm",
+    "https://bugzilla.mozilla.org/show_bug.cgi?id=1487572",
+    Components.stack.caller
+);
--- a/mailnews/base/util/mailnewsMigrator.js
+++ b/mailnews/base/util/mailnewsMigrator.js
@@ -9,17 +9,17 @@
  * function should be written to be a no-op when the value is already migrated
  * or was never used in the old version.
  */
 
 this.EXPORTED_SYMBOLS = [ "migrateMailnews" ];
 
 ChromeUtils.import("resource:///modules/errUtils.js");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 var kServerPrefVersion = 1;
 var kSmtpPrefVersion = 1;
 var kABRemoteContentPrefVersion = 1;
 var kDefaultCharsetsPrefVersion = 1;
 
 function migrateMailnews()
 {
   try {
--- a/mailnews/base/util/mailstoreConverter.jsm
+++ b/mailnews/base/util/mailstoreConverter.jsm
@@ -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/. */
 
 var EXPORTED_SYMBOLS = ["convertMailStoreTo", "terminateWorkers"];
 
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
 ChromeUtils.import("resource:///modules/MailUtils.js");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
 ChromeUtils.import("resource://gre/modules/osfile.jsm");
 ChromeUtils.import("resource://gre/modules/Log.jsm");
 
 var log = Log.repository.getLogger("MailStoreConverter");
 log.level = Log.Level.Debug;
 log.addAppender(new Log.DumpAppender(new Log.BasicFormatter()));
--- a/mailnews/base/util/moz.build
+++ b/mailnews/base/util/moz.build
@@ -54,16 +54,17 @@ EXTRA_JS_MODULES += [
     'folderUtils.jsm',
     'hostnameUtils.jsm',
     'IOUtils.js',
     'iteratorUtils.jsm',
     'jsTreeSelection.js',
     'JXON.js',
     'mailnewsMigrator.js',
     'mailServices.js',
+    'MailServices.jsm',
     'mailstoreConverter.jsm',
     'msgDBCacheManager.js',
     'OAuth2.jsm',
     'OAuth2Providers.jsm',
     'StringBundle.js',
     'templateUtils.js',
     'traceHelper.js',
 ]
--- a/mailnews/base/util/msgDBCacheManager.js
+++ b/mailnews/base/util/msgDBCacheManager.js
@@ -5,17 +5,17 @@
 /**
  * Message DB Cache manager
  */
 
 /* :::::::: Constants and Helpers ::::::::::::::: */
 
 this.EXPORTED_SYMBOLS = ["msgDBCacheManager"];
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource:///modules/gloda/log4moz.js");
 var log = Log4Moz.getConfiguredLogger("mailnews.database.dbcache");
 
 /**
  */
 var DBCACHE_INTERVAL_DEFAULT_MS = 60000; // 1 minute
 
--- a/mailnews/compose/test/unit/head_compose.js
+++ b/mailnews/compose/test/unit/head_compose.js
@@ -1,10 +1,10 @@
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/IOUtils.js");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://testing-common/mailnews/mailTestUtils.js");
 ChromeUtils.import("resource://testing-common/mailnews/localAccountUtils.js");
 
 var CC = Components.Constructor;
 
 // WebApps.jsm called by ProxyAutoConfig (PAC) requires a valid nsIXULAppInfo.
@@ -19,17 +19,17 @@ var gDEPTH = "../../../../";
 // Import the required setup scripts.
 load("../../../resources/abSetup.js");
 
 // Import the smtp server scripts
 ChromeUtils.import("resource://testing-common/mailnews/maild.js");
 ChromeUtils.import("resource://testing-common/mailnews/smtpd.js");
 ChromeUtils.import("resource://testing-common/mailnews/auth.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var gDraftFolder;
 
 // Setup the daemon and server
 function setupServerDaemon(handler) {
   if (!handler)
     handler = function (d) { return new SMTP_RFC2821_handler(d); };
   var server = new nsMailServer(handler, new smtpDaemon());
--- a/mailnews/compose/test/unit/test_autoReply.js
+++ b/mailnews/compose/test/unit/test_autoReply.js
@@ -4,17 +4,17 @@
 /**
  * Tests messages generated by ReplyWithTemplate.
  */
 
 // make xpcshell-tests TEST_PATH=mailnews/compose/test/unit/test_autoReply.js
 
 ChromeUtils.import("resource://testing-common/mailnews/PromiseTestUtils.jsm");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/mimeParser.jsm");
 
 load("../../../resources/logHelper.js"); // watch for errors in the error console
 
 const kSender = "from@foo.invalid";
 
 var gIncomingMailFile = do_get_file("../../../data/bugmail10"); // mail to reply to
 // reply-filter-testmail: mail to reply to (but not really)
--- a/mailnews/compose/test/unit/test_bug155172.js
+++ b/mailnews/compose/test/unit/test_bug155172.js
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /**
  * Authentication tests for SMTP.
  */
 
 load("../../../resources/alertTestUtils.js");
 load("../../../resources/passwordStorage.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var gNewPassword = null;
 
 function confirmEx(aDialogTitle, aText, aButtonFlags, aButton0Title,
                    aButton1Title, aButton2Title, aCheckMsg, aCheckState) {
   // Just return 2 which will is pressing button 2 - enter a new password.
   return 2;
 }
--- a/mailnews/compose/test/unit/test_bug235432.js
+++ b/mailnews/compose/test/unit/test_bug235432.js
@@ -1,14 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /**
  * Test for bug 235432
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var testmail = do_get_file("data/message1.eml");
 var expectedTemporaryFile;
 
 var kSender = "from@foo.invalid";
 var kTo = "to@foo.invalid";
 
--- a/mailnews/compose/test/unit/test_bug474774.js
+++ b/mailnews/compose/test/unit/test_bug474774.js
@@ -1,15 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /**
  * Tests bug 474774 - assertions when saving send later and when sending with
  * FCC switched off.
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var type = null;
 var test = null;
 var server;
 var smtpServer;
 var sentFolder;
 var originalData;
 var finished = false;
--- a/mailnews/compose/test/unit/test_detectAttachmentCharset.js
+++ b/mailnews/compose/test/unit/test_detectAttachmentCharset.js
@@ -1,15 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /*
  * Test suite for auto-detecting attachment file charset.
  */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 function checkAttachmentCharset(expectedCharset) {
   let msgData = mailTestUtils
     .loadMessageToString(gDraftFolder, mailTestUtils.firstMsgHdr(gDraftFolder));
   let attachmentData = getAttachmentFromContent(msgData);
 
   Assert.equal(expectedCharset, getContentCharset(attachmentData));
 }
--- a/mailnews/compose/test/unit/test_expandMailingLists.js
+++ b/mailnews/compose/test/unit/test_expandMailingLists.js
@@ -7,17 +7,17 @@
 var MsgComposeContractID = "@mozilla.org/messengercompose/compose;1";
 var MsgComposeParamsContractID = "@mozilla.org/messengercompose/composeparams;1";
 var MsgComposeFieldsContractID = "@mozilla.org/messengercompose/composefields;1";
 var nsIMsgCompose = Ci.nsIMsgCompose;
 var nsIMsgComposeParams = Ci.nsIMsgComposeParams;
 var nsIMsgCompFields = Ci.nsIMsgCompFields;
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 /**
  * Helper to check population worked as expected.
  * @param aTo - text in the To field
  * @param aCheckTo - the expected To addresses (after possible list population)
  */
 function checkPopulate(aTo, aCheckTo)
 {
--- a/mailnews/compose/test/unit/test_longLines.js
+++ b/mailnews/compose/test/unit/test_longLines.js
@@ -1,15 +1,15 @@
 /*
  * Test ensuring that messages with "long lines" are transmitted correctly.
  * Most of this test was copied from test_messageHeaders.js.
  */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/mimeParser.jsm");
 
 var CompFields = CC("@mozilla.org/messengercompose/composefields;1",
                     Ci.nsIMsgCompFields);
 
 // Copied from jsmime.js.
 function stringToTypedArray(buffer) {
   var typedarray = new Uint8Array(buffer.length);
--- a/mailnews/compose/test/unit/test_messageHeaders.js
+++ b/mailnews/compose/test/unit/test_messageHeaders.js
@@ -1,14 +1,14 @@
 /*
  * Test suite for ensuring that the headers of messages are set properly.
  */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/mimeParser.jsm");
 
 var CompFields = CC("@mozilla.org/messengercompose/composefields;1",
                     Ci.nsIMsgCompFields);
 
 function makeAttachment(opts = {}) {
   let attachment = Cc["@mozilla.org/messengercompose/attachment;1"]
                      .createInstance(Ci.nsIMsgAttachment);
--- a/mailnews/compose/test/unit/test_nsMsgCompose3.js
+++ b/mailnews/compose/test/unit/test_nsMsgCompose3.js
@@ -1,15 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /*
  * Test suite for increasing the popularity of contacts via
  * expandMailingLists.
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var MsgComposeContractID = "@mozilla.org/messengercompose/compose;1";
 var MsgComposeParamsContractID = "@mozilla.org/messengercompose/composeparams;1";
 var MsgComposeFieldsContractID = "@mozilla.org/messengercompose/composefields;1";
 
 var TESTS = [
   {
     email: "em@test.invalid",
--- a/mailnews/compose/test/unit/test_sendBackground.js
+++ b/mailnews/compose/test/unit/test_sendBackground.js
@@ -1,14 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /**
  * Tests sending a message in the background (checks auto-send works).
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var type = null;
 var test = null;
 var server;
 var sentFolder;
 var originalData;
 var finished = false;
 var identity = null;
--- a/mailnews/compose/test/unit/test_sendMailMessage.js
+++ b/mailnews/compose/test/unit/test_sendMailMessage.js
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /**
  * Protocol tests for SMTP.
  *
  * This test currently consists of verifying the correct protocol sequence
  * between mailnews and SMTP server. It does not check the data of the message
  * either side of the link, it will be extended later to do that.
  */
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var test = null;
 var server;
 
 var kIdentityMail = "identity@foo.invalid";
 var kSender = "from@foo.invalid";
 var kTo = "to@foo.invalid";
 var kUsername = "testsmtp";
--- a/mailnews/compose/test/unit/test_sendMessageFile.js
+++ b/mailnews/compose/test/unit/test_sendMessageFile.js
@@ -6,17 +6,17 @@
  * - Sending a message to an SMTP server (which is also covered elsewhere).
  * - Correct reception of the message by the SMTP server.
  * - Correct saving of the message to the sent folder.
  *
  * Originally written to test bug 429891 where saving to the sent folder was
  * mangling the message.
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var type = null;
 var test = null;
 var server;
 var sentFolder;
 var originalData;
 var finished = false;
 
--- a/mailnews/compose/test/unit/test_sendMessageLater.js
+++ b/mailnews/compose/test/unit/test_sendMessageLater.js
@@ -6,17 +6,17 @@
  * - Sending a message to an SMTP server (which is also covered elsewhere).
  * - Correct reception of the message by the SMTP server.
  * - Correct saving of the message to the sent folder.
  *
  * Originally written to test bug 429891 where saving to the sent folder was
  * mangling the message.
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var type = null;
 var test = null;
 var server;
 var smtpServer;
 var sentFolder;
 var originalData;
 var finished = false;
--- a/mailnews/compose/test/unit/test_sendMessageLater2.js
+++ b/mailnews/compose/test/unit/test_sendMessageLater2.js
@@ -10,17 +10,17 @@
  * messages is currently disabled (but commented out for local testing if
  * required), when we fix bug 136871 we should be able to enable the multiple
  * messages option.
  */
 
 load("../../../resources/logHelper.js");
 load("../../../resources/asyncTestUtils.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var test = "sendMessageLater";
 var server = null;
 var smtpServer;
 var gSentFolder;
 var originalData;
 var identity = null;
 var gMsgFile =
--- a/mailnews/compose/test/unit/test_sendMessageLater3.js
+++ b/mailnews/compose/test/unit/test_sendMessageLater3.js
@@ -5,17 +5,17 @@
  * For trying to send a message later with no server connected, this test
  * verifies:
  *   - A correct status response.
  *   - A correct state at the end of attempting to send.
  */
 
 load("../../../resources/alertTestUtils.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var type = null;
 var test = null;
 var server;
 var sentFolder;
 var transaction;
 var originalData;
 var finished = false;
--- a/mailnews/compose/test/unit/test_sendObserver.js
+++ b/mailnews/compose/test/unit/test_sendObserver.js
@@ -1,17 +1,17 @@
 /*
  * Tests that the mail-set-sender observer, used by extensions to modify the
  * outgoing server, works.
  *
  * This is adapted from test_messageHeaders.js
  */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/mimeParser.jsm");
 
 var CompFields = CC("@mozilla.org/messengercompose/composefields;1",
                     Ci.nsIMsgCompFields);
 
 // nsIObserver implementation.
 var gData = "";
 var observer = {
--- a/mailnews/compose/test/unit/test_smtp8bitMime.js
+++ b/mailnews/compose/test/unit/test_smtp8bitMime.js
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /**
  * 8BITMIME tests for SMTP.
  *
  * This test verifies that 8BITMIME is sent to the server only if the server
  * advertises it AND if mail.strictly_mime doesn't force us to send 7bit.
  * It does not check the data of the message on either side of the link.
  */
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var test = null;
 var server;
 
 var kIdentityMail = "identity@foo.invalid";
 var kSender = "from@foo.invalid";
 var kTo = "to@foo.invalid";
 
--- a/mailnews/compose/test/unit/test_smtpAuthMethods.js
+++ b/mailnews/compose/test/unit/test_smtpAuthMethods.js
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /**
  * Authentication tests for SMTP.
  *
  * Test code <copied from="test_pop3AuthMethods.js">
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var server;
 var kAuthSchemes;
 var smtpServer;
 var testFile;
 var identity;
 
 var kUsername = "fred";
--- a/mailnews/compose/test/unit/test_smtpPassword.js
+++ b/mailnews/compose/test/unit/test_smtpPassword.js
@@ -1,14 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /**
  * Authentication tests for SMTP.
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 load("../../../resources/passwordStorage.js");
 
 var server;
 
 var kIdentityMail = "identity@foo.invalid";
 var kSender = "from@foo.invalid";
 var kTo = "to@foo.invalid";
--- a/mailnews/compose/test/unit/test_smtpPasswordFailure1.js
+++ b/mailnews/compose/test/unit/test_smtpPasswordFailure1.js
@@ -5,17 +5,17 @@
  *   - Check we get a prompt asking what to do.
  *   - Check retry does what it should do.
  *   - Check cancel does what it should do.
  *
  * XXX Due to problems with the fakeserver + smtp not using one connection for
  * multiple sends, the rest of this test is in test_smtpPasswordFailure2.js.
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 load("../../../resources/alertTestUtils.js");
 load("../../../resources/passwordStorage.js");
 
 var server;
 var attempt = 0;
--- a/mailnews/compose/test/unit/test_smtpPasswordFailure2.js
+++ b/mailnews/compose/test/unit/test_smtpPasswordFailure2.js
@@ -5,17 +5,17 @@
  *   - Re-initiate connection, this time select enter new password, check that
  *     we get a new password prompt and can enter the password.
  *
  * XXX Due to problems with the fakeserver + smtp not using one connection for
  * multiple sends, the first part of this test is in
  * test_smtpPasswordFailure2.js.
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 load("../../../resources/alertTestUtils.js");
 load("../../../resources/passwordStorage.js");
 
 var server;
 var attempt = 0;
--- a/mailnews/compose/test/unit/test_smtpPasswordFailure3.js
+++ b/mailnews/compose/test/unit/test_smtpPasswordFailure3.js
@@ -3,17 +3,17 @@
  * when the server drops the connection on an authentication error.
  * The steps are:
  *   - Have an invalid password in the password database.
  *   - Re-initiate connection, this time select enter new password, check that
  *     we get a new password prompt and can enter the password.
  *
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 load("../../../resources/alertTestUtils.js");
 load("../../../resources/passwordStorage.js");
 
 var server;
 var attempt = 0;
--- a/mailnews/db/gloda/modules/datamodel.js
+++ b/mailnews/db/gloda/modules/datamodel.js
@@ -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/. */
 
 this.EXPORTED_SYMBOLS = ["GlodaAttributeDBDef", "GlodaAccount",
                     "GlodaConversation", "GlodaFolder", "GlodaMessage",
                     "GlodaContact", "GlodaIdentity", "GlodaAttachment"];
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 ChromeUtils.import("resource:///modules/gloda/log4moz.js");
 var LOG = Log4Moz.repository.getLogger("gloda.datamodel");
 
 ChromeUtils.import("resource:///modules/gloda/utils.js");
 
 // Make it lazy.
 var gMessenger;
--- a/mailnews/db/gloda/modules/explattr.js
+++ b/mailnews/db/gloda/modules/explattr.js
@@ -12,17 +12,17 @@
 this.EXPORTED_SYMBOLS = ['GlodaExplicitAttr'];
 
 ChromeUtils.import("resource:///modules/gloda/log4moz.js");
 ChromeUtils.import("resource:///modules/StringBundle.js");
 
 ChromeUtils.import("resource:///modules/gloda/utils.js");
 ChromeUtils.import("resource:///modules/gloda/gloda.js");
 ChromeUtils.import("resource:///modules/gloda/noun_tag.js");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 
 var nsMsgMessageFlags_Replied = Ci.nsMsgMessageFlags.Replied;
 var nsMsgMessageFlags_Forwarded = Ci.nsMsgMessageFlags.Forwarded;
 
 var EXT_BUILTIN = "built-in";
 
 /**
--- a/mailnews/db/gloda/modules/gloda.js
+++ b/mailnews/db/gloda/modules/gloda.js
@@ -11,17 +11,17 @@ ChromeUtils.import("resource:///modules/
 ChromeUtils.import("resource:///modules/gloda/databind.js");
 ChromeUtils.import("resource:///modules/gloda/collection.js");
 ChromeUtils.import("resource:///modules/gloda/connotent.js");
 ChromeUtils.import("resource:///modules/gloda/query.js");
 ChromeUtils.import("resource:///modules/gloda/utils.js");
 
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
 ChromeUtils.import("resource:///modules/IOUtils.js");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 /**
  * @see |Gloda.BadItemContentsError|
  */
 function BadItemContentsError(aMessage) {
   this.message = aMessage;
 }
--- a/mailnews/db/gloda/modules/index_ab.js
+++ b/mailnews/db/gloda/modules/index_ab.js
@@ -6,17 +6,17 @@ this.EXPORTED_SYMBOLS = ['GlodaABIndexer
 
 ChromeUtils.import("resource:///modules/gloda/collection.js");
 ChromeUtils.import("resource:///modules/gloda/datastore.js");
 ChromeUtils.import("resource:///modules/gloda/gloda.js");
 ChromeUtils.import("resource:///modules/gloda/indexer.js");
 ChromeUtils.import("resource:///modules/gloda/log4moz.js");
 ChromeUtils.import("resource:///modules/gloda/noun_freetag.js");
 ChromeUtils.import("resource:///modules/gloda/utils.js");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 
 var GlodaABIndexer = {
   _log: null,
 
   name: "index_ab",
   enable: function() {
     if (this._log == null)
--- a/mailnews/db/gloda/modules/index_msg.js
+++ b/mailnews/db/gloda/modules/index_msg.js
@@ -11,17 +11,17 @@
  *  things should ideally lose their special hold on this file.  This will
  *  benefit readability/size as well.
  */
 
 this.EXPORTED_SYMBOLS = ['GlodaMsgIndexer'];
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/MailUtils.js");
 
 ChromeUtils.import("resource:///modules/gloda/log4moz.js");
 
 ChromeUtils.import("resource:///modules/gloda/utils.js");
 ChromeUtils.import("resource:///modules/gloda/datastore.js");
 ChromeUtils.import("resource:///modules/gloda/datamodel.js");
 ChromeUtils.import("resource:///modules/gloda/gloda.js");
--- a/mailnews/db/gloda/modules/noun_tag.js
+++ b/mailnews/db/gloda/modules/noun_tag.js
@@ -1,15 +1,15 @@
 /* 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/. */
 
 this.EXPORTED_SYMBOLS = ['TagNoun'];
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 ChromeUtils.import("resource:///modules/gloda/gloda.js");
 
 /**
  * @namespace Tag noun provider.
  */
 var TagNoun = {
   name: "tag",
--- a/mailnews/db/gloda/modules/utils.js
+++ b/mailnews/db/gloda/modules/utils.js
@@ -1,15 +1,15 @@
 /* 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/. */
 
 this.EXPORTED_SYMBOLS = ['GlodaUtils'];
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 /**
  * @namespace A holding place for logic that is not gloda-specific and should
  *  reside elsewhere.
  */
 var GlodaUtils = {
 
   /**
--- a/mailnews/db/gloda/test/unit/base_index_junk.js
+++ b/mailnews/db/gloda/test/unit/base_index_junk.js
@@ -7,17 +7,17 @@
  *  gloda policy not to index junk mail.
  *
  * A similar test that moving things to the trash folder is deletion happens in
  *  base_index_messages.js.
  */
 
 load("resources/glodaTestHelper.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var SPAM_BODY = {body: "superspam superspam superspam eevil eevil eevil"};
 var HAM_BODY = {body: "ham ham ham nice nice nice happy happy happy"};
 
 /**
  * Make SPAM_BODY be known as spammy and HAM_BODY be known as hammy.
  */
 function* setup_spam_filter() {
--- a/mailnews/db/gloda/test/unit/head_gloda.js
+++ b/mailnews/db/gloda/test/unit/head_gloda.js
@@ -1,10 +1,10 @@
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://testing-common/mailnews/mailTestUtils.js");
 
 var CC = Components.Constructor;
 
 // Ensure the profile directory is set up
 do_get_profile();
 
--- a/mailnews/db/gloda/test/unit/resources/glodaTestHelper.js
+++ b/mailnews/db/gloda/test/unit/resources/glodaTestHelper.js
@@ -18,17 +18,17 @@
  *  that triggers indexing.  None of our existing xpcshell tests do this, but it
  *  is part of the mozmill idiom for its waiting mechanism, so be sure to not
  *  perform a mozmill wait without first telling us to expect the messages.
  */
 
 // Services
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 // MailServices
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 // Import the main scripts that mailnews tests need to set up and tear down
 load("../../../../resources/abSetup.js");
 load("../../../../resources/logHelper.js");
 load("../../../../resources/asyncTestUtils.js");
 
 load("../../../../resources/messageGenerator.js");
 load("../../../../resources/messageModifier.js");
--- a/mailnews/db/gloda/test/unit/test_index_addressbook.js
+++ b/mailnews/db/gloda/test/unit/test_index_addressbook.js
@@ -1,15 +1,15 @@
 /* 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/. */
 
 load("resources/glodaTestHelper.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var gInbox;
 
 function add_card(aEmailAddress, aDisplayName) {
   Cc["@mozilla.org/addressbook/services/addressCollector;1"]
     .getService(Ci.nsIAbAddressCollector)
     .collectSingleAddress(aEmailAddress,
                           aDisplayName, true,
--- a/mailnews/db/msgdb/test/unit/head_maildb.js
+++ b/mailnews/db/msgdb/test/unit/head_maildb.js
@@ -1,10 +1,10 @@
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://testing-common/mailnews/mailTestUtils.js");
 ChromeUtils.import("resource://testing-common/mailnews/localAccountUtils.js");
 
 var CC = Components.Constructor;
 
 // Ensure the profile directory is set up
 do_get_profile();
--- a/mailnews/db/msgdb/test/unit/test_enumerator_cleanup.js
+++ b/mailnews/db/msgdb/test/unit/test_enumerator_cleanup.js
@@ -1,13 +1,13 @@
 /*
  * Test nsMsgDatabase's cleanup of nsMsgDBEnumerators
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var anyOldMessage = do_get_file("../../../../data/bugmail1");
 
 /**
  * Test closing a db with an outstanding enumerator.
  */
 function test_enumerator_cleanup() {
   let db = localAccountUtils.inboxFolder.msgDatabase;
--- a/mailnews/db/msgdb/test/unit/test_propertyEnumerator.js
+++ b/mailnews/db/msgdb/test/unit/test_propertyEnumerator.js
@@ -1,15 +1,15 @@
 /* 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/. */
 
  // tests propertyEnumerator in nsIMsgDBHdr;
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var gHdr;
 
 function run_test() {
   localAccountUtils.loadLocalMailAccount();
   // Get a message into the local filestore.
   // Function continue_test() continues the testing after the copy.
   var bugmail1 = do_get_file("../../../../data/bugmail1");
--- a/mailnews/db/msgdb/test/unit/test_references_parsing.js
+++ b/mailnews/db/msgdb/test/unit/test_references_parsing.js
@@ -1,13 +1,13 @@
 /*
  * Test nsMsgHdr's In-Reply-To/References parsing logic.
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var anyOldMessage = do_get_file("../../../../data/bugmail1");
 
 var refsAndResults = [
   // an empty string is not a reference.
   ["", []],
   // super valid things
   ["<abc@def>", ["abc@def"]],
--- a/mailnews/extensions/bayesian-spam-filter/test/unit/head_bayes.js
+++ b/mailnews/extensions/bayesian-spam-filter/test/unit/head_bayes.js
@@ -1,10 +1,10 @@
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://testing-common/mailnews/mailTestUtils.js");
 ChromeUtils.import("resource://testing-common/mailnews/localAccountUtils.js");
 
 var CC = Components.Constructor;
 
 // Ensure the profile directory is set up
 do_get_profile();
--- a/mailnews/extensions/bayesian-spam-filter/test/unit/test_bug228675.js
+++ b/mailnews/extensions/bayesian-spam-filter/test/unit/test_bug228675.js
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // tests reduction in size of training.dat
 
 // main setup
 
 load("resources/trainingfile.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 // before shrink, the trained messages have 76 tokens. Force shrink.
 Services.prefs.setIntPref("mailnews.bayesian_spam_filter.junk_maxtokens", 75);
 
 // local constants
 var kUnclassified = MailServices.junk.UNCLASSIFIED;
 var kJunk = MailServices.junk.JUNK;
 var kGood = MailServices.junk.GOOD;
--- a/mailnews/extensions/bayesian-spam-filter/test/unit/test_customTokenization.js
+++ b/mailnews/extensions/bayesian-spam-filter/test/unit/test_customTokenization.js
@@ -1,15 +1,15 @@
 /* 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/. */
 
 // Tests use of custom tokenization, originally introduced in bug 476389
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 // command functions for test data
 var kTrain = 0;  // train a file
 var kTest = 1;   // test headers returned from detail
 var kSetup = 2;  // run a setup function
 
 // trait ids
 var kProArray = [3];
--- a/mailnews/extensions/bayesian-spam-filter/test/unit/test_junkAsTraits.js
+++ b/mailnews/extensions/bayesian-spam-filter/test/unit/test_junkAsTraits.js
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // tests calls to the bayesian filter plugin to train, classify, and forget
 // messages using both the older junk-oriented calls, as well as the newer
 // trait-oriented calls. Only a single trait is tested. The main intent of
 // these tests is to demonstrate that both the old junk-oriented calls and the
 // new trait-oriented calls give the same results on junk processing.
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 // local constants
 var kUnclassified = MailServices.junk.UNCLASSIFIED;
 var kJunk = MailServices.junk.JUNK;
 var kGood = MailServices.junk.GOOD;
 var kJunkTrait = MailServices.junk.JUNK_TRAIT;
 var kGoodTrait = MailServices.junk.GOOD_TRAIT;
 var kIsHamScore = MailServices.junk.IS_HAM_SCORE;
--- a/mailnews/extensions/bayesian-spam-filter/test/unit/test_traitAliases.js
+++ b/mailnews/extensions/bayesian-spam-filter/test/unit/test_traitAliases.js
@@ -32,17 +32,17 @@
  *                 percentage
  *    file         Train11       Train32
  *
  * alias1.eml        92             98
  * alias2.eml         8              3
  * alias3.eml        50             53
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var traitService = Cc["@mozilla.org/msg-trait-service;1"]
                        .getService(Ci.nsIMsgTraitService);
 var kProTrait = 1001;
 var kAntiTrait = 1005;
 var kProAlias = 1007;
 var kAntiAlias = 1009;
 
--- a/mailnews/extensions/mdn/test/unit/head_mdn.js
+++ b/mailnews/extensions/mdn/test/unit/head_mdn.js
@@ -1,10 +1,10 @@
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://testing-common/mailnews/mailTestUtils.js");
 ChromeUtils.import("resource://testing-common/mailnews/localAccountUtils.js");
 
 var CC = Components.Constructor;
 
 // Ensure the profile directory is set up
 do_get_profile();
 
--- a/mailnews/extensions/newsblog/content/FeedUtils.jsm
+++ b/mailnews/extensions/newsblog/content/FeedUtils.jsm
@@ -1,17 +1,17 @@
 /* -*- Mode: JavaScript; tab-width: 2; 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/. */
 
 this.EXPORTED_SYMBOLS = ["Feed", "FeedItem", "FeedParser", "FeedUtils"];
 
 ChromeUtils.import("resource:///modules/gloda/log4moz.js");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/MailUtils.js");
 ChromeUtils.import("resource:///modules/jsmime.jsm");
 ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 Cu.importGlobalProperties(["XMLHttpRequest"]);
 
--- a/mailnews/extensions/newsblog/content/feed-subscriptions.js
+++ b/mailnews/extensions/newsblog/content/feed-subscriptions.js
@@ -1,16 +1,16 @@
 /* -*- Mode: JavaScript; tab-width: 2; 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/. */
 
 ChromeUtils.import("resource:///modules/FeedUtils.jsm");
 ChromeUtils.import("resource:///modules/gloda/log4moz.js");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
 ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var FeedSubscriptions = {
   get mMainWin() { return Services.wm.getMostRecentWindow("mail:3pane"); },
 
--- a/mailnews/extensions/newsblog/content/newsblogOverlay.js
+++ b/mailnews/extensions/newsblog/content/newsblogOverlay.js
@@ -1,15 +1,15 @@
 /* -*- Mode: JavaScript; tab-width: 2; 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/. */
 
 ChromeUtils.import("resource:///modules/gloda/mimemsg.js");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 // This global is for SeaMonkey compatibility.
 var gShowFeedSummary;
 
 var FeedMessageHandler = {
   gShowSummary: true,
   gToggle: false,
--- a/mailnews/imap/test/unit/head_server.js
+++ b/mailnews/imap/test/unit/head_server.js
@@ -1,15 +1,15 @@
 // We can be executed from multiple depths
 // Provide gDEPTH if not already defined
 if (typeof gDEPTH == "undefined")
   var gDEPTH = "../../../../";
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://testing-common/mailnews/mailTestUtils.js");
 ChromeUtils.import("resource://testing-common/mailnews/localAccountUtils.js");
 ChromeUtils.import("resource://testing-common/mailnews/IMAPpump.js");
 ChromeUtils.import("resource://testing-common/mailnews/PromiseTestUtils.jsm");
 
 var CC = Components.Constructor;
 
--- a/mailnews/imap/test/unit/test_copyThenMove.js
+++ b/mailnews/imap/test/unit/test_copyThenMove.js
@@ -3,17 +3,17 @@
 //
 // Original Author: Kent James <kent@caspia.com>
 
 
 load("../../../resources/logHelper.js");
 load("../../../resources/asyncTestUtils.js");
 load("../../../resources/messageGenerator.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var gEmptyLocal1, gEmptyLocal2;
 var gLastKey;
 var gMessages = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
 var gCopyService = MailServices.copy;
 
 ChromeUtils.import("resource:///modules/folderUtils.jsm");
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
--- a/mailnews/imap/test/unit/test_dontStatNoSelect.js
+++ b/mailnews/imap/test/unit/test_dontStatNoSelect.js
@@ -6,17 +6,17 @@ var gIMAPInbox, gIMAPFolder1, gIMAPFolde
 var gFolder2Mailbox;
 var gFolder1, gFolder2;
 
 load("../../../resources/messageGenerator.js");
 // async support
 load("../../../resources/logHelper.js");
 load("../../../resources/asyncTestUtils.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var tests = [
   checkStatSelect,
   checkStatNoSelect,
   endTest
 ];
 
 function run_test() {
--- a/mailnews/imap/test/unit/test_imapAttachmentSaves.js
+++ b/mailnews/imap/test/unit/test_imapAttachmentSaves.js
@@ -8,17 +8,17 @@
 
 load("../../../resources/logHelper.js");
 load("../../../resources/asyncTestUtils.js");
 load("../../../resources/messageGenerator.js");
 
 // javascript mime emitter functions
 var mimeMsg = {};
 ChromeUtils.import("resource:///modules/gloda/mimemsg.js", mimeMsg);
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 // IMAP pump
 
 var kAttachFileName = 'bob.txt';
 
 setupIMAPPump();
 
 // Dummy message window so we can say the inbox is open in a window.
--- a/mailnews/imap/test/unit/test_imapAuthMethods.js
+++ b/mailnews/imap/test/unit/test_imapAuthMethods.js
@@ -6,17 +6,17 @@
  *
  * BUGS:
  * - cleanup after each test doesn't seem to work correctly. Effects:
  *    - one more "lsub" per test, e.g. "capability", "auth...", "lsub", "lsub", "lsub", "list" in the 3. test.,
  *    - root folder check succeeds although login failed
  * - removeIncomingServer(..., true); (cleanup files) fails.
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 load("../../../resources/alertTestUtils.js");
 
 //const kUsername = "fred";
 //const kPassword = "wilma";
 
 var thisTest;
 var test = null;
--- a/mailnews/imap/test/unit/test_imapAutoSync.js
+++ b/mailnews/imap/test/unit/test_imapAutoSync.js
@@ -21,17 +21,17 @@
 load("../../../resources/logHelper.js");
 
 load("../../../resources/asyncTestUtils.js");
 
 load("../../../resources/alertTestUtils.js");
 load("../../../resources/messageGenerator.js");
 
 // Globals
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 setupIMAPPump();
 
 var msgFlagOffline = Ci.nsMsgMessageFlags.Offline;
 var nsIAutoSyncMgrListener = Ci.nsIAutoSyncMgrListener;
 
 var gGotAlert;
 
--- a/mailnews/imap/test/unit/test_imapContentLength.js
+++ b/mailnews/imap/test/unit/test_imapContentLength.js
@@ -9,17 +9,17 @@
 /*
  * Test content length for the IMAP protocol. This focuses on necko URLs
  * that are run externally.
  */
 
 load("../../../resources/logHelper.js");
 load("../../../resources/asyncTestUtils.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var gMsgHdr = null;
 
 // Take a multipart message as we're testing attachment URLs as well
 var gFile = do_get_file("../../../data/multipart-complex2");
 
 var tests = [
   setup,
--- a/mailnews/imap/test/unit/test_imapCopyTimeout.js
+++ b/mailnews/imap/test/unit/test_imapCopyTimeout.js
@@ -11,17 +11,17 @@ Services.prefs.setIntPref("mailnews.tcpt
 load("../../../resources/logHelper.js");
 load("../../../resources/asyncTestUtils.js");
 load("../../../resources/alertTestUtils.js");
 load("../../../resources/messageGenerator.js");
 
 // IMAP pump
 
 // Globals
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 setupIMAPPump();
 
 var gGotAlert = false;
 var gGotMsgAdded = false;
 
 function alert(aDialogTitle, aText) {
   Assert.ok(aText.startsWith("Connection to server localhost timed out."));
--- a/mailnews/imap/test/unit/test_imapFilterActionsPostplugin.js
+++ b/mailnews/imap/test/unit/test_imapFilterActionsPostplugin.js
@@ -2,17 +2,17 @@
  * This file tests imap filter actions post-plugin, which uses nsMsgFilterAfterTheFact
  *
  * Original author: Kent James <kent@caspia.com>
  * adapted from test_imapFilterActions.js
  */
 
 ChromeUtils.import("resource:///modules/folderUtils.jsm");
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Task.jsm");
 
 var nsMsgSearchScope = Ci.nsMsgSearchScope;
 var nsMsgSearchAttrib = Ci.nsMsgSearchAttrib;
 var nsMsgSearchOp = Ci.nsMsgSearchOp;
 var Is = nsMsgSearchOp.Is;
 var Contains = nsMsgSearchOp.Contains;
 var Subject = nsMsgSearchAttrib.Subject;
--- a/mailnews/imap/test/unit/test_imapFolderCopy.js
+++ b/mailnews/imap/test/unit/test_imapFolderCopy.js
@@ -5,17 +5,17 @@
 load("../../../resources/logHelper.js");
 load("../../../resources/asyncTestUtils.js");
 load("../../../resources/messageGenerator.js");
 
 var gEmptyLocal1, gEmptyLocal2, gEmptyLocal3, gNotEmptyLocal4;
 
 ChromeUtils.import("resource:///modules/folderUtils.jsm");
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var tests = [
   setup,
   function* copyFolder1() {
     dump("gEmpty1 " + gEmptyLocal1.URI + "\n");
     let folders = new Array;
     folders.push(gEmptyLocal1.QueryInterface(Ci.nsIMsgFolder));
     let array = toXPCOMArray(folders, Ci.nsIMutableArray);
--- a/mailnews/imap/test/unit/test_imapHdrChunking.js
+++ b/mailnews/imap/test/unit/test_imapHdrChunking.js
@@ -6,17 +6,17 @@
  * Tests imap msg header download chunking
  */
 
 load("../../../resources/logHelper.js");
 load("../../../resources/asyncTestUtils.js");
 load("../../../resources/messageGenerator.js");
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 // javascript mime emitter functions
 
 // IMAP pump
 
 setupIMAPPump();
 
 // Dummy message window so we can say the inbox is open in a window.
 var dummyMsgWindow =
--- a/mailnews/imap/test/unit/test_imapHighWater.js
+++ b/mailnews/imap/test/unit/test_imapHighWater.js
@@ -1,16 +1,16 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /*
  * Test to ensure that offline imap moves handle extremely high highwater
  * marks.
  */
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 load("../../../resources/logHelper.js");
 load("../../../resources/alertTestUtils.js");
 load("../../../resources/asyncTestUtils.js");
 load("../../../resources/messageGenerator.js");
 
 var gIMAPDaemon, gServer, gIMAPIncomingServer;
 
--- a/mailnews/imap/test/unit/test_imapMove.js
+++ b/mailnews/imap/test/unit/test_imapMove.js
@@ -1,16 +1,16 @@
 /* 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/. */
 
 // This tests that we use IMAP move if the IMAP server supports it.
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 load("../../../resources/logHelper.js");
 load("../../../resources/messageGenerator.js");
 
 var gFolder1;
 
 var tests = [
   setupCUSTOM1,
--- a/mailnews/imap/test/unit/test_imapRename.js
+++ b/mailnews/imap/test/unit/test_imapRename.js
@@ -1,16 +1,16 @@
 /* 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/. */
 
 // This tests that renaming non-ASCII name folder works.
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 load("../../../resources/logHelper.js");
 load("../../../resources/asyncTestUtils.js");
 
 setupIMAPPump();
 
 var tests = [
   setup,
--- a/mailnews/imap/test/unit/test_imapUndo.js
+++ b/mailnews/imap/test/unit/test_imapUndo.js
@@ -5,17 +5,17 @@
 // 2.1 Same, but the server doesn't support COPYUID (GMail case)
 //
 // Original Author: David Bienvenu <bienvenu@nventure.com>
 
 
 load("../../../resources/logHelper.js");
 load("../../../resources/asyncTestUtils.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var gRootFolder;
 var gLastKey;
 var gMessages = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
 var gCopyService = MailServices.copy;
 var gMsgWindow;
 
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
--- a/mailnews/imap/test/unit/test_localToImapFilter.js
+++ b/mailnews/imap/test/unit/test_localToImapFilter.js
@@ -7,17 +7,17 @@
  * Original author: Kent James <kent@caspia.com>
  */
 
 load("../../../resources/logHelper.js");
 load("../../../resources/asyncTestUtils.js");
 load("../../../resources/POP3pump.js");
 ChromeUtils.import("resource:///modules/folderUtils.jsm");
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var gIMAPTrashFolder;
 var gEmptyLocal1, gEmptyLocal2;
 var gLastKey;
 var gMessages = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
 var gFiles = ["../../../data/bugmail1",
                 "../../../data/draft1"];
 
--- a/mailnews/imap/test/unit/test_localToImapFilterQuarantine.js
+++ b/mailnews/imap/test/unit/test_localToImapFilterQuarantine.js
@@ -5,17 +5,17 @@
 /*
  * This file tests copies of multiple messages using filters
  * from incoming POP3, with filter actions copying and moving
  * messages to an IMAP folder, when the POP3 message uses
  * quarantining to help antivirus software. See bug 387361.
  *
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 Services.prefs.setCharPref("mail.serverDefaultStoreContractID",
                            "@mozilla.org/msgstore/berkeleystore;1");
 
 load("../../../resources/POP3pump.js");
 
 // async support
 load("../../../resources/logHelper.js");
--- a/mailnews/imap/test/unit/test_nsIMsgFolderListenerIMAP.js
+++ b/mailnews/imap/test/unit/test_nsIMsgFolderListenerIMAP.js
@@ -12,17 +12,17 @@
 * Currently tested
 * - Adding new folders
 * - Copying messages from files to mailboxes
 * - Adding new messages directly to mailboxes
 */
 
 load("../../../resources/msgFolderListenerSetup.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 // Globals
 var gRootFolder;
 var gIMAPInbox, gIMAPFolder2, gIMAPFolder3, gIMAPTrashFolder;
 var gIMAPDaemon, gServer, gIMAPIncomingServer;
 var gMsgFile1 = do_get_file("../../../data/bugmail10");
 var gMsgFile2 = do_get_file("../../../data/bugmail11");
 var gMsgFile3 = do_get_file("../../../data/draft1");
--- a/mailnews/imap/test/unit/test_offlineDraftDataloss.js
+++ b/mailnews/imap/test/unit/test_offlineDraftDataloss.js
@@ -7,17 +7,17 @@
  * mode is not lost when going back online
  * See Bug 805626
  */
 
 // async support
 load("../../../resources/logHelper.js");
 load("../../../resources/asyncTestUtils.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 // IMAP pump
 
 setupIMAPPump();
 
 // Definition of tests
 
--- a/mailnews/imap/test/unit/test_offlinePlayback.js
+++ b/mailnews/imap/test/unit/test_offlinePlayback.js
@@ -1,15 +1,15 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /*
  * Test to ensure that changes made while offline are played back when we
  * go back online.
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://testing-common/mailnews/PromiseTestUtils.jsm");
 
 load("../../../resources/messageGenerator.js");
 
 var gSecondFolder, gThirdFolder;
 var gSynthMessage1, gSynthMessage2;
 // the message id of bugmail10
 var gMsgId1 = "200806061706.m56H6RWT004933@mrapp54.mozilla.org";
--- a/mailnews/imap/test/unit/test_offlineStoreLocking.js
+++ b/mailnews/imap/test/unit/test_offlineStoreLocking.js
@@ -4,17 +4,17 @@
  * with offline store locking correctly.
  */
 
 load("../../../resources/logHelper.js");
 load("../../../resources/asyncTestUtils.js");
 load("../../../resources/messageGenerator.js");
 load("../../../resources/alertTestUtils.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 
 // Globals
 var gIMAPTrashFolder, gMsgImapInboxFolder;
 var gGotAlert = false;
 var gMovedMsgId;
 
--- a/mailnews/imap/test/unit/test_preserveDataOnMove.js
+++ b/mailnews/imap/test/unit/test_preserveDataOnMove.js
@@ -7,17 +7,17 @@
 
 // async support
 load("../../../resources/logHelper.js");
 load("../../../resources/asyncTestUtils.js");
 
 // IMAP pump
 
 // Globals
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var gMessage = "bugmail10"; // message file used as the test message
 
 setupIMAPPump();
 
 // Definition of tests
 var tests = [
   createSubfolder,
--- a/mailnews/imap/test/unit/test_saveImapDraft.js
+++ b/mailnews/imap/test/unit/test_saveImapDraft.js
@@ -6,17 +6,17 @@
  * This file tests that a message saved as draft in an IMAP folder is correctly
  * marked as unread.
  */
 
 // async support
 load("../../../resources/logHelper.js");
 load("../../../resources/asyncTestUtils.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 // IMAP pump
 
 setupIMAPPump();
 
 // Definition of tests
 
--- a/mailnews/imap/test/unit/test_saveTemplate.js
+++ b/mailnews/imap/test/unit/test_saveTemplate.js
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Tests imap save of message as a template, and test initial save right after
  * creation of folder.
  */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/MailUtils.js");
 
 load("../../../resources/logHelper.js");
 load("../../../resources/asyncTestUtils.js");
 load("../../../resources/messageGenerator.js");
 
 // IMAP pump
 
--- a/mailnews/imap/test/unit/test_starttlsFailure.js
+++ b/mailnews/imap/test/unit/test_starttlsFailure.js
@@ -1,15 +1,15 @@
 /**
  * This test checks that we handle the server dropping the connection
  * on starttls. Since fakeserver doesn't support STARTTLS, I've made
  * it drop the connection when it's attempted.
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 load("../../../resources/logHelper.js");
 load("../../../resources/alertTestUtils.js");
 load("../../../resources/asyncTestUtils.js");
 
 var gGotAlert = false;
 
--- a/mailnews/imap/test/unit/test_stopMovingToLocalFolder.js
+++ b/mailnews/imap/test/unit/test_stopMovingToLocalFolder.js
@@ -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/. */
 
 /* Test that the message failed to move to a local folder remains on IMAP
  * server. */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 load("../../../resources/logHelper.js");
 load("../../../resources/asyncTestUtils.js");
 load("../../../resources/messageGenerator.js");
 
 setupIMAPPump();
 
 function stop_server() {
--- a/mailnews/imap/test/unit/test_trustSpamAssassin.js
+++ b/mailnews/imap/test/unit/test_trustSpamAssassin.js
@@ -13,17 +13,17 @@
 
 // async support
 load("../../../resources/logHelper.js");
 load("../../../resources/asyncTestUtils.js");
 
 // IMAP pump
 
 // Globals
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var gMessage = "SpamAssassinYes"; // message file used as the test message
 
 setupIMAPPump();
 
 // Definition of tests
 
 var tests = [
--- a/mailnews/import/content/importDialog.js
+++ b/mailnews/import/content/importDialog.js
@@ -1,17 +1,17 @@
 /* -*- Mode: Javascript; tab-width: 2; 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/. */
 
 "use strict";
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var gImportType = null;
 var gImportMsgsBundle;
 var gFeedsBundle;
 var gImportService = null;
 var gSuccessStr = null;
 var gErrorStr = null;
--- a/mailnews/import/test/unit/head_import.js
+++ b/mailnews/import/test/unit/head_import.js
@@ -1,10 +1,10 @@
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 var CC = Components.Constructor;
 
 // Ensure the profile directory is set up
 do_get_profile();
 
 // Import the required setup scripts.
--- a/mailnews/import/test/unit/resources/import_helper.js
+++ b/mailnews/import/test/unit/resources/import_helper.js
@@ -1,10 +1,10 @@
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 // used by checkProgress to periodically check the progress of the import
 var gGenericImportHelper;
 /**
  * GenericImportHelper
  * The parent class of AbImportHelper, MailImportHelper, SettingsImportHelper
  *                     and FiltersImportHelper.
  *
--- a/mailnews/import/test/unit/test_bug_263304.js
+++ b/mailnews/import/test/unit/test_bug_263304.js
@@ -1,17 +1,17 @@
 /**
  * Tests importing an address book export in the LDAP data interchange format
  * (LDIF) with a labeledURI and checks the accuracy of the imported contact.
  *
  * This test checks for the following bug:
  *   - Bug 264405: The Address Book doesn't show the LDAP-field "labeledURI"
  *                 as Website
  */
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 function run_test()
 {
   // Due to the import code using nsIAbManager off the main thread, we need
   // to ensure that it is initialized before we start the main test.
   var abMgr = MailServices.ab;
 
   var file = do_get_file("resources/bug_263304.ldif");
--- a/mailnews/import/test/unit/test_ldif_import.js
+++ b/mailnews/import/test/unit/test_ldif_import.js
@@ -3,17 +3,17 @@
  * format and checks the accuracy of the imported address book's cards.
  * The current export contains only one card with most fields full.
  *
  * This test also checks for the following bugs:
  *   -Bug 439819: LDIF import does not include mozillahomestreet.
  *   -Bug 182128: Edit Card, Notes on several lines appear on one after
  *                export/import in text format *(only tests the import).
  */
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 function run_test()
 {
   // Due to the import code using nsIAbManager off the main thread, we need
   // to ensure that it is initialized before we start the main test.
   var abMgr = MailServices.ab;
 
   var file = do_get_file("resources/basic_ldif_addressbook.ldif");
--- a/mailnews/import/test/unit/test_outlook_settings.js
+++ b/mailnews/import/test/unit/test_outlook_settings.js
@@ -1,10 +1,10 @@
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 load("resources/mock_windows_reg_factory.js");
 
 function POP3Account() {}
 
 POP3Account.prototype = {
   'Account Name': 'POP3 Account Name',
   'POP3 Server': 'pop.host.invalid',
--- a/mailnews/import/test/unit/test_shiftjis_csv.js
+++ b/mailnews/import/test/unit/test_shiftjis_csv.js
@@ -1,9 +1,9 @@
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 function run_test()
 {
   Services.prefs.setCharPref("intl.charset.detector", "ja_parallel_state_machine");
   registerCleanupFunction(function() {
       Services.prefs.clearUserPref("intl.charset.detector");
   });
 
--- a/mailnews/import/test/unit/test_utf16_csv.js
+++ b/mailnews/import/test/unit/test_utf16_csv.js
@@ -1,9 +1,9 @@
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 function run_test()
 {
   // Due to the import code using nsIAbManager off the main thread, we need
   // to ensure that it is initialized before we start the main test.
   let abMgr = MailServices.ab;
 
   let file = do_get_file("resources/utf16_addressbook.csv");
--- a/mailnews/jsaccount/test/unit/head_jsaccount.js
+++ b/mailnews/jsaccount/test/unit/head_jsaccount.js
@@ -1,17 +1,17 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80 filetype=javascript: */
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 var CC = Components.Constructor;
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://testing-common/mailnews/mailTestUtils.js");
 ChromeUtils.import("resource://testing-common/mailnews/localAccountUtils.js");
 
 // Load the test components.
 do_load_manifest("resources/testComponents.manifest")
 // Ensure the profile directory is set up.
 do_get_profile();
--- a/mailnews/jsaccount/test/unit/test_jaMsgFolder.js
+++ b/mailnews/jsaccount/test/unit/test_jaMsgFolder.js
@@ -4,17 +4,17 @@
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // This tests the additional methods added to JaMsgFolder.cpp that are not
 // in nsMsgDBFolder.cpp  Although this code have been done creating the
 // delegator class directly, instead we use a JS component as a demo of
 // JS override classes.
 
 ChromeUtils.import("resource://testing-common/mailnews/testJaBaseMsgFolder.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var interfaces = JaBaseMsgFolderProperties.baseInterfaces;
 
 function run_test()
 {
   let server = MailServices.accounts.createIncomingServer("foouser", "foohost", "testja");
   Assert.ok(server instanceof Ci.msgIOverride);
 
--- a/mailnews/local/test/unit/head_maillocal.js
+++ b/mailnews/local/test/unit/head_maillocal.js
@@ -1,10 +1,10 @@
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://testing-common/mailnews/mailTestUtils.js");
 ChromeUtils.import("resource://testing-common/mailnews/localAccountUtils.js");
 
 var CC = Components.Constructor;
 
 // WebApps.jsm called by ProxyAutoConfig (PAC) requires a valid nsIXULAppInfo.
 ChromeUtils.import("resource://testing-common/AppInfo.jsm");
@@ -15,17 +15,17 @@ do_get_profile();
 
 var gDEPTH = "../../../../";
 
 // Import the pop3 server scripts
 ChromeUtils.import("resource://testing-common/mailnews/maild.js");
 ChromeUtils.import("resource://testing-common/mailnews/auth.js");
 ChromeUtils.import("resource://testing-common/mailnews/pop3d.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 // Setup the daemon and server
 // If the debugOption is set, then it will be applied to the server.
 function setupServerDaemon(debugOption) {
   var daemon = new pop3Daemon();
   var extraProps = {};
   function createHandler(d) {
     var handler = new POP3_RFC5034_handler(d);
--- a/mailnews/local/test/unit/test_bug457168.js
+++ b/mailnews/local/test/unit/test_bug457168.js
@@ -1,13 +1,13 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /**
  * Protocol tests for POP3.
  */
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var type = null;
 var test = null;
 var server;
 var daemon;
 var incomingServer;
 var thisTest;
 
--- a/mailnews/local/test/unit/test_fileName.js
+++ b/mailnews/local/test/unit/test_fileName.js
@@ -1,14 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /**
  * Test handling of special chars in folder names
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 function run_test() {
   let testFolderName = "";
   let OSname = Cc["@mozilla.org/system-info;1"].getService(Ci.nsIPropertyBag2).getProperty("name");
   if (OSname == "Windows_NT") {
     // On Windows test file with ' ' in the name.
     testFolderName = "bugmail 1";
--- a/mailnews/local/test/unit/test_movemailDownload.js
+++ b/mailnews/local/test/unit/test_movemailDownload.js
@@ -1,13 +1,13 @@
 /**
  * The intent of this file is to test that movemail download code
  * works correctly.
  */
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/Task.jsm");
 ChromeUtils.import("resource://testing-common/mailnews/PromiseTestUtils.jsm");
 
 var gPluggableStores = [
   "@mozilla.org/msgstore/berkeleystore;1",
   "@mozilla.org/msgstore/maildirstore;1"
 ];
--- a/mailnews/local/test/unit/test_msgIDParsing.js
+++ b/mailnews/local/test/unit/test_msgIDParsing.js
@@ -1,14 +1,14 @@
 /*
  * Test bug 676916 - nsParseMailbox parses multi-line message-id header incorrectly
  */
 
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://testing-common/mailnews/localAccountUtils.js");
 
 var gMessenger = Cc["@mozilla.org/messenger;1"].
                    createInstance(Ci.nsIMessenger);
 
 var headers =
   "from: alice@t1.example.com\r\n" +
   "to: bob@t2.example.net\r\n" +
--- a/mailnews/local/test/unit/test_nsIMsgLocalMailFolder.js
+++ b/mailnews/local/test/unit/test_nsIMsgLocalMailFolder.js
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /*
  * Test suite for local folder functions.
  */
 
 load("../../../resources/messageGenerator.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
 /**
  * Bug 66763
  * Test deletion of a folder with a name already existing in Trash.
  */
 function subtest_folder_deletion(root) {
   // Now we only have <root> and some default subfolders, like Trash.
   let trash = root.getChildNamed("Trash");
--- a/mailnews/local/test/unit/test_pop3AuthMethods.js
+++ b/mailnews/local/test/unit/test_pop3AuthMethods.js
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /**
  * Login tests for POP3
  *
  * Test code <copied from="test_pop3GetNewMail.js">
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var server;
 var daemon;
 var handler;
 var incomingServer;
 var thisTest;
 var test = null;
 
--- a/mailnews/local/test/unit/test_pop3FilterActions.js
+++ b/mailnews/local/test/unit/test_pop3FilterActions.js
@@ -3,17 +3,17 @@
  * into the message keywords header. It also tests marking read,
  * and flagging messages.
  *
  * Original author: David Bienvenu <dbienvenu@mozilla.com>
  */
 
 
 load("../../../resources/POP3pump.js");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://testing-common/mailnews/PromiseTestUtils.jsm");
 
 var gFiles = ["../../../data/bugmail10", "../../../data/bugmail11"];
 
 Services.prefs.setBoolPref("mail.server.default.leave_on_server", true);
 
--- a/mailnews/local/test/unit/test_pop3GSSAPIFail.js
+++ b/mailnews/local/test/unit/test_pop3GSSAPIFail.js
@@ -13,17 +13,17 @@
  * of reality of the above cases.
  *
  * Actually, we (more precisely the OS GSSAPI lib) fail out of band
  * in the Kerberos protocol, before the AUTH GSSAPI command is even issued.
  *
  * @author Ben Bucksch
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var server;
 var daemon;
 var authSchemes;
 var incomingServer;
 var thisTest;
 var test = null;
 
--- a/mailnews/local/test/unit/test_pop3MoveFilter.js
+++ b/mailnews/local/test/unit/test_pop3MoveFilter.js
@@ -2,17 +2,17 @@
  * This file tests that a pop3 move filter doesn't leave the
  * original message in the inbox.
  *
  * Original author: David Bienvenu <dbienvenu@mozilla.com>
  */
 
 
 load("../../../resources/POP3pump.js");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://testing-common/mailnews/PromiseTestUtils.jsm");
 
 var gFiles = ["../../../data/bugmail10", "../../../data/bugmail11"];
 
 // make sure limiting download size doesn't causes issues with move filters.
 Services.prefs.setBoolPref("mail.server.default.limit_offline_message_size", true);
--- a/mailnews/local/test/unit/test_pop3MoveFilter2.js
+++ b/mailnews/local/test/unit/test_pop3MoveFilter2.js
@@ -3,17 +3,17 @@
  * info from previous moves.
  *
  * Original author: David Bienvenu <dbienvenu@mozilla.com>
  */
 
 
 load("../../../resources/POP3pump.js");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 var gFiles = ["../../../data/bugmail10", "../../../data/basic1"];
 
 Services.prefs.setBoolPref("mail.server.default.leave_on_server", true);
 
 // Currently we have two mailbox storage formats.
 var gPluggableStores = [
   "@mozilla.org/msgstore/berkeleystore;1",
--- a/mailnews/local/test/unit/test_pop3Password.js
+++ b/mailnews/local/test/unit/test_pop3Password.js
@@ -1,14 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /**
  * Authentication tests for POP3.
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 load("../../../resources/passwordStorage.js");
 
 var test = null;
 var server;
 var daemon;
 var incomingServer;
 var thisTest;
--- a/mailnews/local/test/unit/test_pop3Password2.js
+++ b/mailnews/local/test/unit/test_pop3Password2.js
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /**
  * Authentication tests for POP3 - checks for servers whose details have
  * changed (e.g. realusername and realhostname are different from username and
  * hostname).
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 load("../../../resources/passwordStorage.js");
 
 var test = null;
 var server;
 var daemon;
 var incomingServer;
 var thisTest;
--- a/mailnews/local/test/unit/test_pop3Password3.js
+++ b/mailnews/local/test/unit/test_pop3Password3.js
@@ -1,14 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /**
  * Extra tests for POP3 passwords (forgetPassword)
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 load("../../../resources/passwordStorage.js");
 
 var kUser1 = "testpop3";
 var kUser2 = "testpop3a";
 var kProtocol = "pop3";
 var kHostname = "localhost";
--- a/mailnews/local/test/unit/test_pop3PasswordFailure.js
+++ b/mailnews/local/test/unit/test_pop3PasswordFailure.js
@@ -4,17 +4,17 @@
  *   - Have an invalid password in the password database.
  *   - Check we get a prompt asking what to do.
  *   - Check retry does what it should do.
  *   - Check cancel does what it should do.
  *   - Re-initiate connection, this time select enter new password, check that
  *     we get a new password prompt and can enter the password.
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 load("../../../resources/logHelper.js");
 load("../../../resources/alertTestUtils.js");
 load("../../../resources/passwordStorage.js");
 load("../../../resources/mailTestUtils.js");
 load("../../../resources/asyncTestUtils.js");
--- a/mailnews/local/test/unit/test_pop3PasswordFailure2.js
+++ b/mailnews/local/test/unit/test_pop3PasswordFailure2.js
@@ -5,17 +5,17 @@
  *   - Check we get a prompt asking what to do.
  *   - Check retry does what it should do.
  *   - Check cancel does what it should do.
  *   - Re-initiate connection, this time select enter new password, check that
  *     we get a new password prompt and can enter the password.
  */
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 load("../../../resources/logHelper.js");
 load("../../../resources/asyncTestUtils.js");
 load("../../../resources/alertTestUtils.js");
 load("../../../resources/passwordStorage.js");
 load("../../../resources/mailTestUtils.js");
 
 var test = null;
--- a/mailnews/local/test/unit/test_pop3PasswordFailure3.js
+++ b/mailnews/local/test/unit/test_pop3PasswordFailure3.js
@@ -7,17 +7,17 @@
  *   - Check we get a prompt asking what to do.
  *   - Check retry does what it should do.
  *   - Check cancel does what it should do.
  *   - Re-initiate connection, this time select enter new password, check that
  *     we get a new password prompt and can enter the password.
  */
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 load("../../../resources/logHelper.js");
 load("../../../resources/asyncTestUtils.js");
 load("../../../resources/alertTestUtils.js");
 load("../../../resources/passwordStorage.js");
 load("../../../resources/mailTestUtils.js");
 
 var test = null;
--- a/mailnews/local/test/unit/test_pop3ServerBrokenCRAMDisconnect.js
+++ b/mailnews/local/test/unit/test_pop3ServerBrokenCRAMDisconnect.js
@@ -18,17 +18,17 @@
  *    and start with the next in list, not trying the broken one again.
  *    We currently neither retry nor remember.
  * - incomingServer thinks it is still running/busy although the connection is
  *    clearly done and over.
  *
  * @author Ben Bucksch
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var server;
 var daemon;
 var incomingServer;
 var test = "Server which advertises CRAM-MD5, but closes the connection when it's tried";
 // that's how it currently looks like (we fail to log in):
 var expectedTransaction = [ "AUTH", "CAPA", "AUTH CRAM-MD5" ];
 // TODO that's how it should look like (we start a new connection and try another scheme):
--- a/mailnews/local/test/unit/test_pop3ServerBrokenCRAMFail.js
+++ b/mailnews/local/test/unit/test_pop3ServerBrokenCRAMFail.js
@@ -1,14 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /**
  * Server which advertises CRAM-MD5, but fails when it's tried.
  * This reportedly happens for some misconfigured servers.
  */
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var server;
 var daemon;
 var incomingServer;
 var test = "Server which advertises CRAM-MD5, but fails when it's tried";
 var expectedTransaction = [ "AUTH", "CAPA", "AUTH CRAM-MD5", "AUTH PLAIN", "STAT" ];
 
 var urlListener =
--- a/mailnews/local/test/unit/test_undoDelete.js
+++ b/mailnews/local/test/unit/test_undoDelete.js
@@ -1,14 +1,14 @@
 // This file tests undoing of an local folder message deleted to the trash.
 //
 // Original Author: David Bienvenu <dbienvenu@mozilla.com>
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 // Globals
 var gMsg1;
 var gMessages = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
 var gMsgWindow;
 var gCurTestNum;
 var gMsgId1;
 var gTestFolder;
--- a/mailnews/local/test/unit/test_verifyLogon.js
+++ b/mailnews/local/test/unit/test_verifyLogon.js
@@ -1,17 +1,17 @@
 /**
  * This test checks to see if the pop3 verify logon handles password failure correctly.
  * The steps are:
  *   - Set an invalid password on the server object.
  *   - Check that verifyLogon fails
  */
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 load("../../../resources/alertTestUtils.js");
 
 var test = null;
 var server;
 var daemon;
 var incomingServer;
 var pop3Service;
--- a/mailnews/mime/test/unit/head_mime.js
+++ b/mailnews/mime/test/unit/head_mime.js
@@ -1,10 +1,10 @@
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://testing-common/mailnews/mailTestUtils.js");
 
 var CC = Components.Constructor;
 
 // Ensure the profile directory is set up
 do_get_profile();
 
--- a/mailnews/mime/test/unit/test_EncodeMimePartIIStr_UTF8.js
+++ b/mailnews/mime/test/unit/test_EncodeMimePartIIStr_UTF8.js
@@ -1,15 +1,15 @@
 /* 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/. */
 
 // This tests minimal mime encoding fixed in bug 458685
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 function run_test() {
   var i;
 
   var checks =
   [
     ["", false, ""],
     ["\u0436", false, "=?UTF-8?B?0LY=?="], //CYRILLIC SMALL LETTER ZHE
--- a/mailnews/mime/test/unit/test_bug493544.js
+++ b/mailnews/mime/test/unit/test_bug493544.js
@@ -1,13 +1,13 @@
 //
 // Tests if a multi-line MIME header is parsed even if it violates RFC 2047
 //
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 function run_test() {
   const headers = [
     { encoded:
       "Subject: AAA =?UTF-8?Q?bbb?= CCC =?UTF-8?Q?ddd?= EEE =?UTF-8?Q?fff?= GGG"
     , defaultCharset: "UTF-8"
     , overrideCharset: false
     , eatContinuation: false
--- a/mailnews/mime/test/unit/test_nsIMsgHeaderParser1.js
+++ b/mailnews/mime/test/unit/test_nsIMsgHeaderParser1.js
@@ -1,14 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /*
  * Test suite for nsIMsgHeaderParser functions.
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 function run_test() {
   var checks =
   [
     ["", "test@foo.invalid", "test@foo.invalid"],
     ["Test", "test@foo.invalid", "Test <test@foo.invalid>"],
     ["Test", "\"abc!x.yz\"@foo.invalid", "Test <\"abc!x.yz\"@foo.invalid>"],
     ["Test", "test.user@foo.invalid", "Test <test.user@foo.invalid>"],
--- a/mailnews/mime/test/unit/test_nsIMsgHeaderParser2.js
+++ b/mailnews/mime/test/unit/test_nsIMsgHeaderParser2.js
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /*
  * Test suite for nsIMsgHeaderParser functions:
  *   extractHeaderAddressMailboxes
  *   extractHeaderAddressNames
  *   extractHeaderAddressName
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 function run_test() {
   // In this array, the sub arrays consist of the following elements:
   // 0: input string
   // 1: expected output from extractHeaderAddressMailboxes
   // 2: expected output from extractHeaderAddressNames
   // 3: expected output from extractHeaderAddressName
   const checks =
--- a/mailnews/mime/test/unit/test_nsIMsgHeaderParser3.js
+++ b/mailnews/mime/test/unit/test_nsIMsgHeaderParser3.js
@@ -1,14 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /*
  * Test suite for nsIMsgHeaderParser function removeDuplicateAddresses:
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 function run_test() {
   const checks =
   [
     { addrs: "test@foo.invalid",
       otherAddrs: "",
       expectedResult: "test@foo.invalid" },
     { addrs: "foo bar <test@foo.invalid>",
--- a/mailnews/mime/test/unit/test_nsIMsgHeaderParser4.js
+++ b/mailnews/mime/test/unit/test_nsIMsgHeaderParser4.js
@@ -1,14 +1,14 @@
 /* -*- Mode: JavaScript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /*
  * Test suite for nsIMsgHeaderParser::makeFromDisplayAddress
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 function run_test() {
   const checks =
   [
     { displayString: "",
       addresses: [] },
     { displayString: "test@foo.invalid",
       addresses: [["", "test@foo.invalid"]] },
--- a/mailnews/mime/test/unit/test_nsIMsgHeaderParser5.js
+++ b/mailnews/mime/test/unit/test_nsIMsgHeaderParser5.js
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /*
  * Test suite for nsIMsgHeaderParser functions:
  *   parseDecodedHeader
  *   parseEncodedHeader
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 function equalArrays(arr1, arr2) {
   Assert.equal(arr1.length, arr2.length);
   for (let i = 0; i < arr1.length; i++) {
     Assert.equal(arr1[i].name, arr2[i].name);
     Assert.equal(arr1[i].email, arr2[i].email);
   }
 }
--- a/mailnews/mime/test/unit/test_parseHeadersWithArray.js
+++ b/mailnews/mime/test/unit/test_parseHeadersWithArray.js
@@ -1,14 +1,14 @@
 /*
  * Test that nsIMsgHeaderParser.parseHeadersWithArray returns
  * null instead of 0-length strings.
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 function run_test() {
   let addresses = {}, names = {}, fullAddresses = {};
   let n = MailServices.headerParser.parseHeadersWithArray("example@host.invalid",
                                                           addresses, names, fullAddresses);
   Assert.equal(1, n);
   Assert.equal("example@host.invalid", addresses.value[0]);
   Assert.equal(null, names.value[0]);
--- a/mailnews/news/content/downloadheaders.js
+++ b/mailnews/news/content/downloadheaders.js
@@ -1,14 +1,14 @@
 /* -*- Mode: Java; 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/. */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var markreadElement = null;
 var numberElement = null;
 
 var nntpServer = null;
 var args = null;
 
 function OnLoad()
--- a/mailnews/news/src/nsNewsAutoCompleteSearch.js
+++ b/mailnews/news/src/nsNewsAutoCompleteSearch.js
@@ -1,14 +1,14 @@
 /* -*- Mode: Javascript; tab-width: 2; 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/. */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 var kACR = Ci.nsIAutoCompleteResult;
 var kSupportedTypes = new Set(["addr_newsgroups", "addr_followup"]);
 
 function nsNewsAutoCompleteResult(aSearchString) {
   // Can't create this in the prototype as we'd get the same array for
   // all instances
--- a/mailnews/news/test/unit/head_server_setup.js
+++ b/mailnews/news/test/unit/head_server_setup.js
@@ -1,10 +1,10 @@
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://testing-common/mailnews/localAccountUtils.js");
 
 var CC = Components.Constructor;
 
 // WebApps.jsm called by ProxyAutoConfig (PAC) requires a valid nsIXULAppInfo.
 ChromeUtils.import("resource://testing-common/AppInfo.jsm");
 updateAppInfo();
--- a/mailnews/news/test/unit/test_biff.js
+++ b/mailnews/news/test/unit/test_biff.js
@@ -1,14 +1,14 @@
 // This tests that we can execute biff properly, specifically that filters are
 // run during biff, producing correct counts.
 
 load("../../../resources/filterTestUtils.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 function run_test() {
   // Set up the server and add in filters
   let daemon = setupNNTPDaemon();
   let server = makeServer(NNTP_RFC2980_handler, daemon);
   server.start();
   let localserver = setupLocalServer(server.port);
   // Remove all but the test.filter folder
--- a/mailnews/news/test/unit/test_bug37465.js
+++ b/mailnews/news/test/unit/test_bug37465.js
@@ -1,11 +1,11 @@
 // Bug 37465 -- assertions with no accounts
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 function run_test() {
   var daemon = setupNNTPDaemon();
   var server = makeServer(NNTP_RFC2980_handler, daemon);
   server.start();
 
   // Correct URI?
--- a/mailnews/news/test/unit/test_bug695309.js
+++ b/mailnews/news/test/unit/test_bug695309.js
@@ -14,17 +14,17 @@
 //    a large number of (not really) new messages.
 // For the purposes of this test, we read enough to see if the group command is
 // being misread or not, as it is complicated enough.
 
 load("../../../resources/logHelper.js");
 load("../../../resources/asyncTestUtils.js");
 load("../../../resources/alertTestUtils.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 var daemon, localserver, server;
 var killConnection = false;
 var highWater = 0;
 
 var tests = [
   test_newMsgs,
--- a/mailnews/news/test/unit/test_internalUris.js
+++ b/mailnews/news/test/unit/test_internalUris.js
@@ -1,17 +1,17 @@
 /* Tests internal URIs generated by various methods in the code base.
  * If you manually generate a news URI somewhere, please add it to this test.
  */
 
 load("../../../resources/logHelper.js");
 load("../../../resources/asyncTestUtils.js");
 load("../../../resources/alertTestUtils.js");
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 var dummyMsgWindow = {
   get statusFeedback() {
     return {
       startMeteors: function () {},
       stopMeteors: function () {
         async_driver();
--- a/mailnews/news/test/unit/test_newsAutocomplete.js
+++ b/mailnews/news/test/unit/test_newsAutocomplete.js
@@ -1,17 +1,17 @@
 /* -*- Mode: JavaScript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* ***** BEGIN LICENSE BLOCK *****
  *
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/licenses/publicdomain/
  *
  * ***** END LICENSE BLOCK ***** */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 // The basic daemon to use for testing nntpd.js implementations
 var gDaemon = setupNNTPDaemon();
 
 var ACR = Ci.nsIAutoCompleteResult;
 
 function acObserver() {}
 
--- a/mailnews/news/test/unit/test_nntpPassword2.js
+++ b/mailnews/news/test/unit/test_nntpPassword2.js
@@ -2,17 +2,17 @@
 /**
  * Authentication tests for NNTP (based on RFC4643) - checks for servers whose
  * details have changed (e.g. realhostname is different from hostname).
  *
  * Note: Logins for newsgroup servers for 1.8 were stored with either the
  * default port or the SSL default port. Nothing else!
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 load("../../../resources/passwordStorage.js");
 
 // The basic daemon to use for testing nntpd.js implementations
 var daemon = setupNNTPDaemon();
 
 // Define these up here for checking with the transaction
 var test = null;
--- a/mailnews/news/test/unit/test_nntpPassword3.js
+++ b/mailnews/news/test/unit/test_nntpPassword3.js
@@ -1,14 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /**
  * Extra tests for forgetting newsgroup usernames and passwords.
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 load("../../../resources/passwordStorage.js");
 
 var kUsername = "testnews";
 var kPassword = "newstest";
 var kProtocol = "nntp";
 var kHostname = "localhost";
--- a/mailnews/news/test/unit/test_nntpPasswordFailure.js
+++ b/mailnews/news/test/unit/test_nntpPasswordFailure.js
@@ -5,17 +5,17 @@
  *   - Check we get a prompt asking what to do.
  *   - Check retry does what it should do.
  *   - Check cancel does what it should do.
  *   - Re-initiate connection, this time select enter new password, check that
  *     we get a new password prompt and can enter the password.
  */
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 load("../../../resources/logHelper.js");
 load("../../../resources/asyncTestUtils.js");
 load("../../../resources/alertTestUtils.js");
 load("../../../resources/passwordStorage.js");
 load("../../../resources/mailTestUtils.js");
 
 var test = null;
--- a/mailnews/news/test/unit/test_nntpPost.js
+++ b/mailnews/news/test/unit/test_nntpPost.js
@@ -1,12 +1,12 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 // Tests that the news can correctly post messages
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 function run_test() {
   var daemon = setupNNTPDaemon();
   var server = makeServer(NNTP_RFC977_handler, daemon);
   server.start();
   var localserver = setupLocalServer(server.port);
   var listener = { OnStopRunningUrl: function () {
     localserver.closeCachedConnections();
--- a/mailnews/news/test/unit/test_nntpUrl.js
+++ b/mailnews/news/test/unit/test_nntpUrl.js
@@ -1,17 +1,17 @@
 /* -*- Mode: JavaScript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* ***** BEGIN LICENSE BLOCK *****
  *
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/licenses/publicdomain/
  *
  * ***** END LICENSE BLOCK ***** */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 function getMessageHeaderFromUrl(aUrl) {
   let msgUrl = MailServices.nntp
                 .QueryInterface(Ci.nsIProtocolHandler)
                 .newURI(aUrl)
                 .QueryInterface(Ci.nsIMsgMessageUrl);
   return msgUrl.messageHeader;
 }
--- a/mailnews/test/resources/IMAPpump.js
+++ b/mailnews/test/resources/IMAPpump.js
@@ -12,17 +12,17 @@
  */
 
 var EXPORTED_SYMBOLS = [
   'IMAPPump',
   'setupIMAPPump',
   'teardownIMAPPump'
 ];
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://testing-common/mailnews/localAccountUtils.js");
 ChromeUtils.import("resource://testing-common/mailnews/maild.js");
 ChromeUtils.import("resource://testing-common/mailnews/auth.js");
 ChromeUtils.import("resource://testing-common/mailnews/imapd.js");
 ChromeUtils.import("resource://testing-common/AppInfo.jsm");
 
--- a/mailnews/test/resources/NetworkTestUtils.jsm
+++ b/mailnews/test/resources/NetworkTestUtils.jsm
@@ -11,17 +11,17 @@ this.EXPORTED_SYMBOLS = ['NetworkTestUti
 
 var CC = Components.Constructor;
 
 ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
 ChromeUtils.import("resource://gre/modules/Promise.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/Task.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 const ServerSocket = CC("@mozilla.org/network/server-socket;1",
                         "nsIServerSocket",
                         "init");
 const BinaryInputStream = CC("@mozilla.org/binaryinputstream;1",
                              "nsIBinaryInputStream",
                              "setInputStream");
 
--- a/mailnews/test/resources/POP3pump.js
+++ b/mailnews/test/resources/POP3pump.js
@@ -15,17 +15,17 @@
  *                                   (in) pluggable store contract ID
  *
  * adapted from test_pop3GetNewMail.js
  *
  * Original Author: Kent James <kent@caspia.com>
  *
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://testing-common/mailnews/localAccountUtils.js");
 
 // Import the pop3 server scripts
 ChromeUtils.import("resource://testing-common/mailnews/maild.js");
 ChromeUtils.import("resource://testing-common/mailnews/auth.js");
 ChromeUtils.import("resource://testing-common/mailnews/pop3d.js");
 ChromeUtils.import("resource://gre/modules/Promise.jsm");
 
--- a/mailnews/test/resources/PromiseTestUtils.jsm
+++ b/mailnews/test/resources/PromiseTestUtils.jsm
@@ -7,17 +7,17 @@
  * with mailnews tests.
  */
 
 this.EXPORTED_SYMBOLS = ['PromiseTestUtils'];
 
 var CC = Components.Constructor;
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 /**
  * Url listener that can wrap another listener and trigger a callback.
  *
  * @param [aWrapped] The nsIUrlListener to pass all notifications through to.
  *     This gets called prior to the callback (or async resumption).
  */
 
--- a/mailnews/test/resources/folderEventLogHelper.js
+++ b/mailnews/test/resources/folderEventLogHelper.js
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Hook up folder notifications to logHelper.js.  This is for the benefit of
  *  gloda but others can benefit too.  Cramming it in gloda's file structure
  *  for now.
  */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 function registerFolderEventLogHelper() {
   // Bail if there's no one on the other end who cares about our very
   //  expensive log additions.
   // This stuff might be useful for straight console debugging, but it'll
   //  be costly in the success case, so no go for now.
   if (!logHelperHasInterestedListeners())
     return;
--- a/mailnews/test/resources/localAccountUtils.js
+++ b/mailnews/test/resources/localAccountUtils.js
@@ -1,16 +1,16 @@
 /* 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/. */
 
 this.EXPORTED_SYMBOLS = ['localAccountUtils'];
 
 // MailServices
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var CC = Components.Constructor;
 
 // Local Mail Folders. Requires prior setup of profile directory
 
 var localAccountUtils = {
   inboxFolder: undefined,
--- a/mailnews/test/resources/mailTestUtils.js
+++ b/mailnews/test/resources/mailTestUtils.js
@@ -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/. */
 
 this.EXPORTED_SYMBOLS = ['mailTestUtils'];
 
 ChromeUtils.import("resource://gre/modules/ctypes.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 var CC = Components.Constructor;
 
 // See Bug 903946
 function avoidUncaughtExceptionInExternalProtocolService() {
   try {
     Services.prefs.setCharPref("helpers.private_mime_types_file",
--- a/mailnews/test/resources/messageInjection.js
+++ b/mailnews/test/resources/messageInjection.js
@@ -1,13 +1,13 @@
 /* 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/. */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 try {
   ChromeUtils.import("resource://testing-common/mailnews/imapd.js");
 } catch (e) {
   // mozmill tests include this file, but they don't have testing-only modules
   // loaded. In this case, they don't get to use IMAP.
 }
 
--- a/mailnews/test/resources/messageModifier.js
+++ b/mailnews/test/resources/messageModifier.js
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * This file provides a number of methods for modifying (synthetic) messages
  *  for testing purposes.
  */
 
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 /**
  * Represents a set of synthetic messages, also supporting insertion into and
  *  tracking of the message folders to which they belong.  This then allows
  *  mutations of the messages (in their folders) for testing purposes.
  *
  * In general, you would create a synthetic message set by passing in only a
  *  list of synthetic messages, and then add then messages to nsIMsgFolders by
--- a/mailnews/test/resources/msgFolderListenerSetup.js
+++ b/mailnews/test/resources/msgFolderListenerSetup.js
@@ -1,9 +1,9 @@
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var nsIMsgDBHdr = Ci.nsIMsgDBHdr;
 var nsIArray = Ci.nsIArray;
 var nsIMsgFolder = Ci.nsIMsgFolder;
 
 var gMFNService = Cc["@mozilla.org/messenger/msgnotificationservice;1"]
                       .getService(Ci.nsIMsgFolderNotificationService);
 
--- a/suite/mailnews/addrbook/abCommon.js
+++ b/suite/mailnews/addrbook/abCommon.js
@@ -1,14 +1,14 @@
 /* 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/. */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/IOUtils.js");
 
 var gDirTree = null;
 var abList = null;
 var gAbResultsTree = null;
 var gAbView = null;
 var gAddressBookBundle;
 
--- a/suite/mailnews/addrbook/addressbook.js
+++ b/suite/mailnews/addrbook/addressbook.js
@@ -1,14 +1,14 @@
 /* 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/. */
 
 ChromeUtils.import("resource:///modules/ABQueryUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 const nsIAbListener = Ci.nsIAbListener;
 const kPrefMailAddrBookLastNameFirst = "mail.addr_book.lastnamefirst";
 const kPersistCollapseMapStorage = "directoryTree.json";
 
 var gSearchTimer = null;
--- a/suite/mailnews/compose/MsgComposeCommands.js
+++ b/suite/mailnews/compose/MsgComposeCommands.js
@@ -4,17 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
 ChromeUtils.import("resource://gre/modules/InlineSpellChecker.jsm");
 ChromeUtils.import("resource:///modules/folderUtils.jsm");
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 /**
  * interfaces
  */
 var nsIMsgCompDeliverMode = Ci.nsIMsgCompDeliverMode;
 var nsIMsgCompSendFormat = Ci.nsIMsgCompSendFormat;
 var nsIMsgCompConvertible = Ci.nsIMsgCompConvertible;
 var nsIMsgCompType = Ci.nsIMsgCompType;
--- a/suite/mailnews/compose/addressingWidgetOverlay.js
+++ b/suite/mailnews/compose/addressingWidgetOverlay.js
@@ -1,13 +1,13 @@
 /* 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/. */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 top.MAX_RECIPIENTS = 1; /* for the initial listitem created in the XUL */
 
 var inputElementType = "";
 var selectElementType = "";
 var selectElementIndexTable = null;
 
 var gNumberOfCols = 0;
--- a/suite/mailnews/mailContextMenus.js
+++ b/suite/mailnews/mailContextMenus.js
@@ -1,14 +1,14 @@
 /* -*- Mode: javascript; tab-width: 2; 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/. */
 
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 //NOTE: gMessengerBundle must be defined and set or this Overlay won't work
 
 /**
  * Function to change the highlighted row back to the row that is currently
  * outline/dotted without loading the contents of either rows. This is
  * triggered when the context menu for a given row is hidden/closed
  * (onpopuphiding).
--- a/suite/mailnews/mailWindowOverlay.js
+++ b/suite/mailnews/mailWindowOverlay.js
@@ -3,17 +3,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/. */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
 ChromeUtils.import("resource:///modules/FeedUtils.jsm");
 ChromeUtils.import("resource:///modules/folderUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var kClassicMailLayout  = 0;
 var kWideMailLayout     = 1;
 var kVerticalMailLayout = 2;
 
 var kMouseButtonLeft   = 0;
 var kMouseButtonMiddle = 1;
 var kMouseButtonRight  = 2;
--- a/suite/mailnews/search/ABSearchDialog.js
+++ b/suite/mailnews/search/ABSearchDialog.js
@@ -1,14 +1,14 @@
 /* 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/. */
 
 ChromeUtils.import("resource:///modules/ABQueryUtils.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
 
 var searchSessionContractID = "@mozilla.org/messenger/searchSession;1";
 var gSearchSession;
 
 var nsMsgSearchScope = Ci.nsMsgSearchScope;
 var nsIMsgSearchTerm = Ci.nsIMsgSearchTerm;
 var nsMsgSearchOp = Ci.nsMsgSearchOp;
--- a/suite/mailnews/search/FilterListDialog.js
+++ b/suite/mailnews/search/FilterListDialog.js
@@ -1,15 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; 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/. */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var gEditButton;
 var gDeleteButton;
 var gReorderUpButton;
 var gReorderDownButton;
 var gRunFiltersFolderPickerLabel;
 var gRunFiltersFolderPicker;
 var gRunFiltersButton;