[#35937] WeRDS (the Weekly Ruby-Doc Summary) 2002-09-13 — maili31s@... (SugHimsi == SUGIHARA Hiroshi)

すぎむし。

14 messages 2002/09/16
[#36004] WeRDS (the Weekly Ruby-Doc Summary) 2002-09-22 — maili31s@... (SugHimsi == SUGIHARA Hiroshi) 2002/09/25

すぎむし%くどいようですが、うるさければ謹慎しますので。

[#35940] 9.2 の数値が 9.199999999999999 — "Inoue" <rubyist@...1.117.ne.jp>

井上です。

16 messages 2002/09/17
[#35941] Re: 9.2 の数値が 9.199999999999999 — matz@... (Yukihiro Matsumoto) 2002/09/17

まつもと ゆきひろです

[#35942] Re: 9.2 の数値が 9.199999999999999 — Fujimaru Hiroyasu <f-hiro@...> 2002/09/17

 藤丸です。

[#35977] [ANN] Exerb 2.1.0 — Yuya Kato <yuya-ml@4th.to>

Yuyaです。

18 messages 2002/09/20
[#35978] Cookie — 金光雅夫 (KANEMITSU Masao) <masao-k@...> 2002/09/20

金光です。どもっ (_ _)

[#35979] Re: Cookie — rio-t@... 2002/09/20

こんにちは、高石です。

[#35980] Re: Cookie — 金光雅夫 (KANEMITSU Masao) <masao-k@...> 2002/09/20

金光です。どもっ。

[ruby-list:35963] net/telnet.rb (example of POP)

From: TAKEUCHI Hideki <take@...>
Date: 2002-09-18 00:19:41 UTC
List: ruby-list #35963
竹内です。

ruby 1.6.5 (2001-09-19) [i686-linux] の net/telnet.rbにおける
POPの例

=== CHECKS A POP SERVER TO SEE IF YOU HAVE MAIL

  pop = Net::Telnet::new({"Host" => "your_destination_host_here",
                          "Port" => 110,
                          "Telnetmode" => false,
                          "Prompt" => /^\+OK/n})
  pop.cmd("user " + "your_username_here"){|c| print c}
  pop.cmd("pass " + "your_password_here"){|c| print c}
  pop.cmd("list"){|c| print c}


=end

において、最初の pop.cmdで

  telnet.rb:465:in `waitfor': timed-out; wait for the next data (TimeoutError)

となり正常に動作しませんでした
(POP3サーバーは SunOS 5.7, QPOP(version 2.53)です)


詳しく調べてはいないのですが Net::Telnet::waitforにおいて
Telnetmodeが falseの時 buf が '' のままであることが直接の理由でした

正しい解決策はわからなかったのですが対処療法として以下のようにすると
期待どおりの結果が得られました

  pop = Net::Telnet::new({"Host" => "your_destination_host_here",
                          "Port" => 110,
                      #   "Telnetmode" => false,  # default のまま(true)にする
                          "Prompt" => /^\+OK/n})

  # 最初のcmdの前に promptを待つようにする
  pop.waitfor(/+OK/n)

  pop.cmd("user " + "your_username_here"){|c| print c}
  pop.cmd("pass " + "your_password_here"){|c| print c}
  pop.cmd("list"){|c| print c}

とりあえずお知らせしておきます
--
竹内英樹


In This Thread

Prev Next