Closed Bug 481663 Opened 15 years ago Closed 4 years ago

"Sending message failed. An error occurred sending mail:...." and Unable to connect to SMTP server after server doesn't return "250 STARTTLS" when using Starttls

Categories

(MailNews Core :: Networking: SMTP, defect)

1.8 Branch
x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: luisjap, Unassigned)

References

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6
Build Identifier: version 2.0.0.19 (20081209)

I am not able to send messages.
This failure message appears:
"Sending message failed. An error occurred sending mail: Unable to connect to STPM server mail.uminho.pt via STARTTLS since it does not offer STARTTLS in EHLO response. Please verify that your mail/news account settings are corrected and try again."

The account settings are correct.
I checked the firewall.
I can send messages using Outlook 2003.
I read somewhere that the TLS protocol from thunderbird is not real TLS protocol.
It is an incompatibility with Outlook Web Access?


Reproducible: Always

Steps to Reproduce:
1. write a message
2. send the message
3. 
Actual Results:  
failure message presents:
"Sending message failed.
An error occurred sending mail: Unable to connect to STPM server mail.uminho.pt via STARTTLS since it does not offer STARTTLS in EHLO response. Please verify that your mail/news account settings are corrected and try again."

Expected Results:  
Send the message properly.
Can you follow the instructions at https://wiki.mozilla.org/MailNews:Logging and attach the SMTP logs to this bug please ?
Summary: Unable to connect to STPM server → Unable to connect to SMTP server
Are you sure that you need starttls and not SSL/TLS (did you already tried to change that) ?
(In reply to comment #2)
> Are you sure that you need starttls and not SSL/TLS (did you already tried to
> change that) ?
----------------

YES, I used all the options. The recommendations from our helpdesk people is to use TLS
Can you try to produce the logs please ?
(In reply to comment #3)
> The recommendations from our helpdesk people is to use TLS

Problem due to Bug 185662 and Bug 350314?
TLS in Server Setting of Tb = StartTLS of SMTP/POP3/IMAP.
I guess "TLS by helpdesk people" = "IETF's protocol name which uses SSL", because your server doesn't support STARTTLS.
> http://www.freesoft.org/CIE/Topics/121.htm
Choose "SSL" at "Server Settings" of Tb. What will happen?
(In reply to comment #5)
> (In reply to comment #3)
> > The recommendations from our helpdesk people is to use TLS
> 
> Problem due to Bug 185662 and Bug 350314?
> TLS in Server Setting of Tb = StartTLS of SMTP/POP3/IMAP.
> I guess "TLS by helpdesk people" = "IETF's protocol name which uses SSL",
> because your server doesn't support STARTTLS.
> > http://www.freesoft.org/CIE/Topics/121.htm
> Choose "SSL" at "Server Settings" of Tb. What will happen?
------------------
If a change to SSL, the message error appear:
"Sending of message failed. The message could not be send conncting to SMTP server mail.uminho.pt failed. The server may be unavailable or refusing SMTP connections. Please verify your SMTP server setting is correct and try again or contact your network administration.
I have contacted the network administration. They say that the problem is the compatibility between Thunderbird and the Outlook Web Access.
Yes, it doesn´t work.
--------------------
(In reply to comment #2)
> Are you sure that you need starttls and not SSL/TLS (did you already tried to
> change that) ?
Luis thanks for the input - could you try to capture the smtp log ? (ask for help if you don't understand the instructions - we will help)
If i change for "TLS if available" the message error is:
"an error occured while sending mail. the mail server responded: 5.7.0 Must issue a STARTTLS command firts. Please verify your email address is correct in your Mail preferences and try again."
I will try to capture the log but I don´t know how to do it properly.
It is this file?

----------------------------
(In reply to comment #1)
> Can you follow the instructions at https://wiki.mozilla.org/MailNews:Logging
> and attach the SMTP logs to this bug please ?
Version: unspecified → 2.0
it is this error report?

// Copyright 2005 Google Inc.
// All Rights Reserved.
//

function gMsgHdr(ns_msghdr) {
  this.nsmsghdr = ns_msghdr;
}

gMsgHdr.prototype = {
  get messageKey() {return this.nsmsghdr.messageKey;},
  get messageId() {return this.nsmsghdr.messageId;},
  get flags() {return this.nsmsghdr.flags;},
  get date() {return this.nsmsghdr.date;},
  get ccList() {return this.nsmsghdr.ccList;},
  get author() {return this.nsmsghdr.author;},
  get flags() {return this.nsmsghdr.flags;},
  get subject() {return this.nsmsghdr.subject;},
  get recipients() {return this.nsmsghdr.recipients;},
  get messageSize() {return this.nsmsghdr.messageSize;},
  get messageOffset() { return this.nsmsghdr.messageOffset;},
  get offlineMessageSize() {return this.nsmsghdr.offlineMessageSize;},

  QueryInterface: function(aIID) {
    if (!aIID.equals(Components.interfaces.gIMsgHdr) &&
        !aIID.equals(Components.interfaces.nsISupports)) {
      throw Components.results.NS_ERROR_NO_INTERFACE;
    }
    return this;
  },
  
  nsmsghdr: null
}



function gMsgDBHdr(ns_msgdbhdr) {
  this.nsmsghdr = ns_msgdbhdr;
}

gMsgDBHdr.prototype = new gMsgHdr();

gMsgDBHdr.prototype.StreamMessage = function (aConsumer) {
  var messenger = Components.classes["@mozilla.org/messenger;1"].createInstance().QueryInterface(Components.interfaces.nsIMessenger);
  var message_service = messenger.messageServiceFromURI(this.GetUri());
  message_service.streamMessage(this.GetUri(), aConsumer, null, null, true, "src", null);
};

gMsgDBHdr.prototype.GetUri = function () {
  return this.nsmsghdr.folder.getUriForMsg(this.nsmsghdr);
};

gMsgDBHdr.prototype.GetFolder = function () {
  var gfolder = new gMsgFolder(this.nsmsghdr.folder);
  return gfolder;
};

gMsgDBHdr.prototype.QueryInterface = function(aIID)  {
  if (!aIID.equals(Components.interfaces.gIMsgDBHdr) &&
      !aIID.equals(Components.interfaces.nsISupports)) {
    throw Components.results.NS_ERROR_NO_INTERFACE;
  }
  return this;
}



function gSimpleEnumerator(simpleenum) {
  this.nssimpleenum = simpleenum;
}

gSimpleEnumerator.prototype = {
  hasMoreElements: function() {return this.nssimpleenum.hasMoreElements();},
  
  getNext: function() {
    var nsmsghdr = this.nssimpleenum.getNext();
    if (!nsmsghdr) throw Components.results.NS_ERROR_FAILURE;

    if (nsmsghdr.QueryInterface(Components.interfaces.nsIMsgDBHdr) == null) {
      throw Components.results.NS_ERROR_FAILURE;
    }
   
    var ghdr = new gMsgDBHdr(nsmsghdr);
    return ghdr;
  },
  
  QueryInterface: function(aIID) {
    if (!aIID.equals(Components.interfaces.nsISimpleEnumerator) &&
        !aIID.equals(Components.interfaces.nsISupports)) {
      throw Components.results.NS_ERROR_NO_INTERFACE;
    }
    return this;
  },

  nssimpleenum: null
}


function gSupportsArray() {
  this.array = new Array();
}

gSupportsArray.prototype = {
  Count: function() {return this.array.length;},
  GetElementAt: function(index) {return this.array[index];},
  AppendElement: function(item) {this.array[this.array.length] = item;},

  QueryInterface: function(aIID) {
    if (!aIID.equals(Components.interfaces.gISupportsArray) &&
        !aIID.equals(Components.interfaces.nsISupports)) {
      throw Components.results.NS_ERROR_NO_INTERFACE;
    }
    return this;
  },

  array: null
}

function gMsgFolder(ns_folder) {
  this.nsfolder = ns_folder;
}

gMsgFolder.prototype = {
  get name() {return this.nsfolder.name;},
  get folderURL() {return this.nsfolder.folderURL;},
  get URI() {return this.nsfolder.URI;},
  get hasSubFolders() {return this.nsfolder.hasSubFolders;},
  get locked() {return this.nsfolder.locked;},
  get flags() {return this.nsfolder.flags;},
  get type() {return this.nsfolder.server.type;},

  GetSubFolders: function() {
    var subfolders = new gSupportsArray();
    var nsfolders = this.nsfolder.GetSubFolders();
    if (!nsfolders) throw Components.results.NS_ERROR_FAILURE;

    if (!this.nsfolder.hasSubFolders) {
      return null; // so we don't keep getting errors in js console throw Components.results.NS_ERROR_FAILURE;
    }
    var done = false;
    while (!done) {
      var item = nsfolders.currentItem();
      if (item) {
        var subfolder = item.QueryInterface(Components.interfaces.nsIMsgFolder);
        if (subfolder) {
          var gfolder = new gMsgFolder(subfolder);
          subfolders.AppendElement(gfolder);
        }
        try {
          nsfolders.next();
        } catch (ex) {
          done = true;
        }
      }
    }
    return subfolders;
  },
  
  getTotalMessages: function(deep) {return this.nsfolder.getTotalMessages(deep);},
  
  getMessages: function(aMsgWindow) {return new gSimpleEnumerator(this.nsfolder.getMessages(aMsgWindow));},
  
  getMsgDatabase: function(aMsgWindow) {return this.nsfolder.getMsgDatabase(aMsgWindow);},
  
  getUriForMsg: function(msgHdr) { return this.nsfolder.getUriForMsg(msgHdr);},
  
  GetMessageHeader: function(msgKey) {
    try {
      var nshdr = this.nsfolder.GetMessageHeader(msgKey);
      if (!nshdr) throw Components.results.NS_ERROR_FAILURE;
      var ghdr = new gMsgDBHdr(nshdr);
      return ghdr;
    } catch (ex) {
      throw Components.results.NS_ERROR_FAILURE;
    }
  },
  
  GetOfflineStoreInputStreamAndSeek: function(offset) {
    var stream = this.nsfolder.offlineStoreInputStream;
    if (!stream) return Components.results.NS_ERROR_FAILURE;
    var seek = stream.QueryInterface(Components.interfaces.nsISeekableStream);
    if (!seek) return Components.results.NS_ERROR_FAILURE;
    seek.seek(Components.interfaces.nsISeekableStream.NS_SEEK_SET, offset);
    return stream;
  },
  
  SupportsOffline: function() {
    return this.nsfolder.flags & 0x8000000;  // MSG_FOLDER_FLAG_OFFLINE
  },
  
  QueryInterface: function(aIID) {
    if (!aIID.equals(Components.interfaces.gIMsgFolder) &&
        !aIID.equals(Components.interfaces.nsIFolderListener) &&
        !aIID.equals(Components.interfaces.nsISupports)) {
      throw Components.results.NS_ERROR_FAILURE;
    }
    return this;
  },
  
  nsfolder: null,
  listener: null
}


function gMsgIncomingServer(ns_server) {
  this.nsserver = ns_server;
  this.gfolder = new gMsgFolder(this.nsserver.rootFolder);
}

gMsgIncomingServer.prototype = {
  get rootFolder() {return this.gfolder;},
  get type() {return this.nsserver.type;},

  QueryInterface: function(aIID)
  {
    if (!aIID.equals(Components.interfaces.gIMsgIncomingServer) &&
        !aIID.equals(Components.interfaces.nsISupports)) {
      throw Components.results.NS_ERROR_NO_INTERFACE;
    }
    return this;
  },
  
  nsserver: null,
  gfolder: null
}


function gMsgAccount(ns_account) {
  this.nsaccount = ns_account;
  this.gserver = new gMsgIncomingServer(this.nsaccount.incomingServer);
}

gMsgAccount.prototype = {
  get incomingServer() {
    return this.gserver;
  },

  QueryInterface: function(aIID) {
    if (!aIID.equals(Components.interfaces.gIMsgAccount) &&
        !aIID.equals(Components.interfaces.nsISupports)) {
      throw Components.results.NS_ERROR_NO_INTERFACE;
    }
    return this
  },
  
  nsaccount: null,
  gserver: null
}

var gMsgAccountManager = 
{
  get accounts() {
    var nsIMsgAccountManager = Components.classes["@mozilla.org/messenger/account-manager;1"];
    if (!nsIMsgAccountManager) return null;
    var account_manager = nsIMsgAccountManager.getService(Components.interfaces.nsIMsgAccountManager);
    if (!account_manager) throw Components.results.NS_ERROR_FAILURE;
    var ns_accounts = account_manager.accounts;
    if (!ns_accounts) throw Components.results.NS_ERROR_FAILURE;
    var accountCount = ns_accounts.Count();
    var accounts = new gSupportsArray;

    for (var i = 0; i < accountCount; i++) {
      var ns_account = ns_accounts.QueryElementAt(i, Components.interfaces.nsIMsgAccount);
      if (ns_account && ns_account.incomingServer) {
        var gaccount = new gMsgAccount(ns_account);
        accounts.AppendElement(gaccount);
      }
    }
    return accounts;
  },

  QueryInterface: function(aIID)
  {
    if (!aIID.equals(Components.interfaces.gIMsgAccountManager) &&
        !aIID.equals(Components.interfaces.nsISupports)) {
      throw Components.results.NS_ERROR_NO_INTERFACE;
    }

    return this;
  }
}


var gMailSession = 
{
  AddFolderListener: function(listener) {
    try {
      this.RemoveFolderListener();
      var mailSessionContractID = "@mozilla.org/messenger/services/session;1";
      var mailSession = Components.classes[mailSessionContractID].getService(Components.interfaces.nsIMsgMailSession);
      var nsIFolderListener = Components.interfaces.nsIFolderListener;
      var notifyFlags = nsIFolderListener.propertyFlagChanged | nsIFolderListener.added;
      this.listener = listener;
      mailSession.AddFolderListener(this, notifyFlags);
    } catch (ex) {
    }
  },
  
  RemoveFolderListener: function() {
    if (this.listener) {
      var mailSessionContractID = "@mozilla.org/messenger/services/session;1";
      var mailSession = Components.classes[mailSessionContractID].getService(Components.interfaces.nsIMsgMailSession);
      mailSession.RemoveFolderListener(this);
      this.listener = null;
    }
  },
  
  OnItemPropertyFlagChanged: function(item, property, oldFlag, newFlag) {
    if (!this.listener) return;
    try {
      var hdr = item.QueryInterface(Components.interfaces.nsIMsgDBHdr);
      var ghdr = new gMsgDBHdr(hdr);
      this.listener.OnItemPropertyFlagChanged(ghdr, oldFlag, newFlag);
    } catch (ex) {
    }
  },
  OnItemAdded: function(parent, item) {
    if (!this.listener) return;
    try {
      var hdr = item.QueryInterface(Components.interfaces.nsIMsgDBHdr);
      var ghdr = new gMsgDBHdr(hdr);
      this.listener.OnItemAdded(ghdr);
    } catch (ex) {
    }
  },
  
  
  QueryInterface: function(aIID) {
    if (!aIID.equals(Components.interfaces.gIMailSession) &&
        !aIID.equals(Components.interfaces.nsISupports)) {
      throw Components.results.NS_ERROR_NO_INTERFACE;
    }

    return this;
  },

  listener: null
}

var gMessengerCompose = 
{
  View: function(folder, messageId) {
    var windowwatcher = Components.classes["@mozilla.org/embedcomp/window-watcher;1"].getService(Components.interfaces.nsIWindowWatcher);
    var ioservice = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
    
    var db = folder.getMsgDatabase(null);
    var message_header = db.getMsgHdrForMessageID(messageId);
    var uri = ioservice.newURI(folder.getUriForMsg(message_header), null, null);
    var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
    str.data = folder.URI;
    
    var args = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray);
    args.AppendElement(uri);
    args.AppendElement(str);
    var window = windowwatcher.openWindow(null, "chrome://messenger/content/messageWindow.xul", "_blank", "all,chrome,dialog=no,status,toolbar", args);
  },

  Reply: function(folder, messageId) {
    this.HandleMessage(folder, messageId, Components.interfaces.nsIMsgCompType.Reply);
  },

  ReplyAll: function(folder, messageId) {
    this.HandleMessage(folder, messageId, Components.interfaces.nsIMsgCompType.ReplyAll);
  },

  Forward: function(folder, messageId) {
    this.HandleMessage(folder, messageId, Components.interfaces.nsIMsgCompType.ForwardInline);
  },

  HandleMessage: function(folder, messageId, type) {
    var nsIMsgComposeService = Components.classes["@mozilla.org/messengercompose;1"].getService(Components.interfaces.nsIMsgComposeService);
    var ioservice = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
    var msgComposeFormat = Components.interfaces.nsIMsgCompFormat;

    var db = folder.getMsgDatabase(null);
    var message_header = db.getMsgHdrForMessageID(messageId);
    var message_uri = folder.getUriForMsg(message_header);

    nsIMsgComposeService.OpenComposeWindow(null, message_uri, type, msgComposeFormat.Default, nsIMsgComposeService.defaultIdentity, null);
  },

  QueryInterface: function(aIID) {
    if (!aIID.equals(Components.interfaces.gIMessengerCompose) &&
        !aIID.equals(Components.interfaces.nsISupports)) {
      throw Components.results.NS_ERROR_NO_INTERFACE;
    }
    return this;
  }
}

var gWebProgressListener = {
  listener : Components.classes['@google/googledesktopwebcapture;1'].getService(Components.interfaces.nsIWebProgressListener),
 
  onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus) {
    this.listener.onStateChange(aWebProgress, aRequest, aStateFlags, aStatus);
  },

  onProgressChange : function(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress) {
    this.listener.onProgressChange(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress);
  },

  onLocationChange : function(aWebProgress, aRequest, aLocation) {
    this.listener.onLocationChange(aWebProgress, aRequest, aLocation);
  },

  onStatusChange : function(aWebProgress, aRequest, aStatus, aMessage) {
    this.listener.onStatusChange(aWebProgress, aRequest, aStatus, aMessage);
  },

  onSecurityChange : function(aWebProgress, aRequest, aState) {
    this.listener.onSecurityChange(aWebProgress, aRequest, aState);
  },

  onLinkIconAvailable : function(browser, aHref) {},

  QueryInterface : function(aIID)
  {
    if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||
        aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
        aIID.equals(Components.interfaces.nsISupports))
      return this;
    throw Components.results.NS_NOINTERFACE;
  },
 }


function gEventHandler(window) {
  this.window = window;
}

gEventHandler.prototype = {
  onLoad:function() {
    var browser = this.window.document.getElementById("content");
    if (browser)
      browser.addProgressListener(gWebProgressListener);
  },
  
  onClose:function() {
    var browser = this.window.document.getElementById("content");
    if (browser)
      browser.removeProgressListener(gWebProgressListener);
    window = null;
  },

  window: null,
}

var gWindowWatcher = 
{
  observe: function(aSubject, aTopic, aData) {
    if (aTopic == "xpcom-startup") {
      this.array = new Array();
      var watcher = Components.classes["@mozilla.org/embedcomp/window-watcher;1"].getService(Components.interfaces.nsIWindowWatcher);
      watcher.registerNotification(this);
    } else if (aTopic == "domwindowopened") {
      var window = aSubject.QueryInterface(Components.interfaces.nsIDOMWindow);
      var event_handler = new gEventHandler(window);
      window.addEventListener("load", event_handler.onLoad, false);
      this.array[this.array.length] = event_handler;
    } else if (aTopic == "domwindowclosed") {
      var window = aSubject.QueryInterface(Components.interfaces.nsIDOMWindow);
      for (i = 0; i < this.array.length; i++) {
        if (this.array[i].window == window) {
          this.array[i].onClose();
          this.array.splice(i, 1);
          i--;
        }
      }
    } else if (aTopic == "xpcom-shutdown") {
      var watcher = Components.classes["@mozilla.org/embedcomp/window-watcher;1"].getService(Components.interfaces.nsIWindowWatcher);
      watcher.unregisterNotification(this);
      this.array = null;
    }
  },

  QueryInterface: function(aIID)
  {
    if (!aIID.equals(Components.interfaces.nsIObserver) &&
        !aIID.equals(Components.interfaces.nsISupports)) {
      throw Components.results.NS_ERROR_NO_INTERFACE;
    }

    return this;
  },
  
  array: null
}


function gCacheVisitor(visitor) {
  this.visitor = visitor;
}

gCacheVisitor.prototype = {
  visitDevice : function(deviceID, deviceInfo) {
    return true;
  },

  visitEntry : function(deviceID, entryInfo) {
    if (!this.visitor)
      return false;

    if (deviceID == "disk" && entryInfo)
      this.visitor.visitEntry(entryInfo.key, entryInfo.lastModified, entryInfo.fetchCount);

    return true;
  },

  QueryInterface: function(aIID) {
    if (!aIID.equals(Components.interfaces.nsICacheVisitor)) {
      throw Components.results.NS_ERROR_NO_INTERFACE;
    }

    return this;
  },

  visitor: null
}

var gCacheService = 
{
  GetCacheSession: function() {
    var nsCacheService = Components.classes["@mozilla.org/network/cache-service;1"].getService(Components.interfaces.nsICacheService);
    return nsCacheService.createSession("HTTP", Components.interfaces.nsICache.STORE_ANYWHERE, true);
  },
  
  visitEntries: function(visitor) {
    try {
    var cache_visitor = new gCacheVisitor(visitor);
    var nsCacheService = Components.classes["@mozilla.org/network/cache-service;1"].getService(Components.interfaces.nsICacheService);
    nsCacheService.visitEntries(cache_visitor);
    } catch (ex) {
      var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
                          .getService(Components.interfaces.nsIConsoleService);
      consoleService.logStringMessage("Got exception in visitEntries" + ex);
    }
  },

  IsWebPage: function(key) {
    try {
      var cache_session = this.GetCacheSession();
      var cache_descriptor = cache_session.openCacheEntry(key, Components.interfaces.nsICache.ACCESS_READ, false);
      var response;
      if (cache_descriptor != null)
        response = cache_descriptor.getMetaDataElement("response-head");
      return (response.indexOf("Content-Type: text/html") >= 0 ||
              response.indexOf("Content-Type: text/plain") >= 0);
    } catch (ex) {
      return false;
    }
  },

  GetEntryStream: function(key) {
    try {
      var cache_session = this.GetCacheSession();
      var cache_descriptor = cache_session.openCacheEntry(key, Components.interfaces.nsICache.ACCESS_READ, false);
      return cache_descriptor.openInputStream(0);
    } catch (ex) {
      throw Components.results.NS_ERROR_FAILURE;
    }
  },

  QueryInterface: function(aIID) {
    if (!aIID.equals(Components.interfaces.gICacheService) &&
        !aIID.equals(Components.interfaces.nsISupports)) {
      throw Components.results.NS_ERROR_NO_INTERFACE;
    }

    return this;
  }
}

var gUtility = 
{
  RemoveAllTabsButCurrent: function() {
    try {
      var window_watcher = Components.classes["@mozilla.org/embedcomp/window-watcher;1"].getService(Components.interfaces.nsIWindowWatcher);
      var active_window = window_watcher.activeWindow;
      var document = active_window.document;
      var browser = document.getElementById("content");
      var current_tab = browser.mCurrentTab;
 
      if (current_tab.previousSibling) {
        browser.removeTab(current_tab.previousSibling);
      }
    } catch (ex) {
    }
  },
  
  SerializeToString: function(root) {
    var serializer = Components.classes["@mozilla.org/xmlextras/xmlserializer;1"].createInstance(Components.interfaces.nsIDOMSerializer);
    if (!serializer) return Components.results.NS_ERROR_FAILURE;
    
    return serializer.serializeToString(root);
  },
  
  IsExtensionInstalled: function(guid) {
    var installed = false;
    try {
      var em = Components.classes["@mozilla.org/extensions/manager;1"].getService(Components.interfaces.nsIExtensionManager);
      var loc = em.getInstallLocation(guid);
      if (loc != null)
        installed = true;
    } catch (ex) {
    }
    
    return installed;
  },
  
  QueryInterface: function(aIID) {
    if (!aIID.equals(Components.interfaces.gIUtility) &&
        !aIID.equals(Components.interfaces.nsISupports)) {
      throw Components.results.NS_ERROR_NO_INTERFACE;
    }

    return this;
  }
}

var gGoogleDesktopModule = 
{
  mObjects:
  {
    accountManager:
    {
      className:     "Google Desktop Stub Account Manager",
      contractID:    "@google/account-manager;1",
      classID:       Components.ID("37863DB5-B835-4fec-AE47-4612D2D4B36D"),

      factory:
      {
        createInstance: function(aOuter, aIID) {
        
          if (aOuter != null) {
            throw Components.results.NS_ERROR_NO_AGGREGATION;
          }
          if (!aIID.equals(Components.interfaces.gIMsgAccountManager) &&
              !aIID.equals(Components.interfaces.nsISupports)) {
            throw Components.results.NS_ERROR_INVALID_ARG;
          }

          return gMsgAccountManager.QueryInterface(aIID);
        },
      }
    },
    
    mailSession:
    {
      className:     "Google Desktop Stub Mail Session",
      contractID:    "@google/mailsession;1",
      classID:       Components.ID("99DB876F-80C4-4610-B987-E0D261AF519C"),

      factory:
      {
        createInstance: function(aOuter, aIID) {
        
          if (aOuter != null) {
            throw Components.results.NS_ERROR_NO_AGGREGATION;
          }
          if (!aIID.equals(Components.interfaces.gIMailSession) && 
              !aIID.equals(Components.interfaces.nsISupports)) {
            throw Components.results.NS_ERROR_INVALID_ARG;
          }

          return gMailSession.QueryInterface(aIID);
        },
      }
    },
    
    messengerCompose:
    {
      className:     "Google Desktop Stub Messenger Compose",
      contractID:    "@google/messengercompose;1",
      classID:       Components.ID("841BCA86-5F57-4d1e-AF32-4743C88A7ABF"),

      factory:
      {
        createInstance: function(aOuter, aIID) {
        
          if (aOuter != null) {
            throw Components.results.NS_ERROR_NO_AGGREGATION;
          }
          if (!aIID.equals(Components.interfaces.gIMessengerCompose) && 
              !aIID.equals(Components.interfaces.nsISupports)) {
            throw Components.results.NS_ERROR_INVALID_ARG;
          }

          return gMessengerCompose.QueryInterface(aIID);
        },
      }
    },
    
    windowWatcher:
    {
      className:     "Google Desktop Stub Window Watcher",
      contractID:    "@google/window-watcher;1",
      classID:       Components.ID("F3D6806B-973C-4699-A54D-F537AF8BA3B5"),

      factory:
      {
        createInstance: function(aOuter, aIID) {
        
          if (aOuter != null) {
            throw Components.results.NS_ERROR_NO_AGGREGATION;
          }
          if (!aIID.equals(Components.interfaces.nsIObserver) &&
              !aIID.equals(Components.interfaces.nsISupports)) {
            throw Components.results.NS_ERROR_INVALID_ARG;
          }

          return gWindowWatcher.QueryInterface(aIID);
        },
      }
    },

    cacheService:
    {
      className:     "Google Desktop Cache Service",
      contractID:    "@google/cacheservice;1",
      classID:       Components.ID("37BD08E3-ABE1-486f-B438-4352379E6ED1"),

      factory:
      {
        createInstance: function(aOuter, aIID) {
        
          if (aOuter != null) {
            throw Components.results.NS_ERROR_NO_AGGREGATION;
          }
          
          return gCacheService.QueryInterface(aIID);
        },
      }
    },

    utility:
    {
      className:     "Google Desktop Utility",
      contractID:    "@google/utility;1",
      classID:       Components.ID("5A6BE2C4-7D11-4f9f-8820-3588A1A175FD"),

      factory:
      {
        createInstance: function(aOuter, aIID) {
          if (aOuter != null) {
            throw Components.results.NS_ERROR_NO_AGGREGATION;
          }
         
          return gUtility.QueryInterface(aIID);
        },
      }
    }
  },
  

  getClassObject: function(aCompMgr, aCID, aIID) {
    if (!aIID.equals(Components.interfaces.nsIFactory)) {
      throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
    }

    for (var key in this.mObjects) 
      if (aCID.equals(this.mObjects[key].classID))
        return this.mObjects[key].factory;

    throw Components.results.NS_ERROR_NO_INTERFACE;
  },

  registerSelf: function(aCompMgr, aFileSpec, aLocation, aType) {
    aCompMgr = aCompMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
    for (var key in this.mObjects) {
      var obj = this.mObjects[key];
      aCompMgr.registerFactoryLocation(obj.classID, obj.className, obj.contractID, aFileSpec, aLocation, aType);
    }
    
    var catman = Components.classes["@mozilla.org/categorymanager;1"].getService(Components.interfaces.nsICategoryManager);
    catman.addCategoryEntry("xpcom-startup", "Google Desktop Stub Window Watcher", "@google/window-watcher;1", true, true);
    catman.addCategoryEntry("xpcom-shutdown", "Google Desktop Stub Window Watcher", "@google/window-watcher;1", true, true);
  },

  unregisterSelf: function(aCompMgr, aFileSpec, aLocation) {
    aCompMgr = aCompMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
    for (var key in this.mObjects) {
      var obj = this.mObjects[key];
      aCompMgr.unregisterFactoryLocation(obj.classID, aFileSpec);
    }
    
    var catman = Components.classes["@mozilla.org/categorymanager;1"].getService(Components.interfaces.nsICategoryManager);
    catman.deleteCategoryEntry("xpcom-shutdown", "Google Desktop Stub Window Watcher", true);
    catman.deleteCategoryEntry("xpcom-startup", "Google Desktop Stub Window Watcher", true);
  },
  
  canUnload: function(aCompMgr) {
    return true;
  }

};

function NSGetModule(aCompMgr, aFileSpec) {
  return gGoogleDesktopModule;
}
(In reply to comment #11)
> it is this error report?
No this is code.

What you need to do is :
Open Terminal.app in Applications/utilities

then type
export NSPR_LOG_MODULES=smtp:5
and then 
export NSPR_LOG_FILE=smtp.log
and then
/Applications/Thunderbird.app/Contents/MacOS/thunderbird-bin &

this will launch thunderbird - reproduce your issue and you should have a file called smtp.log - attach it on this bug by pressing the add atachment link a bit above.
I´m able to found the Terminal.app. It is the Command Prompt?

-----------------------
(In reply to comment #12)
> (In reply to comment #11)
> > it is this error report?
> No this is code.
> 
> What you need to do is :
> Open Terminal.app in Applications/utilities
> 
> then type
> export NSPR_LOG_MODULES=smtp:5
> and then 
> export NSPR_LOG_FILE=smtp.log
> and then
> /Applications/Thunderbird.app/Contents/MacOS/thunderbird-bin &
> 
> this will launch thunderbird - reproduce your issue and you should have a file
> called smtp.log - attach it on this bug by pressing the add atachment link a
> bit above.
Hardware: PowerPC → HP
I´m have Windows XP, not a Mac application.
Attached file log reproduction
it is this?
(In reply to comment #15)
> Created an attachment (id=368025) [details]
> log reproduction
> 
> it is this?

perfect ....
Component: General → Networking: SMTP
Product: Thunderbird → MailNews Core
QA Contact: general → networking.smtp
Version: 2.0 → 1.8 Branch
Attachment #368025 - Attachment mime type: application/octet-stream → text/plain
Hardware: HP → x86
(In reply to comment #15)
> log reproduction

> SMTP Response: 250-TLS

"SMTP Service Extension for Secure SMTP over TLS" is defined by RFC 2847. 
> http://www.faqs.org/rfcs/rfc2487.html (Standard track. January 1999)
RFC 2847 prescribes "250 STARTTLS" in EHLO response for it.
However, internet draft on May 14, 1997 says "250 TLS" is response.
> http://tools.ietf.org/id/draft-hoffman-smtp-ssl-02.txt

Your SMTP server requests STARTTLS, because "5.7.0 Must issue a STARTTLS command first" is returned by server.
Your SMTP server's administrator seems to misunderstand RFC or to believe "example in old internet draft is still correct".
Outlook family possibly joined in testing of "SMTP Service Extension for Secure SMTP over TLS" during it was internet draft. And they possibly translate "250 TLS" to "250 STARTTLS".
By the way, never paste long data to bug. Save in a file, and "attach the file to bug" as you did for log file, please.
so, in conclusion, the problem is from the server which use "250 STARTTLS" and it should use "250 TLS" to communicate with thunderbird?
 
---------------------------
(In reply to comment #17)
> (In reply to comment #15)
> > log reproduction
> 
> > SMTP Response: 250-TLS
> 
> "SMTP Service Extension for Secure SMTP over TLS" is defined by RFC 2847. 
> > http://www.faqs.org/rfcs/rfc2487.html (Standard track. January 1999)
> RFC 2847 prescribes "250 STARTTLS" in EHLO response for it.
> However, internet draft on May 14, 1997 says "250 TLS" is response.
> > http://tools.ietf.org/id/draft-hoffman-smtp-ssl-02.txt
> 
> Your SMTP server requests STARTTLS, because "5.7.0 Must issue a STARTTLS
> command first" is returned by server.
> Your SMTP server's administrator seems to misunderstand RFC or to believe
> "example in old internet draft is still correct".
> Outlook family possibly joined in testing of "SMTP Service Extension for Secure
> SMTP over TLS" during it was internet draft. And they possibly translate "250
> TLS" to "250 STARTTLS".
(In reply to comment #19)
> so, in conclusion, the problem is from the server which use "250 STARTTLS" and
> it should use "250 TLS" to communicate with thunderbird?

looks like it - give the bug url to your administrator so he can fix things ...
(In reply to comment #19)
> so, in conclusion, the problem is from the server which use "250 STARTTLS" and
> it should use "250 TLS" to communicate with thunderbird?

Opposite. It should use correct "250 STARTTLS" instead of incorrect "250 TLS".
(In reply to comment #20)

Ok, I will do it. thank you
Ok, thank you very much. I don´t know if they will correct this but I will report to the server administrator.
-----------------------
(In reply to comment #21)
> (In reply to comment #19)
> > so, in conclusion, the problem is from the server which use "250 STARTTLS" and
> > it should use "250 TLS" to communicate with thunderbird?
> 
> Opposite. It should use correct "250 STARTTLS" instead of incorrect "250 TLS".
It will be possible to add an additional option to the "outgoing server SMTP settings" in the "use secure connections" to allow the connection using "250 STARTTLS"???!!!
(In reply to comment #24)
Current Tb's "TLS" in "use secure connections" of SMTP setting is;
  - TLS           : If "250 STARTTLS" in EHLO response, use STARTTLS,
                    Else fail.
  - TLS, if avail : If "250 STARTTLS" in EHLO response, use STARTTLS,
                    Else connect without StartTLS.
If no "250 STARTTLS" in EHLO response, client MUST NOT issue STARTTLS command.
luisjap@netcabo.pt, read thru Bug 185662 and Bug 350314 which I already mentioned in Comment #5 and RFC, please.
(In reply to comment #25)
Is a litle bit confusing for me because i am not an expert on those thinks. But, in Bug 185662 and Bug 350314 this problem was fixed?
If yes, how can I change my thunderbird to allow me to send messages.
I have no answer from server administrator yet and i think that they will never fix this problem.
I think that i will have to change to outlook.
It´s a shame because i was very comfortable with thunderbird and the lightning and i was very fun of it.
(In reply to comment #25)
Is a litle bit confusing for me because i am not an expert on those thinks. But, in Bug 185662 and Bug 350314 this problem was fixed?
If yes, how can I change my thunderbird to allow me to send messages.
I have no answer from server administrator yet and i think that they will never fix this problem.
I think that i will have to change to outlook.
It´s a shame because i was very comfortable with thunderbird and the lightning and i was very fun of it.
(In reply to comment #26)
> in Bug 185662 and Bug 350314 this problem was fixed?

No. Those bugs are for inaccurate/misleading term of "TLS" in UI for "StartTLS".
Issue of the inaccurate/misleading term of "TLS" is already corrected by Tb trunk(next Tb 3).

> I think that i will have to change to outlook.

It's up to you. No one forces you to use Thunderbird. You are absolutely free to stop using Thunderbird.

If I were you, I would never use the SMTP server, and I would always use other/single not-incorrectly-configured SMTP server provided by other decent company/organization.
The reasons why:
(A) Many SMTP servers accept From: addresses of other ISP,
    if SMTP AUTH(login) to SMTP server is done correctly.
    (Note: AFAIR, Yahoo's SMTP server is an exception.)
(B) It's very easy when Thunderbird, because Thunderbird treats
    POP3/IMAP account(hostname+username for POP3 server, for "MailBox") and
    SMTP(hostname+username for SMTP server, for "mail sending") independently.

(Setting example of Tb in order to use one SMTP server for all From: I want to use)  
(1) In each identity definition(mail address usable as From: of mail),
    choose "Use Defaut Server" at "Outgoing Server(SMTP):" field.
(2) Set a SMTP server which I want to use as "Default SMTP Server".
(3) If Gmail's SMTP server, register mail addresses other than Gmail's one
    to Gmail via Gmail's settings tab of Gmail's Web Interface.
    It's to avoid "replacement of From: in mail by Gmail's mail address",
    which is Gmail's spec/design to reduce spames/phishing.
(4) If some restrictions exist in SMTP server use when mobile use,
    change "default SMTP server choice" (action at step 2).
can we confirm, close or DUP this?
If closed, it should be INVALID, because server doesn't return "250 STARTTLS".
If this bug is enhancement request for torelance with "250 TLS", I believe WONTFIX.
bienvenu, what are your thoughts?

(In reply to comment #30)
> If closed, it should be INVALID, because server doesn't return "250
> STARTTLS".
> If this bug is enhancement request for torelance with "250 TLS", I believe
> WONTFIX.
Summary: Unable to connect to SMTP server → "Sending message failed. An error occurred sending mail:...." and Unable to connect to SMTP server after server doesn't return "250 STARTTLS" when using Starttls
See Also: → 536957

What your your thoughts on comment 30, and bug 536957 ?

Flags: needinfo?(kaie)
Flags: needinfo?(gds)

Not sure I completely understand comment 30. Are there more recent complaints about this?
Looking at bug 536957, not sure I see a general problem. As a test I set an account to "encrypted password" and the "not supported" error comes up immediately with no wait. Maybe there are other bad setting you can do that cause "server timeout" after 30s or more but not sure what they are or how significant that is.

Flags: needinfo?(gds)

Let's assume the issue is gone. If someone disagrees we can reopen

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Flags: needinfo?(kaie)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: