...
Synapse has an existing system for sending messages, described here: Messaging services. This service requires the client to upload the body of an email to an S3 file, then create a message object referencing the file and containing other metadata (from, to, subject). We will leverage this by adding a component which receives emails and converts them to web requests. The service we have investigated for this purpose is http://www.cloudmailin.com/. CloudMailIn has an option to format requests as JSON, http://docs.cloudmailin.com/http_post_formats/json/
We will add the following service to the Messaging Services:
Method | URI | Request Body | Parameters | Response Body | Permission |
---|---|---|---|---|---|
POST | /cloudMailInMessage | Message | notificationUnsubscribeEndpoint | none | Basic Authentication |
We add a JSON schema to lib-auto-generated, org.sagebionetworks.repo.model.message.cloudmailin.Message, describing the CloudMailIn JSON format. A POST containing this message is authorized using 'Basic Authentication'. Also it takes a parameter, notificationUnsubscribeEndpoint, which is the Synapse Portal endpoint for one-click unsubscription. The message content is uploaded to an S3 with a MIME type application/x-cloudmailin-json.
Design Details