Difference between revisions of "Chewie71-Notes"
(Removing all content from page) |
|||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | <source lang=ruby> | |
+ | #selectMailbox | ||
+ | def sm(user) | ||
+ | $cmdin.puts("sm #{user}") | ||
+ | $cmdout.each do |line| | ||
+ | if line.include?("mailbox:") | ||
+ | return | ||
+ | elsif line.include?("NO_SUCH_ACCOUNT") | ||
+ | $logger.fatal(line) | ||
+ | puts "EXITING:: #{line}" | ||
+ | exit | ||
+ | else | ||
+ | $logger.fatal(line) | ||
+ | puts "UNKNOWN ERROR: #{line}" | ||
+ | exit | ||
+ | end | ||
+ | end | ||
+ | end | ||
+ | </source> |
Revision as of 04:09, 23 August 2008
<source lang=ruby>
- selectMailbox
def sm(user)
$cmdin.puts("sm #{user}") $cmdout.each do |line| if line.include?("mailbox:") return elsif line.include?("NO_SUCH_ACCOUNT") $logger.fatal(line) puts "EXITING:: #{line}" exit else $logger.fatal(line) puts "UNKNOWN ERROR: #{line}" exit end end
end </source>