diff --git a/lib/imap.js b/lib/imap.js index 967e27e..7e2dd3f 100644 --- a/lib/imap.js +++ b/lib/imap.js @@ -577,8 +577,8 @@ ImapConnection.prototype.connect = function(loginCb) { }); this._state.conn.connect(this._options.port, this._options.host); - this._state.tmrConn = setTimeout(this._fnTmrConn.bind(this), - this._options.connTimeout, loginCb); + this._state.tmrConn = setTimeout(this._fnTmrConn.bind(this, loginCb), + this._options.connTimeout); }; ImapConnection.prototype.isAuthenticated = function() { @@ -824,6 +824,7 @@ ImapConnection.prototype._fetch = function(which, uids, options) { if (extensions) cmd += extensions; cmd += 'UID FLAGS INTERNALDATE'; + cmd += (opts.request.struct ? ' BODYSTRUCTURE' : ''); if (toFetch !== undefined) { cmd += ' BODY'; if (!opts.markSeen)