Fastest way to parse pop mails?

hi there :slight_smile:

how would you solve the following problem?
i am writing a small mailchecker atm, which needs to receive all headers to show them in a listview. you can see something similar there:
http://www.geeba.org/magic/

i want to use net/pop and receive the headers to sort them into my listview. but whats the fastest way to do that? receive the header and then use the .split member and grep or is there something more powerful i could use?

arne :-)

Arne-Kolja Bachstein wrote:

hi there :slight_smile:

how would you solve the following problem?
i am writing a small mailchecker atm, which needs to receive all headers
to show them in a listview. you can see something similar there:
http://www.geeba.org/magic/

i want to use net/pop and receive the headers to sort them into my
listview. but whats the fastest way to do that? receive the header and
then use the .split member and grep or is there something more powerful i
could use?

arne :slight_smile:

Check out RMail (RubyMail) or TMail. You can find both of them in the Ruby
Application Archive (RAA) at http://raa.ruby-lang.org/ under Library >
Mail.

Terry

i want to use net/pop and receive the headers to sort them into my
listview. but whats the fastest way to do that? receive the header and
then use the .split member and grep or is there something more powerful i
could use?

Try this:

require ‘net/pop’

host = ‘mail.mycompany.com
port = 110
user = ‘test’
pass = ‘test’

pop = Net::POP3.new(host, port)
pop.start(user, pass) {
puts “# of mails: #{pop.mails.size}”
pop.each_mail do |mail|
puts mail.header
end
}

···


Enrique Meza emeza@debianmexico.org
Jarabe Soft