To receive mail in your GAE application, follow the documents here : in particular, you will receive an instance of the InboundEmailMessage class with a attachments , which, and I quote:
- The list of file attachments is possibly empty. Each value in the list is a tuple of two elements: the name of the file and the contents of the file.
Then, for these GAE documents , you “create a download URL” and in your download handler (usually a subclass of BlobstoreUploadHandler ) you use get_upload to get the BlobInfo instances and put your metadata somewhere, which later allows you to return them. how your application may be required.
Finally, you POST data (you have from attachments , above) to your just created “download URL”, for example. using urlfetch.fetch (with method-POST and standard application/x-www-form-urlencoded encoding payload for the "form", which the user will fill out if they loaded the data directly, which is a "normal" way to put the data in blobstore - for example, you can use urllib.urlencode to prepare the payload).
This "self-delivered" will use another instance of your application to "receive" data in the blobstore (while the instance that received the email is waiting because fetch is synchronous).
Alex martelli
source share