æºå¸¯ã®ç©ºã¡ã¼ã«ã§ãæ¡å¼µã¢ãã¬ã¹ã®ããªãã¿ããã©ã¹ã«ãã¦ããã¨auã§ã¯ã¾ã
ä¹ ã ã«ã¯ã¾ã£ãã®ã§ãã¡ã¢å ¼ãã¦èª¿ã¹ã¦ã¿ã¾ããã
æºå¸¯ãµã¤ãã§ç©ºã¡ã¼ã«ãåãåãã¨ããã®ã¯ãã¢ããªãä½ãä¸ã§ããããæ段ã ã¨æãã¾ãã
ã¦ã¼ã¶ã«ã¡ã¼ã«ã¢ãã¬ã¹ãæå
¥åãã¦ãããæéãé²ãã¨ããçç±ä»¥å¤ã«ã確å®ã«æå¹ãªã¢ãã¬ã¹ãç»é²ãã¦ããããã¨ããå©ç¹ãããããã§ãã
ã¾ããç»åæ稿ã«ã¤ãã¦ããä¸é¨ã®docomoã®æ°ãã端æ«ãªã©ãé¤ãããã©ã¦ã¶ããã¯æ稿ãåºæ¥ãªãã®ã§ãã¡ã¼ã«ã«æ·»ä»ããã¦ãããã¨ããã®ã¯ããããæã§ãã
ãããã®å ´åã«ãéä¿¡å
ãã¡ã¼ã«ã¢ãã¬ã¹ãè¤æ°ç¨æããªããã°ãªããªãå ´åã«åºãããã¾ãã
ãããªå ´åã«ä½¿ãã®ãæ¡å¼µã¢ãã¬ã¹ã§ãã
user-ext@example.com
user+ext@example.com
user-ãuser+ 以éã¯èªç±ã«ãªã«ãæå®ããã¦ãåãåãã¨ããä»çµã¿ã§ãã
gmailã§ã¯+(ãã©ã¹è¨å·)ãå®éã«ä½¿ããã¨ãã§ãã¾ãã
ãã¡ã§ã¯ããã¨ãã¨qmailã使ç¨ãã¦ããã¨ããçç±ãããæ¡å¼µã¢ãã¬ã¹ã®åºåãè¨å·ã¯ãã¤ãã³ã使ç¨ãã¦ãã¾ããã
ãã®å¾ãMTAãpostfixã«åãæ¿ããæãããã®è¨å®ãå¼ãç¶ããæ¡å¼µã¢ãã¬ã¹ã®åºåãè¨å·ã¯ãã¤ãã³ã§éãã¦ãã¾ããã
ä»åãã¨ããæ¡ä»¶ãæ§ç¯ããã®ã§ããããµã¼ãç°å¢å´ã®é½åã§ãMTAã«sendmailã使ç¨ãããã¨ã«ãªããåºæ¥ãã ãåæè¨å®ã®ã¾ã¾ã¨ãããã¨ã§ãæ¡å¼µã¢ãã¬ã¹ã®åºåãè¨å·ããã©ã¹è¨å·ã«ãªããã¨ã«ãªãã¾ããã
ã¾ããgmailã§ããã£ã¦ãã大ä¸å¤«ã ãããæãã°ãã®å¤æã大ããªèª¤ãã§ããã
ã¯ã¾ã£ãã¯ã¾ã£ããã¯ã¾ãã¾ããã¾ããã
ãã©ã¹è¨å·ã使ããªãau
çµè«ããè¨ãã¨ããã©ã¹è¨å·ã ã¨au端æ«ã§ç©ºã¡ã¼ã«ãhtmlã®mailtoã使ãã¨ãæ®éã®æ¹æ³ã§ã¯ã§ãã¾ããã
ç°¡åãªhtmlãä½ã£ã¦ã¿ã¾ãã
<html> <head> </head> <body> <a href="mailto:[email protected]">[email protected]</a><br /> <br /> <a href="mailto:user%[email protected]">user%[email protected]</a><br /> </body> </html>
ãã¿ã¼ã³1ã¯ããã©ã¹è¨å·ããã®ã¾ã¾æ¸ãããã¿ã¼ã³ã
ãã¿ã¼ã³2ã¯ããã©ã¹è¨å·ãurlencodeããã%2Bããæ¸ãããã¿ã¼ã³ã
ã©ããªãã¨æãã¾ããï¼ã¡ãªã¿ã«ãæ¤è¨¼ããéãã§ã¯ãdocomoãsoftbankãwillcom(WX330K)ã§ã¯ãã©ã¡ãã§ãæ£å¸¸ã«åãã¾ããã
çµæ
ãã¿ã¼ã³1ãéãã¨ããã©ã¹è¨å·ã空ç½ã«ãªã£ã¦ãã¾ã端æ«ãããã¾ããã¤ã¾ããã¡ã¼ã©ã¼ã¯éãã®ã§ãããå®å
ã®ä¸èº«ã
ãuser ext@example.comãã«ãªã£ã¦ãã¾ã£ã¦ãã¾ãã
ãã®ã¾ã¾éä¿¡ãããã¨ãã¦ãã端æ«ã®ã¡ã¼ã©ã¼å´ã®ã¨ã©ã¼ãçºçãã¦ãã¾ãã¾ãã
ãã¿ã¼ã³2ãéãã¨ãurlencodeãã¦ããæåãã¡ããã¨ãã©ã¹è¨å·ã¨ãã¦èªèããã¦éã端æ«ãããã¾ãããéã«urlencodeãã¦ããæåã®ã¾ã¾ã¡ã¼ã«ä½æç»é¢ãéãã¦ãã¾ã端æ«ãããã¾ããå½ç¶ããã®ã¾ã¾éä¿¡ãã¦ãå®å
ä¸æã§ãµã¼ãå´ã§åãåããã¨ãã§ãã¾ããã
- ãã¿ã¼ã³1ï¼[email protected]ï¼
- ãã¿ã¼ã³2ï¼user%2Bext@example.comï¼
ãã®è¨äºãæ¸ã段éã§ãã¹ãã«ä½¿ç¨ã§ããææ°ã®ç«¯æ«ãå°ãªãã£ãã®ã§ãããå®æ¡ä»¶ã§æ¤è¨¼ããç¯å²ã§ã¯ãææ°ã®ä¸ä»£ã§ã¯ãã©ã¹è¨å·ãã®ã¾ã¾ã§åãããæ§ä¸ä»£ã¯urlencodeããªãã¨ãã¡ã¿ããã§ããã
ã©ããã§ä»æ§ãå¤æ´ããã®ã¯æç½ã§ãããæ¢ããç¯å²ã§ã¯ãã©ãã«ãæ
å ±ãããã¾ããã
解決æ¹æ³
sendmailã§æ¡å¼µã¢ãã¬ã¹ã®ããªãã¿ãå¤æ´ããæ¹æ³ãããããã調æ»ãç¶è¡ãããã¨ããMTAãpostfixçã«ãã¾ããåãæ¿ããããã«ããããããã
Win系以åã¯æ§å¼ãæ°å½¢å¼ã¯æ°ä¸ä»£ã ã¨ããããããã®ã§ãããK002ã¨ããå¾®å¦ãªæãã§ãã
ãããããããã¹ããç¹°ãè¿ãã¦ããã¨ãããããæ³åãçºè¦ãã¾ããã
UserAgent
ãã¼ãã¿ãã¨UserAgentã®è¦åãå¤ãã£ã¦ãã¾ãï¼
http://www.au.kddi.com/ezfactory/tec/spec/4_4.html
KDDIã®ä»æ§ã«ããã¨ããã©ã¦ã¶ãã¼ã¸ã§ã³ããããé¨åãå¤ãã£ã¦ãã¾ãã
- 6.2.0.3.111
- 6.2.0.7.3.129
- 6.2.0.9
- 6.2.0.10.4
- 6.2.0.15.1.1
- 6.2_7.2.7.1.K.1.5.1.120ããï¼åºåããã¢ã³ãã¼ãã¼ã«ãªã£ã¦ã
- 6.2_7.2.7.1.K.3.341ããï¼åºåããã¢ã³ãã¼ãã¼ã«ãªã£ã¦ã
対ç
ãã©ã¦ã¶ãã¼ã¸ã§ã³ã \d.\d. (æ°åï¼ãããï¼æ°åï¼ãããï¼ã®å ´åã ãurlencodeãã¦ãããããã«ãã¾ããã
ãã¡ã§ã¯ãEthna+Smartyãªã®ã§ããã¼ããããã©ããããã£ãªã¢ãã°ã㯠smartyã®ãã©ã°ã¤ã³ã§åé¿ãã¾ããã
<?php /** * Smartyä¿®æ£åã©ã°ã¤ã³ */ /** * mailto㧠auæ§ç«¯æ«ã§ä½¿ããªããã©ã¹è¨å·ãã¨ã¹ã±ã¼ããã * * <pre> * ex.) * * </pre> */ function smarty_modifier_mailtoescape($string) { if (strlen($string)) { // + ãã¨ã¹ã±ã¼ãããUA // KDDI-KC33 UP.Browser/6.2.0.9 // KDDI-KC3O UP.Browser/6.2.0.15.1.1 // ãã®ã¾ã¾ã§OKãªUA // KDDI-SH3K UP.Browser/6.2_7.2.7.1.K.5.205 // KDDI-TS3I UP.Browser/6.2_7.2.7.1.K.1.5.1.120 // 6.2ã®å¾ãããããã®ã¿ç½®æ if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match('!^KDDI-[^ ]+ UP\.Browser/6\.2\.!', $_SERVER['HTTP_USER_AGENT'])) { $string = str_replace('+', '%2B', $string); } } return $string; }
使ãæ¹
<html> <head> </head> <body> <a href="mailto:{'[email protected]'|mailtoescape}">[email protected]</a><br /> </body> </html>
ã¾ã¨ã
auãããä»æ§å¤ãããªãè¨ã£ã¦ãã ãããå¤ããã¨ãã¦ãå¾æ¹äºææ§ãå¤å°ã¯æ°ã«ãã¦ãã ããã
ä»åã®ä»¶ã§è¨ãã°ãdocomoãsoftbankã¨åãããã«ããã©ã¹è¨å·ç´æ¸ãã§ããurlencodeããã%2Bãã§ãåãããã«ãã¦ããããã°ããã 話ã ã¨æãã®ã¯ãèããæµ
ãã ãã§ããããï¼
ã¨ããããã§ãauã®æ°ããä¸ä»£ãåºãåã«ä½ã£ããµã¤ãã§ã空ã¡ã¼ã«ã¢ãã¬ã¹ã«æ¡å¼µã¢ãã¬ã¹ã使ããurlencodeãã¦ãããµã¤ãã¯ãæ°ç«¯æ«ã§åãã¦ããªãããããã¾ããã
éã«ãauã®æ°ä¸ä»£ã§ã ãåä½ç¢ºèªããã¦ããã¨ãæ§ç«¯æ«ã§åãã¦ããªãããããã¾ããã
æåã®æã¯ãpostfixã«ãã¦ãããªãã¿ã¯ãã¤ãã³ã«ãããã¨ã ã¨æãã¾ãã
sendmailã¯ãä»ã«ãéä¿¡å
æ
å ±çãphpã§åããæã«ç°å¢å¤æ°ã§åå¾ãã§ããªãã£ããããã®ã§ã次åããã¯postfixã«çµ¶å¯¾ãã¦ããããã¨æãã¾ãã