Rafa_F
June 27, 2013, 7:03pm
1
Hi,
on Ruby 1.8.7 mailread.rb was part of the Std-lib:
On Ruby >= 1.9.x it is not.
Any hint on what can one use now to create a mail message from a
(mbox) file, so that one can read the message text into the object and
get the header, body etc ?
Giving a little update to this old gmail importer script:
# append all the mbox messages
@log.info("=================")
@log.info("Bulk Upload Start")
count = 0
errors = 0
# position in the correct index
while (count < @start) and ([email protected] ?) : count += 1 end
# start
while [email protected] ?
begin
@msg = Mail.new(@mbox)
imsg = wrap_msg
@log.debug("Executing msg. [#{count}] : #{@msg.header["Subject"]} : #{@msg.header["Date"]}")
@imap.append(@folder, imsg, nil, Time.parse(@msg.header["Date"]))
count += 1
p "Successfully sent message nr.: #{count}"
rescue => e
@log.warn("Error in msg. [#{count}] : #{@msg.header["Subject"]} : #{@msg.header["Date"]}")
errors += 1
p "Error in msg [#{count}]: #{e}"
next
Thanks,
pedro mg [email protected] wrote:
2gmail.rb/2gmail.rb at master · pedromg/2gmail.rb · GitHub
rubygem mail seems to be the one to use nowadays. I’m unclear if it
supports mbox format files, though.
On Fri, 2013-06-28 at 02:02 +0900, pedro mg wrote:
Giving a little update to this old gmail importer script:
2gmail.rb/2gmail.rb at master · pedromg/2gmail.rb · GitHub
Thanks,
@pedro_mg
i tend to use tmail
Hi,
On Mon, Jul 1, 2013 at 4:32 PM, Reid T. [email protected]
wrote:
On Fri, 2013-06-28 at 02:02 +0900, pedro mg wrote:
i tend to use tmail
yes, that’s a great gem, great test suite.
I created the mailread gem because this is an ultra compact lib and
useful for my go2gmail script.
Available at:
http://rubygems.org/gems/mailread
thanks,
@pedro_mg