Computer >> Hướng Dẫn Máy Tính >  >> Phần Mềm >> Thư Điện Tử

Thay thế Email Server dựa trên Server bằng Amazon SES: Hướng dẫn từng bước

Một ngày đẹp trời, không lý do gì, Ubuntu 18.04 business server của tôi ngừng forward mail đến Gmail address.

Hôm trước, .forward files trong home directories của local server accounts dùng cho email - như /home/office/.forward - vui vẻ redirect tất cả mail aimed tại business addresses đến Gmail hàng ngày. Rồi đột ngột dừng.

Khi nhận ra sự cố, tôi check server logs. /var/log/mail.err spitting out messages như:

status=deferred (delivery temporarily suspended: connect to alt2.gmail-smtp-in.l.google.com[219.8.202.27]:25: Connection timed out)

Check server mailboxes cho thấy mail coming in, nhưng Postfix không establish connection đến Gmail để forward messages.

Tự nhiên restart Postfix, không giúp.

sudo systemctl restart postfix

Xác nhận không có gì block outgoing messages trên port 25 (SMTP). Check domain blacklisted (nhiều online tools), peek MX records bằng dig:

dig MX bootstrap-it.com

Không có gì. Mọi thứ似乎 check out.

Sau vài جلسات troubleshooting frustrating, tôi bỏ cuộc và thử something completely different.

Là AWS solutions architect và co-authored hai sách AWS cho Wiley/Sybex (một guide Cloud Practitioners exam, một Solutions Architect Associate exam), tôi có willing và able build own stack AWS tools handle email server needs trên cloud?

Kết quả: willing và - sau research nghiêm túc và trial/error - able. Làm được cần:

  • Tạo S3 bucket lưu incoming emails.
  • Tạo Simple Notification Service (SNS) topic email notice mỗi khi email mới arrive.
  • Cấu hình Amazon Simple Email Service (SES) take over email domain (bootstrap-it.com) handle incoming mail. Involves: thêm MX record vào Route 53 (domain management) point SES đến domain; add và verify từng email address muốn SES control; bảo SES gửi new messages đến S3 bucket đồng thời trigger alert cho SNS topic.
  • Nếu cũng muốn gửi email messages qua service, tốt idea cấu hình SES sign outgoing messages dùng DomainKeys Identified Mail (DKIM).

Tôi không mô tả chi tiết tất cả steps. Có excellent documentation. Nhưng mention một số pain points.

Phải thêm MX record vào DNS hosted zone cho mỗi domain dùng. Dù domains managed trong Route 53, cần provide value cho record.

Value phụ thuộc AWS region nơi SES resource located. Trong case tôi:

10 inbound-smtp.us-east-1.amazonaws.com

SNS notifications đến trong single long string text chứa vài morsels useful nhưng hard-to-read information. Đủ identify spam, nhưng thường cần hơn. Tôi dùng notifications như heads-up có mail mới trong S3 bucket.

Xem emails trong S3 bucket via AWS Management Console không quá tệ nếu tháng 1-2 lần. Nhưng nếu nhanh hơn, cần better way access và read messages.

Tuy nhiên, tạo protocol automate process thực sự là local OS problem cần entirely different tools. Tôi giải quyết cho mình dùng AWS CLI và cool Bash script. Xem cách tôi làm tại bài viết này.

Nhiều administration goodness hơn dạng books, courses, articles tại bootstrap-it.com.