Amazon SES · Simple Email Service

Email to real humans — receipts, password resets, newsletters. Two doors in: an SMTP endpoint for apps that only speak SMTP, and an API for apps you can change. They use different credentials, and picking the wrong one is the whole question.

Email gửi tới người thật — hoá đơn, reset mật khẩu, newsletter. Hai cửa vào: SMTP endpoint cho app chỉ nói được SMTP, và API cho app sửa được. Chúng dùng credential khác nhau, và chọn nhầm cửa chính là toàn bộ câu hỏi.

Two doors, two credential typesHai cửa, hai loại credential

Two ways an application reaches Amazon SES. The top path is for an application that can only speak SMTP: it connects to the SES SMTP endpoint using STARTTLS on port 587 and authenticates with an SES SMTP username and password. The bottom path is for an application whose code can be changed: it calls the SES API over HTTPS and authenticates with temporary credentials from an IAM role such as an EC2 instance profile, ECS task role or Lambda execution role. Both paths converge on SES, which delivers to the recipient's mail server. A note lists the port mapping: STARTTLS on ports 25, 587 and 2587, and TLS Wrapper on ports 465 and 2465, and warns that EC2 throttles outbound port 25 by default. legacy app speaks SMTP only app you can change EC2 · ECS · Lambda SMTP · STARTTLS :587 email-smtp.<region>.amazonaws.com auth: SES SMTP username + password SES API · HTTPS SendEmail · SendRawEmail auth: IAM role → temporary creds Amazon SES DKIM signing · reputation → recipient mail server STARTTLS → 25 · 587 · 2587 · TLS Wrapper (SMTPS) → 465 · 2465 · EC2 throttles outbound :25 by default, use :587 an IAM role cannot authenticate an SMTP session — that mismatch is the classic wrong answer

Read the constraint sentence in the stem. "The application can use SMTP only" removes the whole bottom half of this diagram, and with it every answer built on ses:SendEmail permissions or the AWS SDK.

Đọc câu ràng buộc trong đề. "Ứng dụng chỉ dùng được SMTP" xoá sạch nửa dưới của sơ đồ này, kèm theo mọi đáp án dựng trên quyền ses:SendEmail hay AWS SDK.

STARTTLS vsvs TLS Wrapper STARTTLS: open a plain SMTP connection, the server advertises STARTTLS, the client issues it, and the same connection is upgraded to TLS before any credential is sent. TLS Wrapper: the TLS handshake happens immediately on connect, before any SMTP at all. Same security outcome, different ports — and port 25 only ever does STARTTLS. STARTTLS: mở kết nối SMTP thường, server báo có STARTTLS, client gửi lệnh đó, và chính kết nối ấy được nâng lên TLS trước khi gửi credential. TLS Wrapper: TLS handshake xảy ra ngay khi kết nối, trước cả SMTP. Cùng kết quả bảo mật, khác port — và port 25 chỉ làm được STARTTLS.
If the app can't even do STARTTLSNếu app không làm nổi cả STARTTLS Put a local SMTP relay (Postfix) beside it: the app sends plaintext SMTP over the loopback/private subnet, the relay does STARTTLS and authentication to SES. It works, but you now own a server — so in a "least operational overhead" question it loses to talking to SES directly. Đặt một SMTP relay (Postfix) cạnh nó: app gửi SMTP plaintext qua loopback/private subnet, relay lo STARTTLS và xác thực với SES. Chạy được, nhưng giờ bạn phải nuôi một server — nên trong câu "ít vận hành nhất" nó thua việc nói thẳng với SES.

Events — where SNS actually fitsSự kiện — chỗ SNS thật sự tham gia

SNS does not send customer email for you. Its job here is the other direction: SES tells you what happened to each message, and SNS fans that out. Without it your bounce rate climbs until AWS throttles the account. SNS không gửi email cho khách hàng thay bạn. Việc của nó ở đây là chiều ngược lại: SES báo cho bạn biết mỗi thư ra sao, và SNS phân phối tin đó. Thiếu nó thì bounce rate leo lên tới lúc AWS bóp account.

