fastest way to parse pop mails?

  • Thread starter Arne-Kolja Bachstein
  • Start date
A

Arne-Kolja Bachstein

hi there :)

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 :)
 
P

prosys

Arne-Kolja Bachstein said:
hi there :)

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 :)

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
 
E

Enrique Meza

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
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,121
Messages
2,570,712
Members
47,283
Latest member
hopkins1988

Latest Threads

Top