ä¸ã¤ã®postfixã§è¤æ°ã®ãã¡ã¤ã³ã®ã¡ã¼ã«ãå¦çããã¨ãã®è¨å®
postfixã®è¨å®ãæªã ã«è¯ãåãããªãã£ãã®ã§ãå 輩ã«èãã¾ããããã£ã¨ç解ãããã¨ãã¡ã¢ãã¾ãã
åæç¥è
â /etc/postfix/virtual ä¸ã¤ã®postfixã§è¤æ°ã®ãã¡ã¤ã³ã®ã¡ã¼ã«ãåãåãã¨ãã«ä½¿ç¨ããããã¡ã¤ã³ãã¨ã«ãã©ã®ã¦ã¼ã¶ã¼ã§å¦çãããè¨è¿°ããã â /etc/aliases ã¦ã¼ã¶ã¼ãã¨ã«å¦çãè¨è¿°ããã
è¨å®æ¦è¦
(1)/etc/postfix/virtualã«ã©ã®ãã¡ã¤ã³ã§ãããã©ã®ã¦ã¼ã¶ã¼ã¨ãã¦å¦çãããæ¸ãè¾¼ã (2)/etc/aliasesã«ãåã¦ã¼ã¶ã¼ã¯ã©ããªå¦çããããæ¸ãè¾¼ã (3)aliasesã®åæ ã¨postfixã®åèµ·å
è¨å®è©³ç´°
(1)/etc/postfix/virtualã«ä»¥ä¸ãæ¸ãè¾¼ã¿ã¾ããããæ¸ãè¾¼ãã¨ããã¯ãã¡ã¤ã«ã®ä¸çªä¸ã§å¤§ä¸å¤«ã§ãããã¡ã¤ã«ã¯vimã§éãã¦å¤§ä¸å¤«ã§ããã
#midori-mobile.jp midori-mobile.jp anything @midori-mobile.jp midori_catch_all
/etc/postfix/virtualã¯ãã¡ã¼ã«ãpostfixãåãåã£ãã¨ãã«ãèªåãé ä¿¡ãæ å½ãã¦ãããã¡ã¤ã³ã確èªãããã¡ã¤ã«ã§ããéããã¦ããã¡ã¼ã«ã®ãã¡ã¤ã³ããããã«æ¸ãã¦ãããã¡ã¤ã³ã¨ä¸è´ããã°ãpostfixã¯éããã¦ããã¡ã¼ã«ãèªåèªèº«ã«åãã¦å度転éãã¾ãã
ä¸è¨ã®ä¾ã®å ´åãmidori-midori.jpã¨ãããã¡ã¤ã³ã§ã¡ã¼ã«ãéããã¦ããããèªåèªèº«ã®midori_catch_allã«åãã¦éããã¦ããã¡ã¼ã«ãåéä¿¡ãã¾ãã
(2)/etc/aliasesã«ä»¥ä¸ãæ¸ãè¾¼ã¿ã¾ããããæ¸ãè¾¼ãã¨ããã¯ãã¡ã¤ã«ã®ä¸çªä¸ã§å¤§ä¸å¤«ã§ãããã¡ã¤ã«ã¯vimã§éãã¦å¤§ä¸å¤«ã§ããã
#midori midori_catch_all: "|touch /tmp/midori.html"
ã¡ã¼ã«ãèªåèªèº«ã«å度転éãããããpostfixã¯/etc/aliasesãè¦ã¦ãããã«midori_catch_all(ã¡ã¼ã«ã®éãå )ãããã°""ã§æ¸ãããé¨åã®å¦çãåãã¾ãã
ä¸è¨ã®ä¾ã®å ´åãmidori_catch_allã«éããã¦ããã¡ã¼ã«ã¯ã""ã«æ¸ããã¦ããå¦çãæ½ãã¾ãããã®å ´åã/tmpã®é ä¸ã«midori.htmlãã§ãã¾ãã
(3)å¤æ´ããaliasesã®åæ ã¨postfixã®åèµ·åãè¡ã(å ±ã«ç®¡çè 権éã§)
â aliasesã®åæ shell> newaliases â postfixã®åèµ·å shell> service postfix restart
(åè)å®éã«ã¡ã¼ã«ãåãåãã¦ããããã°ãã¼ã¹ã§è¦ã¦ã¿ã¾ãããã
tail -f /var/log/ServerLogs/maillog
ä¸è¨ã³ãã³ããå®è¡ãã¦ãã¡ã¼ã©ã¼ããè¨å®ãããã¡ã¤ã³ã«ã¡ã¼ã«ãéã£ã¦ã¿ã¾ãããã