How to support different handlers for incoming GAE e-mails?

ⅰ亾dé卋堺 提交于 2019-12-13 16:24:09

问题


In accordance with GAE docs, several handlers could be support for incoming e-mails. I would like to support two:

  1. string@appid.appspotmail.com should go to Handler1;
  2. string+something@appid.appspotmail.com should go to Handler2;

Looks like I should have something like:

- url: /_ah/mail/<???>your_app_id\.appspotmail\.com
  script: handler2.app
  login: admin
- url: /_ah/mail/.+
  script: handler1.app
  login: admin

How the regex (?) should look like to route messages sent to e-mail with plus sign to another handler?


回答1:


[Updated] The following configuration works for me.

- url: /_ah/mail/string@.*your_app_id\.appspotmail.com
  script: handler2.app
  login: admin
- url: /_ah/mail/string%2B.*@.*your_app_id\.appspotmail.com
  script: handler1.app
  login: admin
- url: /_ah/mail/.+
  script: catchall.app
  login: admin


来源:https://stackoverflow.com/questions/15453142/how-to-support-different-handlers-for-incoming-gae-e-mails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!