That doesn't seem to work.  First, I believe web2py will be looking
for an application named _ah to handle the request (versus a controler
named _ah in myapp).  Assuming there is a way to resolve that (which
would be great to know), the second issue is that to deal with inbound
mail requests you need to subclass InboundMailHandler from Google so
that you can pull apart the various pieces of the email message with
ease.

I based this on the simple piece of code in the Google docs (http://
code.google.com/appengine/docs/python/mail/receivingmail.html) and it
seems like I have to figure out how to get that to run through web2py
so that it picks up all the stuff that should be in the environment.
Perhaps it's as simple as changing the WSGI calls at the bottom of it:

application = webapp.WSGIApplication([ReportHandler.mapping()],
debug=True)

def main():
    run_wsgi_app(application)
if __name__ == "__main__":
    main()

All I know is that I seem to be outside the basic usage path which is
tough on your first experience with a new framework.

-Mike

On Apr 13, 11:12 pm, Jonathan Lundell <[email protected]> wrote:
> On Apr 13, 2011, at 4:06 PM, Mike Giles wrote:
>
>
>
> > I'm playing around with web2py for the first time on a project that is
> > using GAE to accept and process inbound email.  When mail comes in to
> > GAE, you need to tell it what piece of code to run in your app.yaml to
> > handle it:
>
> > - url: /_ah/mail/.+
> >  script: applications/myapp/modules/incoming.py
> >  login: admin
>
> > So my first question is where should I put the code that will handle
> > this mail?  Is it a module?  A controller?
>
> I think you want something like this:
>
> - url: /_ah/mail/.+
>  script: gaehandler.py
>
> Create a controller named _ah.py, with a function mail(), and look in 
> request.args(0) for the email address.
>
> I think.
>

Reply via email to