[ruby-list:50564] Re: IMAP IDLE
From:
Shugo Maeda <shugo@...>
Date:
2017-08-27 06:36:07 UTC
List:
ruby-list #50564
前田です。
2017年8月27日 9:03 とみたまさひろ <tommy@tmtm.org>:
> IDLE コマンドの応答が「+」だけなのがおかしいですね。
> 「+ 何かの文字列」である必要があります。
>
> https://tools.ietf.org/html/rfc3501#section-7.5
>
> # それで connection closed というエラーになるのもどうかと思いますが…。
>
> 原因はサーバーがIMAPプロトコルに従ってないためなので、クライアント側で
> 対応するには net/imap ライブラリに手を入れるしかないと思います。
trunkでは修正しましたが、以下のようなモンキーパッチで対処できるのではないかと思います。
class Net::IMAP::ResponseParser
def continue_req
match(T_PLUS)
token = lookahead
if token.symbol == T_SPACE
shift_token
return ContinuationRequest.new(resp_text, @str)
else
return ContinuationRequest.new(ResponseText.new(nil, ""), @str)
end
end
end
ついでにパースエラー等の時にオリジナルの例外を投げるように修正しました。
--
Shugo Maeda