public
Description: A plugin for accessing POP3/IMAP accounts in rails
Homepage: http://siannopollo.blogspot.com
Clone URL: git://github.com/siannopollo/mail_fetcher.git
siannopollo (author)
Tue Jun 09 09:49:03 -0700 2009
commit  a00117fa40aba31e4665f09f1a1a28790f670aaf
tree    21ed88748d24d01130cb5c49e5dad39a47f5167d
parent  26d94a8e5f466159ebafd00c1de993afbaecc164
name age message
file MIT-LICENSE Fri Feb 15 16:24:34 -0800 2008 Initial import git-svn-id: svn+ssh://rubyforg... [siannopollo]
file README Tue Jun 09 09:49:03 -0700 2009 Changed readme to be correct [siannopollo]
file Rakefile Fri Feb 15 16:24:34 -0800 2008 Initial import git-svn-id: svn+ssh://rubyforg... [siannopollo]
directory lib/ Tue Feb 19 13:00:07 -0800 2008 improved syntax for using imap git-svn-id: svn... [siannopollo]
file mail_fetcher.yml.example Fri Feb 15 16:24:34 -0800 2008 Initial import git-svn-id: svn+ssh://rubyforg... [siannopollo]
directory spec/ Tue Feb 19 13:00:07 -0800 2008 improved syntax for using imap git-svn-id: svn... [siannopollo]
README
Fetches emails via the Net::POP3 or Net::IMAP library over an SSL connection.
Also useful with the action_mailer_tls plugin if you want to send and receive
emails through GMail. This plugin has only been tested against Rails 2, so,
caveat emptor...

The fetcher assumes there is a mail_fetcher.yml file in the config/ directory, and a
sample can be seen in the mail_fetcher.yml.example file. The config expects a
hash, so configuring it at runtime is also possible, like so:

  MailFetcher.config = { :server => "pop.gmail.com", :username => "mail.fetcher.test@gmail.com", :password => 
  "mailfetchertest" }

Somewhere in your app (most likely in environment.rb) you need to specify the
mailer class you wish to use, and the protocol:

  MailFetcher.mailer_class = :my_mailer 
  MailFetcher.access = :pop (defaults to :imap)

And this would use the MyMailer class as the ActionMailer mailing class, and
set @@access to :pop, which would log into the account using Net::POP3.

To fetch email, just call MailFetcher.fetch:

  MailFetcher.fetch(:keep => true, :mailer_methods => [:receive, :spam, :forward_to_friends_and_family])

mail_fetcher.rb and the specs can show you a bunch of other handy things you can do.

Copyright (c) 2008 Steve Iannopollo (steve (at iannopollo dot com)), released under
the MIT license