Difference between revisions of "Chewie71-Notes"

Line 1: Line 1:
  
#selectMailbox
+
#selectMailbox
def sm(user)
+
def sm(user)
  $cmdin.puts("sm #{user}")
+
  $cmdin.puts("sm #{user}")
  $cmdout.each do |line|
+
  $cmdout.each do |line|
    if line.include?("mailbox:")
+
    if line.include?("mailbox:")
      return
+
      return
    elsif line.include?("NO_SUCH_ACCOUNT")
+
    elsif line.include?("NO_SUCH_ACCOUNT")
      $logger.fatal(line)
+
      $logger.fatal(line)
      puts "EXITING:: #{line}"
+
      puts "EXITING:: #{line}"
      exit
+
      exit
    else
+
    else
      $logger.fatal(line)
+
      $logger.fatal(line)
      puts "UNKNOWN ERROR: #{line}"
+
      puts "UNKNOWN ERROR: #{line}"
      exit
+
      exit
    end
+
    end
  end
+
  end
end
+
end

Revision as of 04:08, 23 August 2008

#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
Jump to: navigation, search