recommended mailbox parsing library

M

Martin DeMello

Are any of the ruby email parsing libraries currently maintained? I
looked at rubymail and tmail, but neither seem to have been updated
recently - is anyone currently using either of them (or some other
ruby lib) to read and process a mailbox (in mbox format)?

martin
 
A

ara.t.howard

Are any of the ruby email parsing libraries currently maintained? I looked
at rubymail and tmail, but neither seem to have been updated recently - is
anyone currently using either of them (or some other ruby lib) to read and
process a mailbox (in mbox format)?

i use tmail extensively to manage data streams via remote and local mailboxes.
i think it's more the case that it's 'mature' than the case that it's not
being maintained. the library is really quite complete to the extent that one
sometimes has to rtfm for a while before being able to do a particular task -
there's just a lot there.

cheers.

-a
 
M

Martin DeMello

i use tmail extensively to manage data streams via remote and local mailboxes.
i think it's more the case that it's 'mature' than the case that it's not
being maintained. the library is really quite complete to the extent that one
sometimes has to rtfm for a while before being able to do a particular task -
there's just a lot there.

The following simple count-messages test returned the correct count,
but replaced my mailbox with a zero-byte file - any idea what I'm
doing wrong? This is with tmail 0.10.8

require 'tmail'

i = 0

loader = TMail::UNIXMbox.new( 'mailbox' )
loader.each_port do |port|
mail = TMail::Mail.new(port)
i += 1
puts i
end

puts i

martin
 
A

ara.t.howard

The following simple count-messages test returned the correct count,
but replaced my mailbox with a zero-byte file - any idea what I'm
doing wrong? This is with tmail 0.10.8

require 'tmail'

i = 0

loader = TMail::UNIXMbox.new( 'mailbox' )

at_exit{ loader.close }
loader.each_port do |port|
mail = TMail::Mail.new(port)
i += 1
puts i
end

puts i

you may also check to see if 'new' takes a block - not sure if it does.
either way, the mbox can still be truncated if your process is 'kill -9'd.
for that reason i generally impliment a transaction on top of tmail's.

regards.

-a
 
M

Martin DeMello

at_exit{ loader.close }

you may also check to see if 'new' takes a block - not sure if it does.
either way, the mbox can still be truncated if your process is 'kill -9'd.
for that reason i generally impliment a transaction on top of tmail's.

Ah - thanks! I thought the each_port block would close the file.

martin
 

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

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top