- Newest
- Most votes
- Most comments
Yes, you're correct in your understanding.
For outbound emails sent through Amazon SES, there are two main approaches you can take:
-
Use SES Email Archiving (Mail Manager): This is the built-in AWS solution for archiving both sent and received emails. When you send emails through a configuration set with archiving enabled, those emails will be automatically archived. You can then export these archived messages to an S3 bucket as needed.
-
Programmatically store the email in S3: Since you're already creating the email in your Java Spring Boot application using JavaMailSender, you can implement a solution to store a copy of each email in S3 before or after sending it. This would involve:
- Capturing the complete MIME message (including headers and attachments)
- Using the AWS SDK for Java to upload the message to your S3 bucket
- Adding appropriate object key prefixes for organization
The programmatic approach gives you more control over the storage format and organization but requires you to implement and maintain the code. You would use the AWS SDK's putObject method to store the email content in your S3 bucket.
If you need a fully managed solution without additional code, the SES Email Archiving (Mail Manager) feature would be the recommended approach. Otherwise, implementing the programmatic storage solution alongside your existing email sending code would be the most direct way to achieve your goal.
Sources
Email archiving - Amazon Simple Email Service
Deliver to S3 bucket action - Amazon Simple Email Service
Community | Save cost by directly uploading objects in S3 Glacier
