Forums: users (Thread #12033)

ruby: unexpected token SPACE (2006-08-12 23:55 by Anonymous #24346)

The following started happening a week ago without any changes in the local software setup. System is Debian testing, ruby 1.8.2-1, bsfilter 1:1.0.13-1. Any ideas?

/usr/lib/ruby/1.8/net/imap.rb:3104:in `parse_error': unexpected token SPACE (Net
::IMAP::ResponseParseError)
from /usr/lib/ruby/1.8/net/imap.rb:2917:in `atom'
from /usr/lib/ruby/1.8/net/imap.rb:2714:in `capability_response'
from /usr/lib/ruby/1.8/net/imap.rb:1972:in `response_untagged'
from /usr/lib/ruby/1.8/net/imap.rb:1930:in `response'
from /usr/lib/ruby/1.8/net/imap.rb:1856:in `parse'
from /usr/lib/ruby/1.8/net/imap.rb:996:in `get_response'
from /usr/lib/ruby/1.8/net/imap.rb:925:in `receive_responses'
from /usr/lib/ruby/1.8/net/imap.rb:918:in `initialize'
from /usr/lib/ruby/1.8/net/imap.rb:917:in `initialize'
from /usr/bin/bsfilter:2682:in `do_imap'
from /usr/bin/bsfilter:3321:in `run'
from /usr/bin/bsfilter:3373

Reply to #24346×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: ruby: unexpected token SPACE (2006-08-13 00:22 by nabeken #24348)

It seems to be a problem between IMAP server and a standard library of ruby.
Do you have any information about your IMAP server? (program name, revision, authentication method ...)
Reply to #24346

Reply to #24348×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: ruby: unexpected token SPACE (2006-08-13 00:33 by Anonymous #24350)

Nabaken,

Offlineimap reveals only the following information about the IMAP server:

new IMAP4 connection, tag=DKKG
< * OK [CAPABILITY IMAP4REV1 UIDPLUS NAMESPACE SASL-IR LOGIN-REFERRALS AUTH=LOGIN] nic IMAP4rev1 2006a-sau at Sat, 12 Aug 2006 18:25:38 +0300 (EEST)
> DKKG0 CAPABILITY
< * CAPABILITY IMAP4REV1 UIDPLUS NAMESPACE IDLE NAMESPACE MAILBOX-REFERRALS BINARY UNSELECT SCAN SORT THREAD=REFERENCES THREAD=ORDEREDSUBJECT QUOTA MULTIAPPEND SASL-IR LOGIN-REFERRALS AUTH=LOGIN
< DKKG0 OK CAPABILITY completed
Reply to #24348

Reply to #24350×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: ruby: unexpected token SPACE (2006-08-13 00:22 by Anonymous #24349)

Same happens with the latest bsfilter version in sourceforge (1.0.14) with the exception of different bsfilter line numbers:

from /usr/bin/bsfilter:2705:in `do_imap'
from /usr/bin/bsfilter:3340:in `run'
from /usr/bin/bsfilter:3392
Reply to #24346

Reply to #24349×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE2: ruby: unexpected token SPACE (2006-08-13 00:38 by Anonymous #24351)

There seems to be an extra space (totalling two) between the NAMESPACE and IDLE capabilities in the response from the server. Maybe this confuses Ruby's IMAP library?

Reply to #24346

Reply to #24351×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: RE2: ruby: unexpected token SPACE (2006-08-13 00:59 by Anonymous #24352)

This seems to be the case. It is probably a mistake in the server configuration but can be overcome with a following temporary workaround to the Ruby IMAP library:

*** imap.rb-orig 2006-08-12 17:50:49.000000000 +0300
--- imap.rb 2006-08-12 17:54:25.000000000 +0300
***************
*** 1883,1889 ****
T_TEXT = :TEXT

BEG_REGEXP = /\G(?:\
! (?# 1: SPACE )( )|\
(?# 2: NIL )(NIL)(?=[\x80-\xff(){ \x00-\x1f\x7f%*"\\\[\]+])|\
(?# 3: NUMBER )(\d+)(?=[\x80-\xff(){ \x00-\x1f\x7f%*"\\\[\]+])|\
(?# 4: ATOM )([^\x80-\xff(){ \x00-\x1f\x7f%*"\\\[\]+]+)|\
--- 1883,1889 ----
T_TEXT = :TEXT

BEG_REGEXP = /\G(?:\
! (?# 1: SPACE )( +)|\
(?# 2: NIL )(NIL)(?=[\x80-\xff(){ \x00-\x1f\x7f%*"\\\[\]+])|\
(?# 3: NUMBER )(\d+)(?=[\x80-\xff(){ \x00-\x1f\x7f%*"\\\[\]+])|\
(?# 4: ATOM )([^\x80-\xff(){ \x00-\x1f\x7f%*"\\\[\]+]+)|\
Reply to #24351

Reply to #24352×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: RE2: ruby: unexpected token SPACE (2006-08-13 01:14 by nabeken #24354)

I added "extra space" to my local IMAP server and confirmed your patch worked.

RFC2060 defines the format of CAPABILITY. I'm not sure multiple SPACEs are regal.


capability_data ::= "CAPABILITY" SPACE [1#capability SPACE] "IMAP4rev1"
[SPACE 1#capability]
;; IMAP4rev1 servers which offer RFC 1730
;; compatibility MUST list "IMAP4" as the first
;; capability.

Reply to #24352

Reply to #24354×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: ruby: unexpected token SPACE [fixed] (2006-10-04 22:49 by Anonymous #25288)

The problem has been fixed in Ruby 1.8.5-1 for Debian.
Reply to #24346

Reply to #25288×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login