The SES event pipeline. An application sends mail through SES with a configuration set attached. The configuration set has an event destination pointing at an SNS topic. Event types include Send, Delivery, Bounce, Complaint, Reject, DeliveryDelay, Open, Click and RenderingFailure. The SNS topic fans out to an SQS queue, which buffers the events, and a bounce-processor Lambda reads from the queue and updates the suppression list and the customer database. An alternative branch shows an operations alert also subscribed to the topic. A note explains that putting SQS between SNS and the processor stops events being lost when the processor is temporarily down, and that the SNS topic must be in the same Region as SES. SES + configuration set event dest. SNS topic SQS queue buffer · retry bounce processor suppression list + customer DB ops alert · email event types: Send · Delivery · Bounce Complaint · Reject DeliveryDelay · Open Click · RenderingFailure SQS between SNS and the processor = no events lost while the processor is briefly down the SNS topic must be in the same Region as SES

Hard bounce → the address is dead, stop mailing it. Complaint → the recipient hit "spam", suppress immediately. Delivery → their mail server accepted it, which is not the same as anyone reading it. Open/Click → directional analytics only; image blocking makes them unreliable.

Hard bounce → địa chỉ đã chết, ngừng gửi. Complaint → người nhận bấm "spam", suppress ngay. Delivery → mail server của họ đã nhận, không đồng nghĩa có ai đọc. Open/Click → chỉ để tham khảo xu hướng; chặn ảnh làm chúng không đáng tin.

SES vs SNS vs a mail serverSES vs SNS vs mail server tự dựng

SES SNS SMTP on EC2SMTP trên EC2
PurposeMục đích email to peopleemail cho người pub/sub notifications between systemsnotification pub/sub giữa các hệ thống legacy compatibilitytương thích hệ cũ
Templates, DKIM, reputation, suppressionTemplate, DKIM, reputation, suppression ✓ ✗ you build itbạn tự làm
Fan-out to Lambda/SQS/HTTPFan-out tới Lambda/SQS/HTTP via a config set → SNSqua config set → SNS ✓ ✗
Ops burdenGánh vận hành nonekhông có nonekhông có patching · IP reputation · HA · blocklistsvá lỗi · uy tín IP · HA · blocklist
SNS email subscriptions are for you, not your customersEmail của SNS là cho bạn, không cho khách hàng SNS can email a subscriber, but it's plain text, has no templates or branding, no unsubscribe management, no bounce handling, and every subscriber must confirm. Perfect for an ops alert; wrong for a receipt. SNS gửi email được cho subscriber, nhưng là plain text, không template hay branding, không quản lý unsubscribe, không xử lý bounce, và mọi subscriber phải xác nhận. Hoàn hảo cho cảnh báo vận hành; sai cho một hoá đơn.

Exam reflexesPhản xạ thi

  • "Legacy SMTP service, no TLS, port 25, application can use SMTP only" → connect to SES with STARTTLS and SES SMTP credentials. Not the API, not the SDK, not an instance role."Dịch vụ SMTP cũ, không TLS, port 25, ứng dụng chỉ dùng được SMTP" → nối tới SES bằng STARTTLS và SES SMTP credential. Không phải API, không SDK, không instance role.
  • "TLS Wrapper" in an option is a port giveaway: it means 465/2465. If the stem is anchored on port 25, TLS Wrapper is wrong."TLS Wrapper" trong option là dấu hiệu về port: nó nghĩa là 465/2465. Nếu đề neo vào port 25, TLS Wrapper là sai.
  • "Sending limits lifted" ≠ "port 25 unblocked on EC2". Two different requests — that's why 587 is the practical port."Đã nâng sending limit" ≠ "đã mở port 25 trên EC2". Hai request khác nhau — đó là lý do 587 mới là port thực tế.
  • "SES service role" is not a thing. SES doesn't assume a role on your behalf to send mail."SES service role" không tồn tại. SES không assume role thay bạn để gửi mail.
  • "Track bounces and stop mailing dead addresses" → configuration set → event destination → SNS → SQS → processor, updating the suppression list."Theo dõi bounce và ngừng gửi tới địa chỉ chết" → configuration set → event destination → SNS → SQS → processor, cập nhật suppression list.