So I posted before about receiving voice mail and having populate on the internet. Well step one is checking the mail. As it turns out my email for my server is stored in a local dir. This is really good news because it appears that action mailer does not check email. First I need to add a receive method to my mail model:
def receive(email)
email
end
Done! But you say it does nothing? I know. I hate changing code in models and then restarting the server. For now my logic will stay in the controller:
def test
x=Notifier.receive(File.read("/home/giggles/realybadsite/1184671181.V9I760a7f6.popeyemail.com"))
File.open(Dir.pwd+"/tmp/"+x.attachments.first.original_filename,"w+"){|file|
file << x.attachments.first.gets
}
end
Now that I have access to the mail object and I can save the attached file I can now store the necessary data for my website.
For a list of methods on the TMail object try this website
http://railsmanual.com/class/TMail::Mail
TMail