AtsoK | 18 Jul 11:31
Picon

Email not getting deleted on server [Net::POP3]


Hello,

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
   require 'net/pop'
   pop = Net::POP3.new('localhost', 42) # localhost:42 is because of
stunnel
   pop.start('[myaddress]', '[mypassword]')
      unless pop.mails.empty?
         pop.delete_all do |m|
            StuffMailer.receive(m.pop)
	end
   end
end

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?
Thank you.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Gmane