Forum: Ruby on Rails Using NET::POP3 and ActionMailer successfully. . .?

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.
A587929f80f37c163f855f5610f2aa0c?d=identicon&s=25 gberz3 (Guest)
on 2007-04-17 23:08
(Received via mailing list)
Hi all,

I've tried all of the following to get email retrieval, parsing, and
saving to the DB working properly in rails:,+Ruby,+R...

. . .none of them worked 100%.  For the most part, I've been able to
retrieve the files and save them in their entirety locally to disk.
However, if I even think of using ActionMailer to then parse and
handle the file, things go haywire.  I receive "end of file" errors
and all kinds of other things depending on different 'tweaks'.

In my mind it should be as simple as the semi-demi-sorta-pseudo-code
that follows:

class myclass << InheritsFrom
  mail = popchecker(user,pass,server)
  foreach mail do |m|
    #process email and attachments for DB
    #save a copy locally

So, my question is, has anyone here successfully incorporated POP3
email support into their Rails apps, and if so how?

FYI, I'd rather handle all mail internally;  not use something like
'getmail' to pass it from outside.

Thanks in advance!
361ba1bcc1d2c5a8885dd093dbb96bb6?d=identicon&s=25 Michael Kovacs (Guest)
on 2007-04-18 06:19
(Received via mailing list)
Hi there,

I have incoming email processing as part of my app and though I use
IMAP for the interface to fetching email I have successfully used POP as
well. I use backgroundrb for fetching and processing incoming emails.
I chose IMAP because it allows me to look at the header and decide
whether or not I'd like to
fetch the entire message. With POP you have no choice but to just
download everything serially.

I never thought that trying to hook rails up directly to postfix or
whatever and having
it spin up rails on every single incoming email would work very well
at all so I chose the
"pull" method instead where I check mail on an interval with

This topic is locked and can not be replied to.