Forum: Ruby on Rails incoming email question

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
D5145c421cd25af6fa577c15219add90?d=identicon&s=25 unknown (Guest)
on 2007-04-23 15:20
(Received via mailing list)
I'm writing a model for receiving incoming email from a remote imap
The problem is, our server isn't going to be running all of the time,
and so
I'm just going to set it up to check the inbox on each request (there
be many requests, it's not a public site). Our rails server is running
Windows. This is what I have so far, pretty much copied from

def recieve(email)
  emailer = Emailer.find_by_address(email.sender)
    :incoming => true,
    :subject => email.subject,
    :body => email.body,
    :time => email

def send
  # not done yet

def self.check_mail
  imap ='')
  imap.authenticate('LOGIN','username','password')'INBOX')['ALL']).each do |message_id|
    msg = imap.fetch(message_id,'RFC822')[0].attr['RFC822']
#, "+FLAGS", [:Deleted])

The problem is that because our server isn't running all the time, I
want to
get the time the email was sent from the headers. This is very important
we have strict deadlines relating to replying to emails.

Any help would be much appreciated,
D5145c421cd25af6fa577c15219add90?d=identicon&s=25 unknown (Guest)
on 2007-04-23 15:30
(Received via mailing list)
oops, the line that say :time => email is in there because I presume
email.something, but I don't know.
This topic is locked and can not be replied to.