Recommended mailbox parsing library

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

On Wed, 10 Jan 2007, Martin DeMello wrote:

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

On 1/9/07, [email protected] [email protected] wrote:

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

On 1/9/07, [email protected] [email protected] wrote:

loader = TMail::UNIXMbox.new( ‘mailbox’ )

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

On Wed, 10 Jan 2007, Martin DeMello wrote:

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs