views:

333

answers:

2

I'm trying to get a basic example app running that processes email. Nothing fancy, just the barest of functionality at this point. I've installed Fetcher, configured the YAML, updated the :receiver, and created an IncomingMailHandler class.

When I go to start the FetcherDaemon, I get the following error.

/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:105:in `const_missing': uninitialized constant MailerDaemonFetcherDaemon::IncomingMailHandler (NameError)

I'm using Rails 2.3.2, with the latest Fetcher plugin. The IncomingMailHandler class in my models dir looks like this:

class IncomingMailHandler < ActionMailer::Base 
  def receive(email) 
    logger.info("Got a mail about: #{mail.subject}") 
  end 
end

Help!

A: 

My guess is you didnt set the MailFetcher

MailFetcher.mailer_class = :incoming_mail_handler

put this in environment.rb after the RailsInitializer block. If you want to use POP3 instead of IMAP you have to specify this there as well

nasmorn
Sorry, I should have been more specific, I'm trying to use Fetcher: http://github.com/look/fetcher/tree/master.I don't think I need to edit environment.rb at all if I'm using daemon, but thanks for trying!! It is greatly appreciated!
+2  A: 

Ok, so basically, I'm a dumbass. I was following instructions all over the damn web, except for the mostly cut and dry explanation on github. Days later now, I just went through the motions, and boom, it worked flawlessly.

So, to anyone that finds this with the same problem (whether you were trying to follow the WAY outdated instructions on the PeepCode tutorial, or found some tips on a blog), don't be a dumbass like me. The most up-to-date info is on github.

Thanks to anyone that looked at this!