node.js x AWS SESã使ã£ãã¡ã¼ã«é ä¿¡ã«ã¤ã㦠ï¼@geechs night 3rd Julyï¼Read less
ã¡ã¼ã«é ä¿¡ãµã¼ãã¹ã調ã¹ã¦ãããã調åã«ä¹ã£ã¦ æéã®ã¡ã¼ã«é ä¿¡æ°ãã¨ã®ä¾¡æ ¼æ¯è¼ã°ã©ã ãã§ããããã¾ããã http://atskimura.github.io/compare/cloud-mail.html å¤ããï¼w 以ä¸ã§ç´°ããè¦ã¦è¡ãã¾ãããã ãªããããã§è¨ãã¡ã¼ã«é ä¿¡ãµã¼ãã¹ã¯Amazon SESãSendGridãªã©ãã¢ããªããéç¥ã¡ã¼ã«ã大éé ä¿¡ããã¨ããªã©ã«ä½¿ããµã¼ãã¹ã§ãã 対象ãµã¼ã㹠対象ã«ãããµã¼ãã¹ã¯ä»¥ä¸ã®13åãç¸å¤ããããã£ã±ãããã Amazon SES SendGridãSendGridï¼æ¥æ¬ï¼ Mailgun Postmark Mailjet Mandrill LeaderSend SocketLabs Elastic Email turboSMTP PostageApp Critsend ãããã£ã¯ã©ã¦ã ESS MailChimpãªã©ã®ãã¼ã±ãã£
ã¯ããã« ããã«ã¡ã¯æ¤æ¨å樹ã§ããå æ¥Developers.IO AWSé¢é£ããã°500æ¬ç®è¨å¿µã¨ãã¦ãå¼ç¤¾ ææãè±èªããã°ãæ稿ãã¾ããã How to send Email from PHP application via Amazon SES ï½ Developers.IO ããã°ã§ã¯EC2ããSESããªã¬ã¼ãã¦ã¡ã¼ã«éä¿¡ããããã®Postfixè¨å®æ¹æ³ãç´¹ä»ãã¦ãã¾ãã/etc/postfixã«ããã¤ããã¡ã¤ã«ãç¨æããã ãã§ãæå¤ã¨ç°¡åã«SESãå©ç¨ã§ããããã§ããã æ¢åã·ã¹ãã ãAWSã¸ç§»è¡ããã«ããã£ã¦ãã¢ããªã±ã¼ã·ã§ã³ã®æ¹ä¿®ãè¡ããããµã¼ãã¼ããã¡ã¼ã«ãæ軽ã«éãããã¨ããéè¦ã¯å¤ãã®ã§ã¯ãªãã§ãããããã¨ãããã¨ã§ã誰ã§ãç°¡åã«SESãå©ç¨ã§ããããChefã§Postfixãè¨å®ãã¦ã¿ã¾ããã äºåæºå 次ã®ãã®ãäºåã«æºåãã¦ããã¾ããä»åã¯SESãSandboxç°
ã©ãã大ç§ã§ãã EC2ããEã¡ã¼ã«ãéãã¨ããæ¡ä»¶ãããããããã¾ããããããã¦çµæ§ãªç¢ºçã§ãã©ãããã§ããã(æ¶ç®)ããããªè¦ãçµé¨ããã¹ããã©ã¯ãã£ã¹ã¨ãã¦ã¾ã¨ãã¦ã¿ã¾ãããä¸å¿æè¡çãªã¨ããã¯ç¶²ç¾ ããã¤ããã§ãããã¡ã¼ã«ã»ãã¥ãªãã£ã®å°éã§ã¯ãªãã®ã§ãä¸åãééããããã°ãææãã ããã ã§ã¯ãã¡ã¼ã«éä¿¡ãã©ãã«ã®å å¶ã§ãããã¹ãã ã¡ã¼ã«ã¨ãã®å¯¾çãããç´¹ä»ãã¦ããã¾ãã ã¹ãã ã¡ã¼ã«ã¨ã®éããã¤ã¸ã§ã¹ã Eã¡ã¼ã«ã®æ´å²ã¯ãã¹ãã ã¡ã¼ã«ã¨ã®éãã®æ´å²ã¨è¨ãã¾ãã ä¸ç¹å®å¤æ°ã«éä¿¡ãããã¹ãã ã¡ã¼ã«(æªæ¿è«¾ã®åºåã¡ã¼ã«)ã¯ãã¡ã¼ã«åä¿¡è ã«ä¸å¿«ãªæãããããã¨ã¨ãã«ãã¡ã¼ã«ãµã¼ãã¼ã®ã¡ã¼ã«æµéãççºçã«å¢å ãããé·ããã¡ã¼ã«ãµã¼ãã¼ç®¡çè ãæ³£ããã¦ãã¾ããã ãã®ã¹ãã ã¡ã¼ã«ããªãã¨ãæéãããã¨ãç¾å¨ã§ã¯ä¸»ã«ä»¥ä¸ã®ãããªå¯¾çãè¡ããã¦ãã¾ãã 1. éä¿¡ã¡ã¼ã«ãµã¼ãã¼å´ã®ãããã¯ã¼ã¯
æ²¹æããã¦ããã6æã«æ´æ°ããã¦ããªããããªã®ã§ãä½æ¥ã¡ã¢ã§æ´æ°ã Amazon SESã¯SDKãªã©ã使ã£ã¦ç´æ¥ã¡ã¼ã«éä¿¡ããæ¹æ³ã¨ãSMTPã¤ã³ã¿ã¼ãã§ã¼ã¹ã使ç¨ãã¦éä¿¡ããæ¹æ³ãããã¾ãã SDKã使ã£ã¦ã¡ã¼ã«éä¿¡ãããæ¹æ³ã¯ãã¡ãã®ããã°ã§ç´¹ä»ããã¦ããã®ã§ãä»åã¯å¾è ã®æ¹æ³ã§ã¡ã¼ã«ãéä¿¡ãã¦ã¿ã¾ãã Amazon SESã®è¨å® ã¾ãSESã§éä¿¡å ã¨ãªãã¡ã¼ã«ã¢ãã¬ã¹ã¯ä»¥ä¸ã®ããã«Verified Sendersã«ç»é²ãã¦ããã¦ä¸ããã â»SESããããã¯ã·ã§ã³ç°å¢ã§ãªãå ´åã¯åä¿¡å ã¡ã¼ã«ãç»é²ããå¿ è¦ãããã¾ã 次ã«ä»¥ä¸ã®ããã«SMTP Credentialsãä½æãã¾ãã SMTP Credentialsã¯IAMã«ãã£ã¦æä¾ããã¦ãã¾ãã®ã§ãIAMã®ã¦ã¼ã¶ã¼åãæå®ãã¾ãã IAMã®ã¦ã¼ã¶ã¼åãæå®ããã¨ä»¥ä¸ã®ããã«SMTPã¦ã¼ã¶ã¼ã¨ãã¹ã¯ã¼ããçºè¡ããã¾ãã ããã°ã©ã ãã使ã£
Amazon SESã§ç°¡åDKIM(Easy DKIM)ã®ãµãã¼ããå§ã¾ã£ãã ããã¾ã§DKIMãè¡ãã«ã¯èªåã§ç½²åãè¡ãå¿ è¦ããã£ããã¡ããã©éä¿¡ãã¦ããã¡ã¼ã«ã«DKIMã®ç½²åãå ãããã¨PHPã®ã©ã¤ãã©ãªã調ã¹ã¦ããç¢å ã®æå ±ã ã£ãã æ示ããã¦ã¯ããªããã©ã追å ã®ã³ã¹ãã¯ããããªãã¿ããã ãã®åã«ç°¡åã«DKIMã®ç´¹ä»ã DKIMã¨ã¯ãè¿·æã¡ã¼ã«å¯¾çã®ä¸ç°ã¨ãã¦ãããã¡ã¼ã«ã®éä¿¡è ãæ£ãããã©ããã確èªããæ¹æ³ã®ã²ã¨ã¤ã§ãããæ£ããéä¿¡è ã§ãããã¨ã確èªããæ¹æ³ã¨ãã¦ã¯ä»ã«ã¯SPFãSender IDãããã 使ç¨ããæè¡è¦ç´ ã¨ãã¦ã¯ãDKIMã¯é»åç½²åãSPFãSender IDã¯IPã¢ãã¬ã¹ã使ã£ã¦éä¿¡è ãæ¤è¨¼ããã Amazon SESã§ã¯ãããï¼ã¤ã®æè¡ãéçºè ã¬ã¤ãã§ç´¹ä»ãã¦ãããSPFãSender IDã¯DNSã¬ã³ã¼ãã追å ããã ãã§å¯¾å¿ã§ãã¦ããã®ã ããDKIMã«ã¤ã
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}