In order to save overhead on your server CloudMailin can transfer your attachments directly to Amazon's S3.
When a large attachment, or multiple attachments, are included within an email message the amount of data sent to the target website can become quite large. This can in turn lead to considerable transfer and processing time on your server and can often result in timeouts or unreachable errors as the server cannot cope with receiving that amount of data. In addition, this overhead can prevent other requests from reaching the server.
CloudMailin has the ability to extract the attachments from your email and deliver them to Amazons S3. This means that your server only receives the data that it needs to, and we instead pass the URL of the files that were extracted from the email.
It is possible to configure CloudMailin to stream message attachments to Amazons S3 as an email is received. This can help reduce the overhead on the end server and allow you to easily save away the attachments sent by your customers. In order to set up S3 attachments:
In order for this to work you must give write access to your bucket to the following Amazon Canonical ID:
AWS Canonical ID: 83fec836f8a832fae9c46e100739b635be3b3636d14887e1c7616e2dba1a88c0
Once this is configured correctly you will see an additional attachments parameter being passed with the content type, url and original file name of your attachments. For more details about the attachment format see the documentation on the HTTP Post Formats.
There are several ways that you can grant permission for CloudMailin to create files in your S3 Bucket. The simplest is to use the AWS website.
granteefield from above paste the CloudMailin Canonical ID, choose
upload/deleteand then save
You should now have granted CloudMailin permission to add files to your S3 bucket.
CloudMailin will upload attachments using a random filename generated by our system. This is because we don't wish to require read access only write access to a bucket and we therefore cannot check if a file already exists. Although it is unlikely it is theoretically possible that we could generate the same filename twice. If this is a concern you should move the files once you receive the url from our servers.