I am trying to process inbound emails (on dev server) sent to different addresses like:
- url: /_ah/jogo@.*rpg2e\.appspotmail\.com
script: jogo.py
- url: /_ah/contato@.*rpg2e\.appspotmail\.com
script: contato.py
- url: /.*
script: helloworld.py
but I get the following log message:
INFO 2012-07-27 20:05:31,759 dev_appserver.py:2952] "POST /_ah/mail/jogo@rpg2e.appspotmail.com HTTP/1.1" 404 -
I also tried:
- url: /_ah/jogo@rpg2e\.appspotmail\.com
script: jogo.py
- url: /_ah/contato@rpg2e\.appspotmail\.com
script: contato.py
- url: /.*
script: helloworld.py
to no avail.
If I simply use a handle_all it works like a charm, but I would like my script only to handle email sent to the correct handle@rpg2e.appspotmail.com
After spending some time searching the Web and within Stack Overflow, I came across many questions like mine, and the only working solution was to use the catch all approach. Some of them were even answered by Ikai Lane[1] with the same conclusion – only catch all works.
Then again, did anyone have success using multiple handlers?
[1] https://groups.google.com/forum/?fromgroups#!topic/google-appengine-java/UGTkMV9foJ0
From the Google App Engine Python – Receiving Mail
You are missing the
/mail/portion of the required path. You’re POSTING to/_ah/jogo@rpg2e.appspotmail.cominstead of/_ah/mail/jogo@rpg2e.appspotmail.com. Try this instead:Lastly, we all get a little tunnel vision every now and then when confronted with a problem, but it’s worth noting the value in error messages. The error message tells us where App Engine is looking when it makes the POST request, which you could match up with your handlers: