I created a rake task to fetch email from Gmail’s server using
Net::POP3. Everything works, except the messages are not getting
deleted. Here’s my code:
task :receive => :environment do
pop = Net::POP3.new(‘localhost’, 42) # localhost:42 is because of
pop.delete_all do |m|
I also changed delete_all to each_mail and added “m.delete” after the
StuffMailer line, which still did not work. I also tried Net::IMAP,
but I kept getting “unexpected token ATOM (expected SPACE)” errors.
How can I resolve this problem -or- how can I resolve the IMAP error?