변군이글루

[AWS] Amazon SES 메일 테스트 본문

* 퍼블릭 클라우드

[AWS] Amazon SES 메일 테스트

변군 변군이글루 2021. 9. 14. 17:06
728x90

Amazon SES 메일 테스트

awsses-mailtest.sh 생성

#!/bin/bash

SMTPDomain=sangchul.kr
SMTPServer=email-smtp.ap-northeast-2.amazonaws.com
SMTPPort=587
SMTPUsername=`echo -n "SMTPUSERNAME" | openssl enc -base64`
SMTPPassword=`echo -n "SMTPPASSWORD" | openssl enc -base64`
MAILFrom=noreply@${SMTPDomain}
MAILTo=${1:-test2@4wxyz.com}

cat <<EOF > input.txt
EHLO ${SMTPDomain}
AUTH LOGIN
${SMTPUsername}
${SMTPPassword}
MAIL FROM: ${MAILFrom}
RCPT TO: ${MAILTo}
DATA
From: Sender Name <noreply@${SMTPDomain}>
To: ${MAILTo}
Subject: Amazon SES SMTP 테스트

이 메시지는 Amazon SES SMTP 인터페이스를 사용하여 전송되었습니다.
.
QUIT
EOF

openssl s_client -crlf -quiet -starttls smtp -connect ${SMTPServer}:${SMTPPort} < input.txt

스크립트 : https://github.com/anti1346/amazonSESmailtest

메일 발송 테스트

$ ./awsses-mailtest.sh

$ ./awsses-mailtest.sh bounce@simulator.amazonses.com
$ sh awsses-mailtest.sh
depth=4 C = US, O = "Starfield Technologies, Inc.", OU = Starfield Class 2 Certification Authority
verify return:1
depth=3 C = US, ST = Arizona, L = Scottsdale, O = "Starfield Technologies, Inc.", CN = Starfield Services Root Certificate Authority - G2
verify return:1
depth=2 C = US, O = Amazon, CN = Amazon Root CA 1
verify return:1
depth=1 C = US, O = Amazon, OU = Server CA 1B, CN = Amazon
verify return:1
depth=0 CN = email-smtp.ap-northeast-2.amazonaws.com
verify return:1
250 Ok
250-email-smtp.amazonaws.com
250-8BITMIME
250-STARTTLS
250-AUTH PLAIN LOGIN
250 Ok
334 XXXXxxxxxx
334 YYYYyyyyyy
235 Authentication successful.
250 Ok
250 Ok
354 End data with <CR><LF>.<CR><LF>
250 Ok 010c017be353c679-0cc6c562-c5c2-419d-8e0c-98d387075857-000000
451 4.4.2 Timeout waiting for data from client.
728x90
0 Comments
댓글쓰기 폼