ãã®è¨äºã¯ãKLab Engineer Advent Calendar 2024 ã®25æ¥ç®ã®è¨äºã§ãã
ã¯ããã«
ç¬èªãã¡ã¤ã³ãé·å¹´ç¶æãã¦ããæ¹ã ã®å¤ãã¯ãç¾å¨ãGoogle Workspaceï¼æ§G Suiteç¡åçï¼ãå©ç¨ãã¦ããã®ã§ã¯ãªãã§ãããããçè ããã®ä¸äººã§ããç¬èªãã¡ã¤ã³ã®ã¡ã¼ã«ãéåä¿¡ã§ããGmailã®ä¾¿å©ãªæ©è½ãç¡åã§å©ç¨ã§ããã®ã¯æ¬å½ã«ãããããã§ããã
ãããªããã§é·å¹´ç¬èªãã¡ã¤ã³ã®ã¡ã¼ã«ãéç¨ãã¦ããããã§ãããæè¿ã«ãªã£ã¦ä¸é¨ã®ã¡ã¼ã«ãå±ããªããã©ãã«ã«è¦èããã¾ããããã®è§£æ±ºçã¨ãã¦Cloudflare Email Routingãå°å ¥ããã¨ããããã£ããåé¡ã解決ãã¾ãããæ¬è¨äºã§ã¯ããã®è¨å®æé ããã³å¾ãç¥è¦ãç´¹ä»ãã¾ãã
ã¡ã¼ã«ç´å¤±äºä»¶ã«ã¤ãã¦
ä»åã®åãçµã¿ã®ãã£ããã«ãªã£ããã¡ã¼ã«ç´å¤±äºä»¶ãã«ã¤ãã¦èª¬æãã¾ãããã6ã¶æã»ã©ãau IDã®äºæ®µéèªè¨¼ã¡ã¼ã«ãçè ææã®ç¬èªãã¡ã¤ã³ã®ã¡ã¼ã«ã¢ãã¬ã¹ã«å±ããªãåé¡ãèµ·ãã¦ãã¾ããããã®ç¬èªãã¡ã¤ã³ã®ã¡ã¼ã«ã¢ãã¬ã¹ã¯Google Workspaceã§ç®¡çãã¦ããããã®ã¡ã¼ã«ä»¥å¤ã¯ç¹ã«ãã©ãã«ãªãå©ç¨ã§ãã¦ãã¾ãã
ã¾ãauã®ãµãã¼ãã«åãåããã¾ããããåæ§ã®äºä¾å ±åã¯ãªãããã§ãauãµãã¼ãã§ã¯è§£æ±ºã§ãã¾ããã§ããã次ã«ãGoogleã«åãåããããã¨ãã¾ããããç¡åã¦ã¼ã¶ã¼ã®ããæ£å¼ãªãµãã¼ãã«é ¼ããã¨ãã§ãã¾ãããã¾ããGoogle Workspace管çã³ã³ã½ã¼ã«ã®ãã¡ã¼ã«ãã°ã®æ¤ç´¢ããç¡åã¦ã¼ã¶ã¼ã§ã¯å©ç¨ã§ãã¾ããã§ãã1ã
ä»ãµã¼ãã¹ããã®ã¡ã¼ã«ã¯åé¡ãªãå±ãã¦ãããããauãè¡åã®æªãã¡ã¼ã«ãéã£ã¦ããããGoogleãã¨ã©ã¼ã¡ã¼ã«æ±ãã«ããæ¡ä»¶ãå³ããããããã©ã¡ãããåå ã¨èãããã¾ãããããã«ããæ§G Suiteç¡åçã§ã¯ãã©ãã«æã®æã¡æãå°ãªãããªã¹ã¯ã®ããç°å¢ã§ãããã¨ãåèªèãã¾ããã
ãã£ããã¨ã®æ¦è¦
ä¸è¨ã®åé¡ã解決ãããããGoogle Workspaceã®å段ã«Cloudflare Email Routingãå ¥ãããã¨ã«ãã¾ãããCloudflare Email Routingãå©ç¨ãã¦ãåé¡ãèµ·ãã¦ããã¡ã¼ã«ã ããYahoo! ã¡ã¼ã«ãªã©å¥ãµã¼ãã¹ã«è»¢éããã°åé¡ã解決ããã®ã§ã¯ãªããï¼ã¨èããããã§ãã
æé ã¯ä»¥ä¸ã®éãã§ãã説æä¸ãGoogle Workspaceã§ç®¡çãã¦ããã¡ã¼ã«ã¢ãã¬ã¹ã[email protected]
ã¨ãã¾ãã
ã¦ã¼ã¶ã¼ã¨ã¤ãªã¢ã¹ãã¡ã¤ã³ã®è¨å® Google Workspaceã®ãã¦ã¼ã¶ã¼ã¨ã¤ãªã¢ã¹ãã¡ã¤ã³ããå©ç¨ãããµããã¡ã¤ã³ã®ã¡ã¼ã«ã¢ãã¬ã¹ã§ãã¡ã¼ã«ãåä¿¡ã§ããããã«è¨å®ãã¾ãï¼
[email protected]
ï¼ãCloudflare Email Routingã®å°å ¥ å ã®ã¢ãã¬ã¹å®ã®ã¡ã¼ã«ãCloudflare Email Routingã§åä¿¡ãããµããã¡ã¤ã³ã®ã¢ãã¬ã¹ã«è»¢éããæ§æã«ãã¾ãã
ãã®æ¹æ³ã ã¨å ã®Google Workspaceã®ãã£ã«ã¿è¨å®ããã®ã¾ã¾å©ç¨å¯è½ã§ããããä»ã®æ¹æ³ã«æ¯ã¹ã¦ç§»è¡ã®æéãå°ãªããä¸ä¸äºæ ããã£ã¦ãå ã«æ»ããããã¨ããå©ç¹ãããã¾ãã
æ§G Suiteç¡åçã¨ã¯
詳細ã®èª¬æã«å ¥ãåã«ãæ§G Suiteç¡åçã«ã¤ãã¦èª¬æãã¾ãã
Googleã®ãµã¼ãã¹ï¼Gmailã»Google ã«ã¬ã³ãã¼ã»Google Driveãªã©ï¼ãç¬èªãã¡ã¤ã³ã§çµç¹ã¡ã³ãã¼åãã«æä¾ãããµã¼ãã¹ãGoogle Workspace ã§ããã以åã¯G Suiteï¼ããã«ä»¥åã¯Google Appsï¼ã¨å¼ã°ãã¦ãã¾ããã
ããã大æï¼2012年以åï¼ã¯10人以ä¸ã®çµç¹ã§ããã°ç¡æã§ä½¿ããã¨ãã大ç¤æ¯ãèãããã¦ãã¾ãããå½æå人ã§ãã¡ã¤ã³ãææãã¦ãã人ã¯å ¨å¡å©ç¨ãã¦ããããã«æãã¾ãï¼çè ã®å¨ãã§ã¯æ¬å½ã«ãããªå°è±¡ã§ããï¼ã2012å¹´ã«ç¡åçã®æ°è¦æä¾ã¯çµäºãã¾ãããããã以åããã®å¥ç´è ã¯å¼ãç¶ãç¡åæä¾ããã¦ãã¾ãã
2022å¹´ã«Googleããç¡åçããããã§ãéæããå¼ã£è¶ãã¦ãã¨è¨ãåºãããã®ã®ããã°ãããã¦ããããã®ããã¾ããã¨ãªãã移è¡ããã¢ã¿ã¢ã¿ãã¦ãã人ï¼çè ãå«ãï¼ã¯åã³æããããããªçµç·¯ãããã¾ãã
è¥ã人ã«ã¯ä¿¡ããããªããããªè©±ã ã¨æãã¾ãããå¤åã®äººãç¬èªãã¡ã¤ã³ã®ã¡ã¼ã«ã¢ãã¬ã¹ãç¶æã§ãã¦ããã®ã¯ãããªã«ã©ã¯ãªãããã®ã§ããæ¬å½ã«ããããããã¨ã§ãã
Cloudflare Email Routingã¨ã¯
Cloudflare Email Routing ã«ã¤ãã¦ãç´¹ä»ãã¾ãã
Cloudflareã¯CDNã®ä¼ç¤¾ã¨ãã¦æåã§ãããç¬èªãã¡ã¤ã³ãç¶æãã¦ãã人ã«ã¨ã£ã¦ã¯ç¡åã§DNSãæä¾ãã¦ãããä¼ç¤¾ã§ãããã¾ãããã以å¤ã«ãæ§ã ãªãµã¼ãã¹ãæä¾ãã¦ãã¾ãã
Cloudflare Email Routingã¯ã¡ã¼ã«ã®è»¢éãµã¼ãã¹ã§ãã1ãã¡ã¤ã³ãããæ大200åã®å®å ã»è»¢éå ã管çã§ãããã£ãããªã¼ã«ã¢ãã¬ã¹ï¼æªå®ç¾©ã®ã¢ãã¬ã¹å ¨é¨ãåãåãã¢ãã¬ã¹ï¼ãæä¾ãã¦ãã¾ãã大ç¤æ¯ãèããªãã¨ã«ãå©ç¨æéã¯ç¡æã§ãã
å³2ã®ããã«ç®¡çç»é¢ããã¡ã¼ã«ã®è»¢éç¶æ³ã確èªã§ããã®ã便å©ã§ããã
è¨å®1ï¼ã¦ã¼ã¶ã¼ã¨ã¤ãªã¢ã¹ãã¡ã¤ã³ã®è¨å®
ã¾ãã¯Google Workspaceã§ã¦ã¼ã¶ã¼ã¨ã¤ãªã¢ã¹ãã¡ã¤ã³ãè¨å®ããæé ã説æãã¾ããã¦ã¼ã¶ã¼ã¨ã¤ãªã¢ã¹ãã¡ã¤ã³ãè¨å®ãããã¨ã§ããµããã¡ã¤ã³ã®ã¡ã¼ã«ã¢ãã¬ã¹ã§ãã¡ã¼ã«ãåä¿¡ã§ããããã«ãªãã¾ããä¾ãã°ã[email protected]
ã¨ããã¢ãã¬ã¹ã§ã¡ã¼ã«ãåä¿¡ãããã¨ãå¯è½ã«ãªãã¾ãã
æé
Google Workspace管çã³ã³ã½ã¼ã«ã«ãã°ã¤ã³ 管çè ã¢ã«ã¦ã³ãã§Google Workspaceã®ç®¡çã³ã³ã½ã¼ã« ã«ãã°ã¤ã³ãã¾ãã
ãã¡ã¤ã³ã®è¿½å ãã¢ã«ã¦ã³ããããã¡ã¤ã³ãããã¡ã¤ã³ã®ç®¡çããã¼ã¸ã«ç§»åããããã¡ã¤ã³ãã追å ããé¸æãã¾ãããã¡ã¤ã³åãå ¥åãï¼ä¾ï¼ws.example.comï¼ããã¦ã¼ã¶ã¼ã¨ã¤ãªã¢ã¹ãã¡ã¤ã³ããã§ãã¯ããã¯ã¹ãé¸æãã¦ããã¡ã¤ã³ã追å ãã¦ææ権ã証æããã¿ã³ãæ¼ãã¾ãã
ãã¡ã¤ã³ã®ææ権ã®ç¢ºèª ãã¼ã¸å ã®æ示ã«å¾ã£ã¦ãã¡ã¤ã³ã®DNSè¨å®ã§TXTãã£ã¼ã«ãã追å ãã¦ã確èªããã¿ã³ãæ¼ãã¾ãã
ã¦ã¼ã¶ã¼ã¨ã¤ãªã¢ã¹ãã¡ã¤ã³ã®æå¹å ãèªç¤¾ãã¡ã¤ã³ã§ Gmail ã®ä½¿ç¨ãéå§ããããã¿ã³ãæ¼ãããã¼ã¸å ã®æ示ã«å¾ã£ã¦MXã¬ã³ã¼ããè¨å®ãã¾ããå®äºå¾ã«ã確èªããã¿ã³ãæ¼ãã¨è¨å®å®äºã§ãã
ã¡ã¼ã«éä¿¡ãã¹ã è¨å®ãåæ ãããã確èªããããã«ããµããã¡ã¤ã³ã®ã¡ã¼ã«ã¢ãã¬ã¹ã«ãã¹ãã¡ã¼ã«ãéä¿¡ãã¾ãã
è¨å®2ï¼Cloudflare Email Routingã®å°å ¥
次ã«ãCloudflare Email Routingãå°å ¥ããæ¹æ³ã説æãã¾ããCloudflare Email Routingãå©ç¨ãããã¨ã§ãç¬èªãã¡ã¤ã³ã®ã¡ã¼ã«ãåä¿¡ããæå®ããã¢ãã¬ã¹ã«è»¢éãããã¨ãã§ãã¾ãã
注æç¹ã§ããã対象ãã¡ã¤ã³ã®DNS管çã«Cloudflareãå©ç¨ãã¦ãããã¨ãEmail Routingå©ç¨ã®åæã«ãªãã¾ããä»ç¤¾ã§DNS管çãã¦ããå ´åã¯å©ç¨ã§ãã¾ããã
æé
Cloudflare管çã³ã³ã½ã¼ã«ã«ãã°ã¤ã³ Cloudflareã®ç®¡çã³ã³ã½ã¼ã«ã«ãã°ã¤ã³ãããã¡ã¤ã³ç®¡çç»é¢ã«ç§»åãã¾ãã
転éã«ã¼ã«ã®è¨å® ãEmailããEmail Routingããã¼ã¸ã«ç§»åãããRouting Rulesãã¿ãã§è»¢éã¢ãã¬ã¹ã®è¨å®ãè¡ãã¾ããä¾ãã°ã
[email protected]
å®ã®ã¡ã¼ã«ã[email protected]
ã«è»¢éããè¨å®ãè¡ãã¾ãã転éå ã¢ãã¬ã¹ã®ç¢ºèª 転éå ã¨ãã¦è¨å®ããã¡ã¼ã«ã¢ãã¬ã¹ã«ç¢ºèªã¡ã¼ã«ãå±ãã®ã§ãã¡ã¼ã«ã®ãVerify email addressããã¿ã³ãæ¼ãã¾ãã
Email Routingã®æå¹å ãOverviewãã¿ããããEnable Email Routingããªã³ã¯ãã¯ãªãã¯ãã¾ããããã«ããMXã¬ã³ã¼ããæ¸ãæãããã¡ã¼ã«è»¢éãéå§ããã¾ãã
ã¡ã¼ã«éä¿¡ãã¹ã è¨å®ãåæ ãããã確èªããããã«ããã¹ãã¡ã¼ã«ãéä¿¡ãã¾ããã¡ã¼ã«ãæ£ãã転éããããã¨ã確èªãã¾ãã
çµæï¼ä½ããã¦ããªãã®ã«åé¡ã解決ãã
ä¸è¨ã®è¨å®ãè¡ã£ãã¨ãããããã ãã§au IDã®äºæ®µéèªè¨¼ã¡ã¼ã«ãGoogle Workspaceã§åãåããããã«ãªãã¾ããã
ä»®ã«å ã®ã¡ã¼ã«ã«ä½ãããåé¡ãããã¨ããã°ãCloudflare Email Routingãçµç±ããã¨ããã§åé¡ã¯å¤ãããªãã¯ãã§ããã2ãåãåããããã«ãªã£ãã®ã¯å ¨ãäºæ³å¤ã§ãã
ç¶æ³ãæ¹åããã®ã§ãã£ããã¯æ§åè¦ã«ãªãã¾ãããã¡ã¼ã«ç´å¤±äºä»¶ãåçºããå¯è½æ§ãå¦å®ã§ãã¾ããããããããªã£ããæ¹ãã¦å¯¾å¦ãããã¨æãã¾ãã
ä»åå¾ãããç¥è¦
ç¥è¦1ï¼ã¦ã¼ã¶ã¼ã¨ã¤ãªã¢ã¹ãã¡ã¤ã³ã«ãgmailãã¯ä½¿ããªã
Google Workspaceã®ã¦ã¼ã¶ã¼ã¨ã¤ãªã¢ã¹ãã¡ã¤ã³ã¨ãã¦ãgmail.example.comãã®ãããªãã¡ã¤ã³ã¯æå®ã§ãã¾ãããæå®ãããã¨ããã¨ãç¡å¹ãªãã¡ã¤ã³ã§ããã¨æããã¾ããããªãæãããã®ããã°ããç解ã§ãã¾ããã§ããã
ãã£ãã·ã³ã°ç®çã§ç´ããããURLãä½ãããªãããã«ãã¨ããé æ ®ãªãã§ããããã
ç¥è¦2ï¼ãµã¼ãã¹ãã¨ã«ç»é²ã¡ã¼ã«ã¢ãã¬ã¹ãå¤ãã¦ããã¨ä¾¿å©
ãµã¼ãã¹ãã¨ã«ç°ãªãã¡ã¼ã«ã¢ãã¬ã¹ã使ç¨ããã®ã¯ä¸è¬çã«è¯ããã¯ããã¯ã§ãããCloudflare Email Routingã使ãå ´åã¯ç¹ã«æç¨ã§ããä»åã®ããã«ä¸é¨ã®éä¿¡è ããã®ã¡ã¼ã«ã ããã©ãã«ããããããªå ´åã«ãç¹å®ã®ã¡ã¼ã«ã ã転éå ãå¤ãããã¨ãã§ãã¾ãã
ç¥è¦3ï¼Gmailã¯RFCéåã®Message-IDãæ¸ãæãã
ä»åãGoogle Workspaceã§åãåã£ãã¡ã¼ã«ãå¥ã®ã¢ã«ã¦ã³ãã«è»¢éãããã¨ããã¨ãããä¸é¨ã¡ã¼ã«ãDMARCã¨ã©ã¼ã«ãªãCloudflareãåãåã£ã¦ãããªããã¨ããããã¾ãããä»åã®å ´åã1åç®ã¯åãã¡ã¼ã«ãæ£å¸¸ã¨ãã¦åãåã£ã¦ããã¯ããªã®ã§ãå°ã ä¸æè°ã¨è¨ãã°ä¸æè°ã§ãã
調ã¹ãã¨ãããGmailã¯Message-IDãRFCéåã®ã¡ã¼ã«ãåãåãã¨Message-IDãæ¸ãæããããã§ããä¸æ¹ã§ãDKIMã®ç½²åæ¤è¨¼ã¯ã¡ã¼ã«ãããã対象ãªã®ã§ãããããæ¸ãæããã¡ã¼ã«ã転éããã¦ç½²åæ¤è¨¼ã§å¤±æãã¦ãã¾ãã¨ãããã¨ãªã®ã§ããã3ã
RFCéåã®ã¡ã¼ã«ãéãã®ãæªãã®ãGmailãã¡ãã»ã¼ã¸IDãæ¸ãæãã¦ãã¾ãã®ãããéããªã®ãCloudflareã®å®è£ ãæªãã®ãçè ã®ç¥èã§ã¯å¤æã§ãã¾ããããæåãããã£ã¦ããã°å¯¾å¦ãã§ããã®ã§è¯ãã¨ãã¾ããããä»åã®å ´åã¯è»¢éå ãGoogle Workspaceã®ãµããã¡ã¤ã³å®ã«ãããã¨ã§è»¢éæãã¨ã©ã¼ãèµ·ããªããªãã¾ããã
ã¡ãªã¿ã«ãç§ãåãåã£ã¦ããã¡ã¼ã«ã®ä¸ã§ãã®ãããªæåã«ãªãã®ã¯ããau IDã2段éèªè¨¼ç¢ºèªã³ã¼ãéç¥ãããau PAYããå©ç¨ã®ãç¥ããããªã©auããã®ã¡ã¼ã«ã®ä¸é¨ã®ã¿ã§ãããããã®ã¡ã¼ã«ã®ã¡ãã»ã¼ã¸IDã¯012.345.678.JavaMail.spluser@c1hsm01a
ã®ãããªå½¢å¼ãªã®ã§ãããRFCã®å®ç¾©ã§ã¯<
ã¨>
ã§å²ã¾ãã¦ããå¿
è¦ãããããã§ãã
ã¾ã¨ã
- æ§G Suiteç¡åçã§ã¡ã¼ã«åä¿¡ãã©ãã«ããã£ãå ´åãCloudflare Email Routingãå段ã«å
¥ããé¸æè¢ããã
- ã¨ã©ã¼ãã°ã確èªã§ãã
- åé¡ã®ããã¡ã¼ã«ã ã転éå ãå¤æ´ã§ãã
- ï¼è¨äºä¸ã§ã¯è§¦ãã¾ããã§ãããï¼Email Workers ã§è¤éãªå¦çããããã¨ãã§ãã
- au IDã®äºæ®µéèªè¨¼ã¡ã¼ã«ã®Message-IDã¯RFCéå
- ãã©ãã«ã®åå ã«ãªããã
- ä»åã®åé¡ã®ç´æ¥ã®åå ã¨ã¾ã§ã¯è¨ãåããªãããå°ãªãã¨ãé å ã§ã¯ãããã
- æåã¦ã¼ã¶ã¼ã§ããã°ãã°ããã¨ã©ã¼å 容ã確èªã§ããã¯ãã§ãããå°ãæããããå¾ãããã¯ãã§ãã↩
- 転éãããã¨ã§éä¿¡å IPã¢ãã¬ã¹ãå¤ãã£ã¦SPFãã§ãã¯ã§softfailããã®ã§ããããç¶æ³ãæªåãã¦ãä¸æè°ã¯ããã¾ããã↩
- GmailãCloudflare Email RoutingãARC (Authenticated Received Chain) ããµãã¼ããã¦ãããæ¬æ¥ãªããã®ãããªäºæ ãé²ããã¯ãã ã¨æãã®ã§ãããã©ãã«ãè¬ã§ãã↩