To receive mail in your GAE app, follow the docs here: in particular, you'll get a instance of class InboundEmailMessage
with an attachments
attribute which, and I quote:
is a list of file attachments,
possibly empty. Each value in the list
is a tuple of two elements: the
filename and the file contents.
Then, per these GAE docs, you "create an upload URL" and in your upload handler (typically a subclass of BlobstoreUploadHandler) you use get_upload
to get BlobInfo instances and put their metadata somewhere that will later let you fetch them back as your app may require.
Finally, you POST
the data (that you have from attachments
, above) to your own freshly generated "upload URL", e.g. using urlfetch.fetch (with method-POST
and a payload in standard application/x-www-form-urlencoded
encoding for the "form" that the user would be filling in if they were uploading the data directly, which is the "normal" way to put data in the blobstore -- e.g. you can use urllib.urlencode to prepare the payload).
That "self-POST" will be using another instance of your app to "receive" the data into the blobstore (while the instance that received the email waits, as fetch
is synchronous).