I''d like to setup Action Mailer to process incoming emails, but I''ve having trouble understanding how to use script/runner.rb. For testing purposes, I created a simple model and and a method to add a record to that model. I attempted to call that method from the command line using: ruby script/runner Mailman.receive However, the runner script does not appear to call that method (if I type a method name that doesn''t exist, like Mailman.doesntExist, the same thing occurs). Anyone have any ideas on where I might be going wrong? -- Derek Haynes blog - http://itsderek23.blogspot.com Cell - 404.593.4879
Wolfgang Klinger
2005-May-26 12:16 UTC
Re: Using script/runner.rb to process incoming emails
Hi! On Thu, 26 May 2005, Derek Haynes wrote the following:> I attempted to call that method from the command line using: > ruby script/runner Mailman.receive > > However, the runner script does not appear to call that method (if I > type a method name that doesn''t exist, like Mailman.doesntExist, the > same thing occurs). > > Anyone have any ideas on where I might be going wrong?this might help: http://wiki.rubyonrails.com/rails/show/HowToReceiveEmailsWithActionMailer bye Wolfgang
Actually, my problem isn''t with how to call the runner script, but why the script doesn''t execute (or even recognize) the method that I am trying to call (ie the "receive" method of "Mailman" on the wiki). - Derek On 5/26/05, Wolfgang Klinger <wolfgang-qRyVSpHmpvQsV2N9l4h3zg@public.gmane.org> wrote:> > Hi! > > On Thu, 26 May 2005, Derek Haynes wrote the following: > > I attempted to call that method from the command line using: > > ruby script/runner Mailman.receive > > > > However, the runner script does not appear to call that method (if I > > type a method name that doesn''t exist, like Mailman.doesntExist, the > > same thing occurs). > > > > Anyone have any ideas on where I might be going wrong? > > this might help: > http://wiki.rubyonrails.com/rails/show/HowToReceiveEmailsWithActionMailer > > > bye > Wolfgang > > >-- Derek Haynes blog - http://itsderek23.blogspot.com Cell - 404.593.4879
Mailman.receive != Mailman.new.receive In the code block on the wiki, it''s defined as an instance method. In the example below it, they reference it as a class method. I think they probably meant to define the method like: def self.receive(email) ... end Steve On 5/26/05, Derek Haynes <derek.haynes-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''d like to setup Action Mailer to process incoming emails, but I''ve > having trouble understanding how to use script/runner.rb. > > For testing purposes, I created a simple model and and a method to add > a record to that model. > > I attempted to call that method from the command line using: > ruby script/runner Mailman.receive > > However, the runner script does not appear to call that method (if I > type a method name that doesn''t exist, like Mailman.doesntExist, the > same thing occurs). > > Anyone have any ideas on where I might be going wrong? > > > -- > Derek Haynes > blog - http://itsderek23.blogspot.com > Cell - 404.593.4879 > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >