Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

App Engine Python Modules and inbound mail service

I am using App Engine Modules in my python project. (https://developers.google.com/appengine/docs/python/modules/#Python_Background_threads)

I am also receiving email in m project: https://developers.google.com/appengine/docs/python/mail/receivingmail

I want to direct the emails to my worker module and not the default module. To that end my worker.yaml has the following settings

worker.yaml

    api_version: 1
    application: integrate
    module: worker
    version: 1-0-0
    runtime: python27
    threadsafe: true

    inbound_services:
    - mail

    builtins:
    - deferred: on

    handlers:

    - url: /admin/.+
      script: src.worker.main.app
      login: admin

    - url: /_ah/mail/.+
      script: src.worker.main.app
      login: admin

    - url: /.*
      script: src.worker.main.app

app.yaml

    api_version: 1
    application: integrate
    version: 1-0-0
    runtime: python27
    threadsafe: true

    builtins:
    - deferred: on

    handlers:

    - url: /admin/.+
      script: src.default.main.app
      login: admin

    - url: /.*
      script: src.default.main.app

I even tried adding a dispatch.yaml

    application: integrate

    dispatch:
    - url: "*/_ah/mail/.+"
      module: worker

But no matter what I do the emails which reach my app are handled by the default module. Any idea what I am missing here? I see the emails coming in but no matter what I do they only go to the default module.

like image 998
David Ward Avatar asked Oct 02 '13 17:10

David Ward


People also ask

What email does Google App Engine use?

The mail API provides two ways to send an email message: the mail. send_mail() function and the EmailMessage class. This page describes how to use the legacy bundled services and APIs. This API can only run in first-generation runtimes in the App Engine standard environment.

Is Python used in GCP?

Find, diagnose, and fix complex issues. Python on Google Cloud integrates with Cloud Monitoring, Cloud Trace, Cloud Logging, and Error Reporting, allowing you to transparently instrument live production applications to rapidly diagnose performance bottlenecks and software bugs.


1 Answers

Inbound services could be used only within default module and that is expected behavior. The fact that it works for you locally in devserver is a bug, actually.

like image 170
PrecariousJimi Avatar answered Nov 25 '22 07:11

PrecariousJimi