Deleting all email from my inbox using the Mail gem

require 'mail'

Mail.defaults do
  retriever_method :pop3, { :address             => "myemailserver",
                            :port                => 110,
                            :user_name           => 'myname',
                            :password            => '*******',
                            :enable_ssl          => false }
end

Mail.delete_all #=> "+OK Goodbye..." 

Resources