From: Ralph Wesser Date: 2000-12-29T02:10:01+09:00 Subject: [ruby-talk:8181] mail.delete not working I'm experimenting with some of Ruby's network modules. I wrote a short script to delete unwanted email from my mail server. The mail.delete command executes, but the email message is not deleted from the server. The code is below. require 'net/pop' pop = Net::POP.new('MyMailhost.net') pop.start('myusername', 'mypassword') nmail = ndmail = 0 pop.each do |mail| nmail += 1 from = mail.header.split("\r\n").grep(/^From: /).to_s stop = %r{spam\.net} if (from =~ stop) mail.delete ndmail += 1 puts "deleted msg #{from}" end end puts "#{nmail} messsage(s) read, #{ndmail} deleted"