RobustThread, Postfix, TMail, & Rails app small question

I'm using Postfix to receive email then having it dump the emails to a Maildir. From there I have a ruby daemon using RobustThread which runs every 30 seconds to process the emails using Tmail. Everything is working great up to this point. With TMail I'm able to get the parts of the email that I need.

The only question I have is how would be the best way to get the emails, from my ruby daemon, into my rails app as a Model and save to database?

You can use Active Record outside of Rails... so you should be able to just load it up and use the Model directly (assuming you aren't relying on something within your model that is Rails specific).

Philip Hallstrom wrote:

from my ruby daemon, into my rails app as a Model and save to
database?

Thanks for the reply! I guess I just want to make sure that this works and is a good way to do it. Here is what I have in my daemon below:

Philip Hallstrom wrote:

from my ruby daemon, into my rails app as a Model and save to database?

Thanks for the reply! I guess I just want to make sure that this
works and is a good way to do it. Here is what I have in my daemon below:

That should work. You could also require the actual models in your
app/models directly which would get you any validations and other
helper methods...