Project

General

Profile

Bug #13649

Net::IMAP doesn't support response from a Microsoft Exchange server (which is not compliant with RFC standards)

Added by keysen (Jérémy Carlier) about 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Target version:
-
[ruby-core:81641]

Description

Hello,

This day I wanted to use a mailbox hosted on a Microsoft Exchange server and it was not working.
I found this nice article relating the issue: http://claudiofloreani.blogspot.fr/2012/01/monkeypatching-ruby-imap-class-to-build.html

My solution to support those crappy server:

module Net
  class IMAP
    class ResponseParser
      def response
        token = lookahead
        case token.symbol
        when T_PLUS
          result = continue_req
        when T_STAR
          result = response_untagged
        else
          result = response_tagged
        end
        match(T_SPACE) if lookahead.symbol == T_SPACE
        match(T_CRLF)
        match(T_EOF)
        return result
      end
    end
  end
end

Step to reproduce: (require an horrible server :))

imap_connexion = Net::IMAP.new(localhost, 993, true, nil, false)
imap_connexion.status('INBOX', ["UIDNEXT", "UIDVALIDITY"])

Then the server should reply with:
"* STATUS INBOX (UIDNEXT 1 UIDVALIDITY 1585372) \r\n"

And the bug occurs because we have a space at the end of the line which is not in the RFC, but as usual Microsoft makes its own RFC...

If you have any questions, suggestions just ask, if I can help.

Associated revisions

Revision 01658682
Added by shugo (Shugo Maeda) almost 2 years ago

lib/net/imap.rb: Ignore trailing space for Microsoft Exchange Server

Based on the patch by keysen (Jérémy Carlier).
[ruby-core:81641] [Bug #13649]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 59372
Added by shugo (Shugo Maeda) almost 2 years ago

lib/net/imap.rb: Ignore trailing space for Microsoft Exchange Server

Based on the patch by keysen (Jérémy Carlier).
[ruby-core:81641] [Bug #13649]

Revision 59372
Added by shugo (Shugo Maeda) almost 2 years ago

lib/net/imap.rb: Ignore trailing space for Microsoft Exchange Server

Based on the patch by keysen (Jérémy Carlier).
[ruby-core:81641] [Bug #13649]

Revision 59372
Added by shugo (Shugo Maeda) almost 2 years ago

lib/net/imap.rb: Ignore trailing space for Microsoft Exchange Server

Based on the patch by keysen (Jérémy Carlier).
[ruby-core:81641] [Bug #13649]

Revision b9b7cf6d
Added by nagachika (Tomoyuki Chikanaga) over 1 year ago

merge revision(s) 59372: [Backport #13649]

    lib/net/imap.rb: Ignore trailing space for Microsoft Exchange Server

    Based on the patch by keysen (Jeremy Carlier).
    [ruby-core:81641] [Bug #13649]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@61369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 61369
Added by nagachika (Tomoyuki Chikanaga) over 1 year ago

merge revision(s) 59372: [Backport #13649]

lib/net/imap.rb: Ignore trailing space for Microsoft Exchange Server

Based on the patch by keysen (Jeremy Carlier).
[ruby-core:81641] [Bug #13649]

Revision 937457fe
Added by usa (Usaku NAKAMURA) over 1 year ago

merge revision(s) 59372: [Backport #13649]

    lib/net/imap.rb: Ignore trailing space for Microsoft Exchange Server

    Based on the patch by keysen (Jeremy Carlier).
    [ruby-core:81641] [Bug #13649]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@62131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 62131
Added by usa (Usaku NAKAMURA) over 1 year ago

merge revision(s) 59372: [Backport #13649]

lib/net/imap.rb: Ignore trailing space for Microsoft Exchange Server

Based on the patch by keysen (Jeremy Carlier).
[ruby-core:81641] [Bug #13649]

History

Updated by naruse (Yui NARUSE) about 2 years ago

  • Assignee set to shugo (Shugo Maeda)
  • Status changed from Open to Assigned
#2

Updated by shugo (Shugo Maeda) almost 2 years ago

  • Status changed from Assigned to Closed

Applied in changeset trunk|r59372.


lib/net/imap.rb: Ignore trailing space for Microsoft Exchange Server

Based on the patch by keysen (Jérémy Carlier).
[ruby-core:81641] [Bug #13649]

#3

Updated by usa (Usaku NAKAMURA) almost 2 years ago

  • Backport changed from 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN to 2.2: WONTFIX, 2.3: REQUIRED, 2.4: REQUIRED

Updated by nagachika (Tomoyuki Chikanaga) over 1 year ago

  • Backport changed from 2.2: WONTFIX, 2.3: REQUIRED, 2.4: REQUIRED to 2.2: WONTFIX, 2.3: REQUIRED, 2.4: DONE

ruby_2_4 r61369 merged revision(s) 59372.

Updated by usa (Usaku NAKAMURA) over 1 year ago

  • Backport changed from 2.2: WONTFIX, 2.3: REQUIRED, 2.4: DONE to 2.2: WONTFIX, 2.3: DONE, 2.4: DONE

ruby_2_3 r62131 merged revision(s) 59372.

Also available in: Atom PDF