[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

recommended mailbox parsing library

Martin DeMello

1/9/2007 3:48:00 PM

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

4 Answers

Ara.T.Howard

1/9/2007 3:55:00 PM

0

Martin DeMello

1/9/2007 4:23:00 PM

0

On 1/9/07, ara.t.howard@noaa.gov <ara.t.howard@noaa.gov> wrote:
> 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.

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

Ara.T.Howard

1/9/2007 4:49:00 PM

0

Martin DeMello

1/9/2007 4:54:00 PM

0

On 1/9/07, ara.t.howard@noaa.gov <ara.t.howard@noaa.gov> 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