Bugs: Browse | Submit New | Admin

[#3983] Net::Imap error with Courier mail server

Date:
2006-03-31 03:02
Priority:
3
Submitted By:
Brian Skahan (bskahan)
Assigned To:
Akinori MUSHA (knu)
Category:
Network / Comm / Protocols
State:
Open
Platform:
 
Summary:
Net::Imap error with Courier mail server

Detailed description
Courier response that looks like:
BODYSTRUCTURE (("text" "" NIL NIL NIL "binary" 12100 NIL ("inline" NIL)
NIL)("text" "html" NIL NIL NIL "binary" 10516 281 NIL ("inline" NIL) NIL)
"alternative" ("boundary" "_----------=_113815540225145195172") NIL NIL) FLAGS

Triggers the Net::Imap parser error in match because of the surounding parenthesis around ""inline"
NIL".

A message in the same mailbox that returns:
BODYSTRUCTURE ("text" "plain" ("charset" "iso-8859-1") NIL NIL
"quoted-printable" 1515 46 NIL NIL NIL) FLAGS
does not raise the error.

Add A Comment: Notepad

Please login


Followup

Message
Date: 2006-11-04 13:13
Sender: Shugo Maeda

It seems that the response doesn't contain body-fld-md5.
Please try this patch:

http://shugo.net/tmp/imap-no-body-fld-md5.diff
Date: 2006-03-31 14:44
Sender: Brian Skahan

The Exception raised is:

Net::IMAP::ResponseParseError in Webmail/webmail#messages

unexpected token LPAR (expected QUOTED or LITERAL)
Date: 2006-03-31 14:40
Sender: Brian Skahan

More info:

The full traceback looks like:

/usr/lib/ruby/1.8/net/imap.rb:3104:in `parse_error'
/usr/lib/ruby/1.8/net/imap.rb:2956:in `match'
/usr/lib/ruby/1.8/net/imap.rb:2888:in `string'
/usr/lib/ruby/1.8/net/imap.rb:2869:in `nstring'
/usr/lib/ruby/1.8/net/imap.rb:2288:in `body_ext_1part'
/usr/lib/ruby/1.8/net/imap.rb:2192:in `body_type_text'
/usr/lib/ruby/1.8/net/imap.rb:2163:in `body_type_1part'
/usr/lib/ruby/1.8/net/imap.rb:2151:in `body'
/usr/lib/ruby/1.8/net/imap.rb:2226:in `body_type_mpart'
/usr/lib/ruby/1.8/net/imap.rb:2149:in `body'
/usr/lib/ruby/1.8/net/imap.rb:2126:in `body_data'
/usr/lib/ruby/1.8/net/imap.rb:2038:in `msg_att'
/usr/lib/ruby/1.8/net/imap.rb:2008:in `numeric_response'
/usr/lib/ruby/1.8/net/imap.rb:1950:in `response_untagged'
/usr/lib/ruby/1.8/net/imap.rb:1930:in `response'
/usr/lib/ruby/1.8/net/imap.rb:1856:in `parse'
/usr/lib/ruby/1.8/net/imap.rb:996:in `get_response'
/usr/lib/ruby/1.8/net/imap.rb:925:in `receive_responses'
/usr/lib/ruby/1.8/net/imap.rb:918:in `initialize'
/usr/lib/ruby/1.8/net/imap.rb:917:in `initialize'
#{RAILS_ROOT}/components/webmail/imapmailbox.rb:75:in `connect'

The IMAP response looks like:

S: * 1122 FETCH (ENVELOPE ("Wed, 25 Jan 2006 02:16:42
UT"
"This is the subject" ((NIL NIL "foo"
"example.net"))
(("example.com" NIL "foo"
"example.net")) ((NIL NIL "foo"
"example.net")) ((NIL NIL "bar"
"example2.com")) NIL NIL NIL
"<20060125021642.D274621CE1BD@mail.example.net>")
BODYSTRUCTURE (("text" "" NIL NIL NIL
"binary" 12100 NIL
("inline" NIL) NIL)("text" "html"
NIL NIL NIL "binary" 10516
281 NIL ("inline" NIL) NIL) "alternative"
("boundary"
"_----------=_113815540225145195172") NIL NIL) FLAGS
(\Seen
$NotJunk NotJunk) UID 5659 RFC822.SIZE 24543)

Version info:

Ruby: ruby 1.8.4 (2005-12-24) [i486-linux]
Courier: 4.0.1 & 4.0.6

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

Field Old Value Date By
assigned_tonone2007-06-12 02:25zenspider
category_idMisc / Other Standard Library2007-05-29 16:26zenspider