如何配置SES与关联S3存储桶以正确存储非英文邮件字符?
Hey there, let's tackle that encoding issue you're facing with SES and S3. The d=C3=ADa you're seeing is quoted-printable encoding—SES defaults to this for non-ASCII characters when saving to S3, since it uses 7-bit ASCII by default. Here's how to get your special characters (like that í) showing up correctly in your S3 bucket:
Step 1: Adjust SES Receiving Rule to Use UTF-8
The key fix is updating your SES rule to skip quoted-printable encoding and save emails in UTF-8 directly:
- Head to the SES console, go to Email Receiving > Rules
- Select the rule that saves emails to your S3 bucket, then click Edit
- In the Actions section, find the "Save to S3" action and click Edit
- Expand the Content conversion settings:
- Choose "Convert to UTF-8"
- Uncheck the box for "Encode non-ASCII characters using quoted-printable"
- Save your rule changes
Step 2: Ensure S3 Object Metadata Uses UTF-8
SES should automatically set the correct metadata when saving emails, but it's good to verify:
- When SES stores the email in S3, it will set the
Content-Typeheader to something liketext/plain; charset=utf-8(ortext/html; charset=utf-8for HTML emails) - If you ever manually modify these S3 objects, don't change the
charset=utf-8part of theContent-Typeheader—this tells tools viewing the file to use UTF-8 encoding.
Test Your Setup
Send a test email with your example text:
hola como estas como fue tu día mi amigo
Then check the corresponding object in S3. You should see the text exactly as sent, with día instead of d=C3=ADa. If you're viewing the file directly in the S3 console, it defaults to UTF-8, so it should render correctly right away.
Quick Note on the Encoding Issue
That =C3=AD sequence is the quoted-printable representation of the UTF-8 byte pair for í. By disabling quoted-printable and forcing UTF-8, SES stores the raw UTF-8 bytes, which S3 handles seamlessly as long as the metadata is set to flag the encoding.
内容的提问来源于stack exchange,提问作者Ben Hall

