¤³¤Î¥É¥¥å¥á¥ó¥È¤Ïŵ·¿Åª¤Ê Postfix ÀßÄê¤ò¤¤¤¯¤Ä¤«¼¨¤·¤Æ¤¤¤Þ¤¹¡£ BASIC_CONFIGURATION_README ¥É¥¥å¥á¥ó¥È¤Ë½ñ¤«¤ì¤Æ¤¤¤ë´ðËÜŪ¤ÊÀßÄê¤Î¥¹¥Æ¥Ã¥×¤Ë½¾¤Ã¤¿¸å¤Ç¤³¤Î ¥É¥¥å¥á¥ó¥È¤ò¸«Ä¾¤¹¤Ù¤¤Ç¤¹¡£ÆÃ¤Ë Postfix ¤Ç¥í¡¼¥«¥ë¥á¡¼¥ë¤ÎÅêÈ¡¤ä ¥í¡¼¥«¥ë¥á¡¼¥ëÇÛÁ÷¤ò¤ä¤Ã¤¿¤³¤È¤¬¤Ê¤±¤ì¤Ð¡¢Æɤ߿ʤá¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£
¤³¤Î¥É¥¥å¥á¥ó¥È¤ÎºÇ½é¤ÎÉôʬ¤Ç¤Ï¡¢¤¢¤ëÆÃÄê¤ÎÌäÂê¤ò¤½¤ì¤¾¤ì1¤Ä¤º¤Ä ²ò·è¤¹¤ëɸ½àÀßÄê¤ò¼¨¤·¤Þ¤¹¡£
¤³¤Î¥É¥¥å¥á¥ó¥È¤Î2ÈÖÌܤÎÉôʬ¤Ç¤Ï¡¢ÆÃÄê´Ä¶¤Î¥Û¥¹¥È¤Ç¤ÎÄɲÃÀßÄê¤ò ¼¨¤·¤Þ¤¹¡£
Postfix ¤ÏľÀÜ¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Ë¥¢¥¯¥»¥¹¤¹¤ë¥¹¥¿¥ó¥É¥¢¥í¥ó¥Þ¥·¥ó¤Ç¤Ï¡¢ Êѹ¹¤Ê¤·¤Ë¤½¤Î¤Þ¤ÞÆ°¤¯¤Ï¤º¤Ç¤¹¡£¾¯¤Ê¤¯¤È¤â¡¢ http://www.postfix.org/ ¤«¤é ¥½¡¼¥¹¥³¡¼¥É¤ò¥À¥¦¥ó¥í¡¼¥É¤·¤Æ¤¤¿¾ì¹ç¤Î Postfix ¤Î¥¤¥ó¥¹¥È¡¼¥ë¤Ï ¤½¤Î¤Þ¤Þ¤ÇÆ°¤¯¤Ï¤º¤Ç¤¹¡£
main.cf ¤Ç¾å½ñ¤¤µ¤ì¤¿ÀßÄê¤òÃΤë¤Ë¤Ï¡¢"postconf -n" ¥³¥Þ¥ó¥É¤¬»È¤¨¤Þ¤¹¡£ ¥¹¥¿¥ó¥É¥¢¥í¥ó¥Ü¥Ã¥¯¥¹¤Ç¤Ï¤¤¤¯¤Ä¤«¤Î¥Ñ¥¹Ì¾¤ÎÀßÄê¤ò½ü¤¡¢ BASIC_CONFIGURATION_README ¥É¥¥å¥á¥ó¥È¤Ç¥«¥Ð¡¼¤·¤Æ¤¤¤ë¤â¤Î¤Ë²Ã¤¨¤Æ¤µ¤é¤Ë¤¤¤¯¤Ä¤«¤ÎÀßÄ꤬ɬÍפǤ¹:
/etc/postfix/main.cf: # ¥ª¥×¥·¥ç¥ó: user@hostname ¤Ç¤Ï¤Ê¤¯ user@domainname ¤È¤·¤Æ¥á¡¼¥ë¤ò # Á÷¤ê¤Þ¤¹¡£ #myorigin = $mydomain # ¥ª¥×¥·¥ç¥ó: NAT/¥×¥í¥¥·³°Éô¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤Þ¤¹¡£ #proxy_interfaces = 1.2.3.4 # ¾¤Î¥Û¥¹¥È¤«¤é¤Î¥á¡¼¥ë¤òÃæ·Ñ¤·¤Þ¤»¤ó¡£ mynetworks_style = host relay_domains =
ÀßÄ꤬ "¼ÂºÝ¤Î¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥Û¥¹¥È̾¤ò»ý¤¿¤Ê¤¤¥Û¥¹¥È¤Ç¤Î Postfix" ¥»¥¯¥·¥ç¥ó¤ËÅö¤Æ¤Ï¤Þ¤ë¤Î¤Ç¤¢¤ì¤Ð¡¢¤½¤Î¥»¥¯¥·¥ç¥ó¤â»²¾È¤·¤Æ ¤¯¤À¤µ¤¤¡£
Null ¥¯¥é¥¤¥¢¥ó¥È¤È¤¤¤¦¤Î¤Ï¡¢¥á¡¼¥ë¤ÎÁ÷¿®¤À¤±¤¬¤Ç¤¤ë¥Þ¥·¥ó¤Î¤³¤È¤Ç¤¹¡£ ¥Í¥Ã¥È¥ï¡¼¥¯¤«¤é¤Ï¥á¡¼¥ë¤ò¼õ¤±¼è¤é¤º¡¢¥í¡¼¥«¥ë¤Ø¤Î¥á¡¼¥ëÇÛÁ÷¤â¤·¤Þ¤»¤ó¡£ null ¥¯¥é¥¤¥¢¥ó¥È¤Ï¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¤Ø¤Î¥¢¥¯¥»¥¹¤Ë¤Ï¤¿¤¤¤Æ¤¤ POP ¤ä IMAP¡¢ NFS ¤ò»È¤¤¤Þ¤¹¡£
¤³¤ÎÎã¤Ç¤Ï¡¢¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥É¥á¥¤¥ó̾¤Ï "example.com"¡¢¥Þ¥·¥ó̾¤Ï "nullclient.example.com" ¤Ç¤¢¤ë¤È¤·¤Þ¤¹¡£¤¤¤Ä¤âÄ̤ꡢÎã¤Ë¤Ï¥Ç¥Õ¥©¥ë¥È¤«¤é Êѹ¹¤¹¤ë¥Ñ¥é¥á¡¼¥¿¤Î¤ß¤ò¼¨¤·¤Þ¤¹¡£
1 /etc/postfix/main.cf: 2 myorigin = $mydomain 3 relayhost = $mydomain 4 inet_interfaces = 127.0.0.1 5 local_transport = error:local delivery is disabled 6 7 /etc/postfix/master.cf: 8 Comment out the local delivery agent entry
ËÝÌõ:
2¹ÔÌÜ: ("user@nullclient.example.com" ¤Ç¤Ï¤Ê¤¯) "user@example.com" ¤È¤·¤Æ¥á¡¼¥ë¤òÁ÷¤ê¡¢"user@nullclient.example.com" ¤Ë¥á¡¼¥ë¤¬Á÷¤é¤ì¤Ê¤¤¤è¤¦¤Ë ¤·¤Þ¤¹¡£
3¹ÔÌÜ: ¥á¡¼¥ë¤ò¤¹¤Ù¤Æ "example.com" ¥É¥á¥¤¥ó¤òôÅö¤·¤Æ¤¤¤ë ¥á¡¼¥ë¥µ¡¼¥Ð¤ËžÁ÷¤·¤Þ¤¹¡£¤³¤ì¤Ë¤è¤ê¥ê¥â¡¼¥È¤ÎÇÛÁ÷Àè¤ËÅþã¤Ç¤¤Ê¤¤´Ö¤Ë null ¥µ¡¼¥Ð¤ÎÅŸ»¤¬ÀÚ¤é¤ì¤Æ¤â¡¢¥á¡¼¥ë¤¬ null ¥µ¡¼¥Ð¤Ë»ß¤Þ¤Ã¤¿¤Þ¤Þ¤Ë ¤Ê¤é¤Ê¤¤¤è¤¦¤Ë¤·¤Þ¤¹¡£
4¹ÔÌÜ: ¥Í¥Ã¥È¥ï¡¼¥¯¤«¤é¤Î¥á¡¼¥ë¤ò¼õ¤±ÉÕ¤±¤Þ¤»¤ó¡£
5-8¹ÔÌÜ: ¥í¡¼¥«¥ë¥á¡¼¥ëÇÛÁ÷¤ò̵¸ú¤Ë¤·¤Þ¤¹¡£¥á¡¼¥ë¤Ï¤¹¤Ù¤Æ3¹ÔÌÜ¤Ç »ØÄꤵ¤ì¤¿¥á¡¼¥ë¥µ¡¼¥Ð¤Ë¹Ô¤¤Þ¤¹¡£
¤³¤Î¥»¥¯¥·¥ç¥ó¤Ë¤Ï1¤Ä¤Î¥á¡¼¥ë¥µ¡¼¥Ð¤È¥á¡¼¥ë¤òÁ÷¼õ¿®¤¹¤ëÊ£¿ô¤Î¾¤Î ¥·¥¹¥Æ¥à¤¬¤¢¤ë¥í¡¼¥«¥ë¥¨¥ê¥¢¥Í¥Ã¥È¥ï¡¼¥¯´Ä¶¤Ë¤Ä¤¤¤Æ½ñ¤«¤ì¤Æ¤¤¤Þ¤¹¡£ ¤¤¤Ä¤âÄ̤ꥤ¥ó¥¿¡¼¥Í¥Ã¥È¥É¥á¥¤¥ó̾¤Ï "example.com" ¤È¤·¤Þ¤¹¡£¥·¥¹¥Æ¥à¤Ï ¤¹¤Ù¤Æ "user@example.com" ¤È¤·¤Æ¥á¡¼¥ë¤òÁ÷¤ë¤è¤¦¤ËÀßÄꤵ¤ì¡¢ "user@hostname.example.com" °¸¤Î¥á¡¼¥ë¤ò¼õ¤±¼è¤ê¤Þ¤¹¡£¥á¥¤¥ó¥µ¡¼¥Ð¤Ï "user@example.com" °¸¤Î¥á¡¼¥ë¤â¼õ¤±¼è¤ê¤Þ¤¹¡£¤³¤Î¥Þ¥·¥ó¤ò mailhost.example.com ¤È¤¤¤¦Ì¾Á°¤Ç¸Æ¤Ö¤³¤È¤Ë¤·¤Þ¤¹¡£
"user@example.com" ¤È¤·¤Æ¥á¡¼¥ë¤òÁ÷¤ë¤³¤È¤ÎÌäÂêÅÀ¤Ï¡¢"root" ¤ä¾¤Î ¥·¥¹¥Æ¥à¥¢¥«¥¦¥ó¥È°¸¤Î¥á¡¼¥ë¤âÃæ¿´¤È¤Ê¤ë mailhost ¤ËÁ÷¤é¤ì¤Æ¤·¤Þ¤¦ ¤³¤È¤Ç¤¹¡£¤³¤ì¤ò²ò·è¤¹¤ë¤Ë¤Ï¡¢°Ê²¼¤Î "¤¹¤Ù¤Æ¤Ç¤Ï¤Ê¤¯ °ìÉô¤Î¥¢¥«¥¦¥ó¥È¤ò¥í¡¼¥«¥ë¤ËÇÛÁ÷¤¹¤ë" ¥»¥¯¥·¥ç¥ó¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
¤¤¤Ä¤âÄ̤ꡢÎã¤Ë¤Ï¥Ç¥Õ¥©¥ë¥È¤«¤éÊѹ¹¤¹¤ë¥Ñ¥é¥á¡¼¥¿¤Î¤ß¤ò¼¨¤·¤Þ¤¹¡£
¤Þ¤º¤Ï mailhost °Ê³°¤ÎÀßÄê¤ò¼¨¤·¤Þ¤¹¤¬¡¢¤½¤ì¤Ï¤½¤ÎÀßÄê¤ÎÊý¤¬¥·¥ó¥×¥ë ¤À¤«¤é¤Ç¤¹¡£¤³¤Î¥Þ¥·¥ó¤Ï "user@example.com" ¤È¤·¤Æ¥á¡¼¥ë¤òÁ÷¤ê¡¢ "user@hostname.example.com" °¸¤ÎºÇ½ªÇÛÁ÷Àè¤È¤Ê¤ê¤Þ¤¹¡£
1 /etc/postfix/main.cf: 2 myorigin = $mydomain 3 mynetworks = 127.0.0.0/8 10.0.0.0/24 4 relay_domains = 5 # Optional: forward all non-local mail to mailhost 6 #relayhost = $mydomain
ËÝÌõ:
2¹ÔÌÜ: "user@example.com" ¤È¤·¤Æ¥á¡¼¥ë¤òÁ÷¤ê¤Þ¤¹¡£
3¹ÔÌÜ: ¿®Íꤹ¤ë¥Í¥Ã¥È¥ï¡¼¥¯¤ò»ØÄꤷ¤Þ¤¹¡£
4¹ÔÌÜ: ¤³¤Î¥Û¥¹¥È¤Ï¿®Íꤷ¤Ê¤¤¥Í¥Ã¥È¥ï¡¼¥¯¤«¤é¤Î¥á¡¼¥ë¤ò¥ê¥ì¡¼ ¤·¤Þ¤»¤ó¡£
6¹ÔÌÜ: ¤³¤ì¤ÏľÀÜ¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Ë¥¢¥¯¥»¥¹¤Ç¤¤Ê¤¤¾ì¹ç¤ËɬÍפǤ¹¡£ °Ê²¼¤Î "¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤ÎÇظå¤ÇÆ°¤¯ Postfix" ¤â »²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
¼¡¤Ë mailhost ¤ÎÀßÄê¤ò¼¨¤·¤Þ¤¹¡£¤³¤Î¥Þ¥·¥ó¤Ï¥á¡¼¥ë¤ò "user@example.com" ¤È¤·¤ÆÁ÷¤ê¡¢"user@example.com" ¤Ë²Ã¤¨¤Æ "user@hostname.example.com" °¸¤Î ºÇ½ªÇÛÁ÷Àè¤È¤Ê¤ê¤Þ¤¹¡£
1 DNS: 2 example.com IN MX 10 mailhost.example.com. 3 4 /etc/postfix/main.cf: 5 myorigin = $mydomain 6 mydestination = $myhostname localhost.$mydomain localhost $mydomain 7 mynetworks = 127.0.0.0/8 10.0.0.0/24 8 relay_domains = 9 # Optional: forward all non-local mail to firewall 10 #relayhost = [firewall.example.com]
ËÝÌõ:
2¹ÔÌÜ: ¥É¥á¥¤¥ó "example.com" °¸¤Î¥á¡¼¥ë¤ò mailhost.example.com ¤Ë Á÷¤ê¤Þ¤¹¡£¹ÔËö¤Î "." ¤ò˺¤ì¤º¤ËÉÕ¤±¤Æ¤¯¤À¤µ¤¤¡£
5¹ÔÌÜ: "user@example.com" ¤È¤·¤Æ¥á¡¼¥ë¤òÁ÷¤ê¤Þ¤¹¡£
6¹ÔÌÜ: ¤³¤Î¥Û¥¹¥È¤Ï ¥Þ¥·¥ó¼«¿È¤Î̾Á°¤Ë²Ã¤¨¤Æ "example.com" ¥É¥á¥¤¥ó°¸¤ÎºÇ½ªÇÛÁ÷Àè¤È¤Ê¤ê¤Þ¤¹¡£
7¹ÔÌÜ: ¿®Íꤹ¤ë¥Í¥Ã¥È¥ï¡¼¥¯¤ò»ØÄꤷ¤Þ¤¹¡£
8¹ÔÌÜ: ¤³¤Î¥Û¥¹¥È¤Ï¿®Íꤷ¤Ê¤¤¥Í¥Ã¥È¥ï¡¼¥¯¤«¤é¤Î¥á¡¼¥ë¤ò¥ê¥ì¡¼ ¤·¤Þ¤»¤ó¡£
10¹ÔÌÜ: ¤³¤ì¤Ï mailhost ¤¬Èó¥í¡¼¥«¥ë¥á¡¼¥ë¤ò¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¾å¤Î ¥á¡¼¥ë¥µ¡¼¥Ð¤ò»È¤Ã¤ÆžÁ÷¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¾ì¹ç¤ËɬÍפǤ¹¡£ [] ¤Ë¤è¤Ã¤Æ Postfix ¤¬ MX ¥ì¥³¡¼¥É¸¡º÷¤¹¤ë¤Î¤ò¶Ø»ß¤·¤Þ¤¹¡£
¤³¤Î¤è¤¦¤Ê´Ä¶¤Ç¤Ï¡¢¥æ¡¼¥¶¤Ï¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¤Ë°Ê²¼¤Î1¤Ä°Ê¾å¤ÎÊýË¡¤Ç ¥¢¥¯¥»¥¹¤·¤Þ¤¹:
NFS ¤â¤·¤¯¤Ï¤½¤ì¤ËÁêÅö¤¹¤ë¤â¤Î¤ò»È¤Ã¤Æ¤Î¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¥¢¥¯¥»¥¹¡£
POP ¤ä IMAP ¤ò»È¤Ã¤Æ¤Î¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¥¢¥¯¥»¥¹¡£
¥æ¡¼¥¶¤Î¹¥¤ß¤Î¥Þ¥·¥ó¾å¤Î¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¡£
ºÇ¸å¤Î¾ì¹ç¡¢¥æ¡¼¥¶¤Ë¤Ï¤½¤ì¤¾¤ì mailhost ¾å¤Ë¹¥¤ß¤Î¥Þ¥·¥ó¤Ë¥á¡¼¥ë¤ò žÁ÷¤¹¤ë¥¨¥¤¥ê¥¢¥¹¤ò»ý¤¿¤»¤Þ¤¹:
/etc/aliases: joe: joe@joes.preferred.machine jane: jane@janes.preferred.machine
¥¨¥¤¥ê¥¢¥¹¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬ /etc/aliases ¤Ë¤Ê¤¤¥·¥¹¥Æ¥à¤â¤¢¤ê¤Þ¤¹¡£ ¤¢¤Ê¤¿¤Î¥·¥¹¥Æ¥à¾å¤Ç¤Î¾ì½ê¤òÃΤë¤Ë¤Ï¡¢"postconf alias_maps" ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Æ ¤¯¤À¤µ¤¤¡£
aliases ¥Õ¥¡¥¤¥ë¤òÊѹ¹¤¹¤ë¤¿¤Ó¤Ë¥Þ¥ó¥É "newaliases" ¤ò¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£
¹Í¤¨Êý¤Ï "example.com" °¸¤Î¥á¡¼¥ë¤òÆâÉô¤Î¥²¡¼¥È¥¦¥§¥¤¥Þ¥·¥ó¤ËžÁ÷ ¤¹¤ë¤¬¡¢"anything.example.com" °¸¤Î¥á¡¼¥ë¤òµñÈݤ¹¤ë Postfix E¥á¡¼¥ë ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë/¥²¡¼¥È¥¦¥§¥¤¤ò¹½ÃÛ¤¹¤ë¤È¤¤¤¦¤â¤Î¤Ç¤¹¡£1¤ÄÌäÂ꤬¤¢¤ê¤Þ¤¹¡£ "relay_domains = example.com" ¤È¤¹¤ë¤È¡¢¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤ÏÄ̾ï "anything.example.com" °¸¤Î¥á¡¼¥ë¤â ¼õ¤±¼è¤Ã¤Æ¤·¤Þ¤¤¤Þ¤¹¡£¤³¤ì¤ÏÀµ¤·¤¯¤¢¤ê¤Þ¤»¤ó¡£
Ãí°Õ: ¤³¤ÎÎã¤Ë¤Ï Postfix ¥Ð¡¼¥¸¥ç¥ó 2.0 °Ê¹ß¤¬É¬ÍפǤ¹¡£»È¤Ã¤Æ¤¤¤ë Postfix ¤Î¥Ð¡¼¥¸¥ç¥ó¤òÃΤë¤Ë¤Ï¡¢¥³¥Þ¥ó¥É "postconf mail_version" ¤ò¼Â¹Ô¤·¤Þ¤¹¡£
²òË¡¤Ï¤¤¤¯¤Ä¤«¤ÎÉôʬ¤Ëʬ¤±¤Æ¼¨¤µ¤ì¤Þ¤¹¡£¤³¤ÎºÇ½é¤ÎÉôʬ¤Ç¤Ï¥Õ¥¡¥¤¥¢ ¥¦¥©¡¼¥ë¾å¤Ç¤Î¥í¡¼¥«¥ë¥á¡¼¥ëÇÛÁ÷¤ò¼è¤ê½ü¤¡¢¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤ò²õ¤ì¤Ë¤¯¤¯ ¤·¤Þ¤¹¡£
1 /etc/postfix/main.cf: 2 myorigin = example.com 3 mydestination = 4 local_recipient_maps = 5 local_transport = error:local mail delivery is disabled 6 7 /etc/postfix/master.cf: 8 Comment out the local delivery agent
ËÝÌõ:
2¹ÔÌÜ: ¤³¤Î¥Þ¥·¥ó¤«¤é¤Ï¥á¡¼¥ë¤ò "user@example.com" ¤È¤·¤ÆÁ÷¤ê¡¢ "user@firewall.example.com" °¸¤Ë¥á¡¼¥ë¤òÁ÷¤ëÍýͳ¤ò¤Ê¤¯¤·¤Þ¤¹¡£
3-8¹ÔÌÜ: ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¥Þ¥·¥ó¾å¤Ç¤Î¥í¡¼¥«¥ë¥á¡¼¥ëÇÛÁ÷¤ò̵¸ú¤Ë ¤·¤Þ¤¹¡£
µ»½ÑŪ¤ËÀµ¤·¤¯¤¹¤ë¤¿¤á¡¢¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤Ï postmaster@[firewall ip address] °¸¤Î¥á¡¼¥ë¤ò¼õ¤±¼è¤ì¤ë¤è¤¦¤Ë¤·¤Ê¤±¤ì¤Ð¤¤¤±¤Þ¤»¤ó¡£Êó¹ð¤Ë¤è¤ë¤È¡¢ ¤³¤Îµ¡Ç½¤¬Â¸ºß¤¹¤ë¤³¤È¤òÁÛÄꤷ¤Æ¤¤¤ë¤â¤Î¤¬¤¢¤ê¤Þ¤¹¡£¤½¤Î¤¿¤á²òË¡¤Î 2ÈÖÌܤÎÉôʬ¤Ç¤Ï¡¢ postmaster@[firewall ip address] ¤Î¥µ¥Ý¡¼¥È¤ò²Ã¤¨¡¢ ¤ª¤Þ¤±¤Ë abuse@[firewall ip address] ¤âƱÍͤ˲䨤ޤ¹¡£¤³¤ì¤é2¤Ä¤Î ¥¢¥«¥¦¥ó¥È°¸¤Î¥á¡¼¥ë¤ÏÆâÉô¥¢¥É¥ì¥¹¤ËžÁ÷¤µ¤ì¤Þ¤¹¡£
1 /etc/postfix/main.cf: 2 virtual_alias_maps = hash:/etc/postfix/virtual 3 4 /etc/postfix/virtual: 5 postmaster postmaster@example.com 6 abuse abuse@example.com
ËÝÌõ:
mydestination ¤¬ ¶õ¤Ê¤Î¤Ç (Á°¤ÎÎã¤ò»²¾È)¡¢$inet_interfaces ¤Þ¤¿¤Ï $proxy_interfaces ¤Ë¥Þ¥Ã¥Á¤·¤¿¥¢¥É¥ì¥¹Ê¸»úÎó¤Î¤ß¤¬¥í¡¼¥«¥ë¤È¤ß¤Ê¤µ¤ì¤Þ¤¹¡£¤½¤Î¤¿¤á¡¢ "localpart@[a.d.d.r]" ¤Ïñ¤Ë canonical(5) ¤ª¤è¤Ó virtual(5) ¤Î "localpart" ¤È¤·¤Æ ¥Þ¥Ã¥Á¤·¤Þ¤¹¡£¤³¤ì¤Ë¤è¤ê Postfix ÀßÄê¥Õ¥¡¥¤¥ë¤Ë¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤Î IP ¥¢¥É¥ì¥¹¤ò»ØÄꤹ¤ëɬÍפ¬¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£
²òË¡¤ÎºÇ¸å¤ÎÉôʬ¤ÇE¥á¡¼¥ë¤ÎžÁ÷¤ò¤ª¤³¤Ê¤¤¤Þ¤¹¤¬¡¢¤³¤ì¤¬¥Õ¥¡¥¤¥¢ ¥¦¥©¡¼¥ëE¥á¡¼¥ëµ¡Ç½¤ÎËÜÍè¤ÎÌÜŪ¤Ç¤¹¡£
1 /etc/postfix/main.cf: 2 mynetworks = 127.0.0.0/8 12.34.56.0/24 3 relay_domains = example.com 4 parent_domain_matches_subdomains = 5 debug_peer_list smtpd_access_maps 6 smtpd_recipient_restrictions = 7 permit_mynetworks reject_unauth_destination 8 9 relay_recipient_maps = hash:/etc/postfix/relay_recipients 10 transport_maps = hash:/etc/postfix/transport 11 12 /etc/postfix/relay_recipients: 13 user1@example.com x 14 user2@example.com x 15 . . . 16 17 /etc/postfix/transport: 18 example.com smtp:[inside-gateway.example.com]
ËÝÌõ:
1-7¹ÔÌÜ: $mynetworks ¤Ë ½ñ¤«¤ì¤¿¥í¡¼¥«¥ë¥·¥¹¥Æ¥à¤«¤é¤Î¥á¡¼¥ë¤ò¼õ¤±¼è¤ê¡¢¤Þ¤¿³°Éô¤«¤é "user@example.com" °¸¤Î¥á¡¼¥ë¤ò¼õ¤±¼è¤ê¤Þ¤¹¤¬¡¢"user@anything.example.com" °¸¤Î¥á¡¼¥ë¤Ï¼õ¤±¼è¤ê¤Þ¤»¤ó¡£¤³¤ÎËâË¡¤Ï4-5¹ÔÌܤˤ¢¤ê¤Þ¤¹¡£
9, 12-14¹ÔÌÜ: ¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤«¤é¥á¡¼¥ë¤ò¼õ¤±¼è¤ì¤ë "example.com" ¥É¥á¥¤¥ó¤Î¥¢¥É¥ì¥¹¤Ç͸ú¤Ê¤â¤Î¤Î¥ê¥¹¥È¤òÄêµÁ¤·¤Þ¤¹¡£¤³¤ì¤Ë¤è¤ê¥á¡¼¥ë ¥¥å¡¼¤¬ÇÛÁ÷¤Ç¤¤Ê¤¤ MAILER-DAEMON ¥á¥Ã¥»¡¼¥¸¤ÇËä¤á¿Ô¤¯¤µ¤ì¤Ê¤¤¤è¤¦¤Ë ¤·¤Þ¤¹¡£Í¸ú¤Ê¥¢¥É¥ì¥¹¤Î¥ê¥¹¥È¤ò´ÉÍý¤Ç¤¤Ê¤¤¤Î¤Ç¤¢¤ì¤Ð¡¢ "relay_recipient_maps =" (¤Ä¤Þ¤ê¶õ¤ÎÃÍ) ¤ò»ØÄꤹ¤ë¤«¡¢"@example.com x" ¥ï¥¤¥ë¥É¥«¡¼¥É¤ò relay_recipients ¥Æ¡¼¥Ö¥ë¤Ë»ØÄꤷ¤Ê¤±¤ì¤Ð¤¤¤±¤Þ¤»¤ó¡£
10, 17-18¹ÔÌÜ: "example.com" °¸¤Î¥á¡¼¥ë¤òÆâÉô¥²¡¼¥È¥¦¥§¥¤¥Þ¥·¥ó¤Ë ¸þ¤±¤Þ¤¹¡£[] ¤Ë¤è¤Ã¤Æ Postfix ¤¬ MX ¸¡º÷¤ò¤·¤Ê¤¤¤è¤¦¤Ë¤·¤Þ¤¹¡£
¤¢¤Ê¤¿¤Î¥·¥¹¥Æ¥à¤¬ db ¤ÎÂå¤ï¤ê¤Ë dbm ¥Õ¥¡¥¤¥ë¤ò»È¤¦¤Î¤Ç¤¢¤ì¤Ð¡¢hash ¤Ç¤Ï¤Ê¤¯ dbm ¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£Postfix ¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¸¡º÷¥Æ¡¼¥Ö¥ë¤Î ¼ïÎà¤òÃΤë¤Ë¤Ï¡¢¥³¥Þ¥ó¥É "postconf -m" ¤ò»È¤¤¤Þ¤¹¡£
relay_recipients ¥Æ¡¼¥Ö¥ë¤òÊѹ¹¤·¤¿¸å¤Ï "postmap /etc/postfix/relay_recipients" ¤òɬ¤º¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£
transport ¥Æ¡¼¥Ö¥ë¤òÊѹ¹¤·¤¿¸å¤Ï "postmap /etc/postfix/transport" ¤ò ɬ¤º¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£
¥¤¥ó¥¹¥È¡¼¥ëÊýË¡¤Ë¤è¤Ã¤Æ¤Ï¡¢¥Þ¥ë¥Á¥Û¡¼¥à¤Î¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¾å¤ÇÆâ¹Ô¤¤È ³°¹Ô¤¤Î¥á¡¼¥ë¤ò½èÍý¤¹¤ëÊ̤ÎPostfix¥¤¥ó¥¹¥¿¥ó¥¹¤¬¤¢¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£ Æâ¹Ô¤¤ÎPostfix¥¤¥ó¥¹¥¿¥ó¥¹¤Ë¤Ï¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤Î³°Éô¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç ÂÔ¤ÄSMTP¥µ¡¼¥Ð¤¬¤¢¤ê¡¢³°¹Ô¤¤ÎPostfix¥¤¥ó¥¹¥¿¥ó¥¹¤Ë¤ÏÆâÉô¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç ÂÔ¤ÄSMTP¥µ¡¼¥Ð¤¬¤¢¤ê¤Þ¤¹¡£¤½¤Î¤è¤¦¤ÊÀßÄê¤Ç¤Ï¡¢¤½¤ì¤¾¤ì¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë Âбþ¤¹¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥¢¥É¥ì¥¹¤Î¤ß¤ò $inet_interfaces ¤ËÀßÄꤷ¤¿¤¯¤Ê¤ë¤«¤â ¤·¤ì¤Þ¤»¤ó¡£
$inet_interfaces ¤Î¥ê¥Õ¥¡¥ì¥ó¥¹¥Þ¥Ë¥å¥¢¥ë¤Ë¤â½ñ¤«¤ì¤Æ¤¤¤ë¤è¤¦¤Ë¡¢ smtp(8) ÇÛÁ÷¥¨¡¼¥¸¥§¥ó¥È¤Ï»ØÄꤵ¤ì¤¿¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ ¥¢¥É¥ì¥¹¤ò³°¹Ô¤Àܳ¤Î¥½¡¼¥¹¥¢¥É¥ì¥¹¤È¤·¤Æ»È¤¤¡¢¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤Î "¤â¤¦°ìÊý" ¤Î¥Û¥¹¥È¤ËÅþ㤹¤ë¤³¤È¤¬¤Ç¤¤Ê¤¤¤¿¤á¡¢¤Û¤È¤ó¤É¤Î¾ì¹ç¡¢¤³¤Î¤è¤¦¤Ë inet_interfaces ¤ò»È¤Ã¤Æ¤â¤¦¤Þ¤¯ Æ°¤¤Þ¤»¤ó¡£¤½¤Î¾É¾õ¤Ï¡¢¼ÂºÝ¤Ë¤Ïµ¯¤¤Æ¤¤¤ë¥Û¥¹¥È¤ËÀܳ¤Ç¤¤Ê¤¤¤È¤¤¤¦¤â¤Î¤Ç¤¹¡£ ¿ä¾©¤µ¤ì¤ë²óÈòÊýË¡¤Ï inet_interfaces ¥Ñ¥é¥á¡¼¥¿¤Î¥É¥¥å¥á¥ó¥È¤ò»²¾È¤·¤Æ ¤¯¤À¤µ¤¤¡£
("user@hostname.example.com" ¤Ç¤Ï¤Ê¤¯) "user@example.com" ¤È¤·¤Æ ¥á¡¼¥ë¤òÁ÷¤ë¤³¤È¤ÎÌäÂê¤Ï¡¢"root" ¤ä¤½¤Î¾¤Î¥·¥¹¥Æ¥à¥¢¥«¥¦¥ó¥È°¸¤Î ¥á¡¼¥ë¤âÃæ¿´¤È¤Ê¤ë mailhost ¤ËÁ÷¤é¤ì¤Æ¤·¤Þ¤¦¤³¤È¤Ç¤¹¡£¤½¤Î¤è¤¦¤Ê ¥¢¥«¥¦¥ó¥È¤ò¥í¡¼¥«¥ë¤ËÇÛÁ÷¤¹¤ë¤Ë¤Ï¡¢¼¡¤Î¤è¤¦¤Ë virtual ¥¨¥¤¥ê¥¢¥¹¤ò ÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹:
1 /etc/postfix/main.cf: 2 virtual_alias_maps = hash:/etc/postfix/virtual 3 4 /etc/postfix/virtual: 5 root root@localhost 6 . . .
ËÝÌõ:
5¹ÔÌÜ: virtual(5) ¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ë ½ñ¤«¤ì¤Æ¤¤¤ë¤è¤¦¤Ë¡¢Íç¤Î "root" ¤È¤¤¤¦Ì¾Á°¤Ï "site" ¤¬ $myorigin ¤ÈƱ¤¸¾ì¹ç¤ä "site" ¤¬ $mydestination ¤Ëµó¤²¤é¤ì¤Æ ¤¤¤ë¾ì¹ç¡¢$inet_interfaces ¤Þ¤¿¤Ï $proxy_interfaces ¤Ë ¥Þ¥Ã¥Á¤¹¤ë¾ì¹ç¤Ë¤Ï "root@site" ¤Ë¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤Ç¼é¤é¤ì¤¿¥Í¥Ã¥È¥ï¡¼¥¯¤ÎÇظå¤Ë¤¢¤ë Postfix ¤òÀßÄꤹ¤ë ºÇ¤â¥·¥ó¥×¥ë¤ÊÊýË¡¤Ï¡¢¥á¡¼¥ë¤ò¤¹¤Ù¤Æ¥²¡¼¥È¥¦¥§¥¤¥Û¥¹¥È¤ËÁ÷¤Ã¤Æ¤·¤Þ¤¤¡¢ ¤½¤Î¥á¡¼¥ë¥Û¥¹¥È¤ËÆâÉô¤ª¤è¤Ó³°Éô¤Ø¤ÎžÁ÷¤ÎÌÌÅݤò¸«¤µ¤»¤ë¤³¤È¤Ç¤¹¡£ ¤½¤ÎÎã¤Ï¾å¤Î ¥í¡¼¥«¥ë¥¨¥ê¥¢¥Í¥Ã¥È¥ï¡¼¥¯ ¥»¥¯¥·¥ç¥ó¤Ç¼¨¤·¤Þ¤·¤¿¡£¤è¤êÀöÎý¤µ¤ì¤¿¥¢¥×¥í¡¼¥Á¤Ï¡¢³°Éô¥á¡¼¥ë¤Î¤ß¤ò ¥²¡¼¥È¥¦¥§¥¤¥Û¥¹¥È¤ËÁ÷¤ê¡¢¥¤¥ó¥È¥é¥Í¥Ã¥È¥á¡¼¥ë¤ÏľÀÜÁ÷¤ë¤³¤È¤Ç¤¹¡£ ¤³¤ì¤Ï Wietse ¤¬»Å»ö¤Ç»È¤Ã¤Æ¤¤¤ëÊýË¡¤Ç¤¹¡£
Ãí°Õ: ¤³¤ÎÎã¤Ë¤Ï Postfix ¥Ð¡¼¥¸¥ç¥ó 2.0 °Ê¹ß¤¬É¬ÍפǤ¹¡£»È¤Ã¤Æ¤¤¤ë Postfix ¤Î¥Ð¡¼¥¸¥ç¥ó¤òÃΤë¤Ë¤Ï¡¢¥³¥Þ¥ó¥É "postconf mail_version" ¤ò¼Â¹Ô¤·¤Þ¤¹¡£
°Ê²¼¤ÎÎã¤Ë¤ÏÀßÄê¤ÎÄɲÃÉôʬ¤ò¼¨¤·¤Þ¤¹¡£¤³¤ÎÀßÄê¤ò¤³¤Î¥É¥¥å¥á¥ó¥È¤ÎÁ°È¾¤Ç µÄÏÀ¤·¤¿´ðËÜŪ¤ÊÀßÄê¾ðÊó¤ÈÁȤ߹ç¤ï¤»¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
1 /etc/postfix/main.cf: 2 transport_maps = hash:/etc/postfix/transport 3 relayhost = 4 # Optional for a machine that isn't "always on" 5 #fallback_relay = [gateway.example.com] 6 7 /etc/postfix/transport: 8 # Internal delivery. 9 example.com : 10 .example.com : 11 # External delivery. 12 * smtp:[gateway.example.com]
ËÝÌõ:
2, 7-12¹ÔÌÜ: ¥¤¥ó¥È¥é¥Í¥Ã¥È¥á¡¼¥ë¤òľÀÜÇÛÁ÷¤·¡¢³°Éô¥á¡¼¥ë¤ò ¥²¡¼¥È¥¦¥§¥¤¤ËÅϤ¹¤è¤¦¤ËÍ׵ᤷ¤Þ¤¹¡£ÌÀ¤é¤«¤Ë¤³¤ÎÎã¤ÏÁÈ¿¥¤¬ DNS MX ¥ì¥³¡¼¥É¤ò ÆâÉô¤Ç»È¤Ã¤Æ¤¤¤ë¤³¤È¤òÁÛÄꤷ¤Æ¤¤¤Þ¤¹¡£[] ¤Ë¤è¤Ã¤Æ Postfix ¤Ë MX ¸¡º÷¤ò¤µ¤»¤Þ¤»¤ó¡£
5¹ÔÌÜ: ¤³¤ì¤Ë¤è¤ê¥Þ¥·¥ó¤ÎÅŸ»¤¬ÀÚ¤é¤ì¤Æ¤¤¤ë¤È¤¤Ë¥á¡¼¥ë¤¬¥¥å¡¼¤Ë »Ä¤Ã¤¿¤Þ¤Þ¤Ë¤Ê¤é¤Ê¤¤¤è¤¦¤Ë¤·¤Þ¤¹¡£Postfix ¤Ï¥á¡¼¥ë¤òľÀÜÇÛÁ÷¤·¤è¤¦¤È¤·¡¢ ÇÛÁ÷¤Ç¤¤Ê¤¤¥á¡¼¥ë¤ò¥²¡¼¥È¥¦¥§¥¤¤ËÅϤ·¤Þ¤¹¡£
¤¢¤Ê¤¿¤Î¥·¥¹¥Æ¥à¤¬ db ¤ÎÂå¤ï¤ê¤Ë dbm ¥Õ¥¡¥¤¥ë¤ò»È¤¦¤Î¤Ç¤¢¤ì¤Ð¡¢hash ¤Ç¤Ï¤Ê¤¯ dbm ¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£Postfix ¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¸¡º÷¥Æ¡¼¥Ö¥ë¤Î ¼ïÎà¤òÃΤë¤Ë¤Ï¡¢¥³¥Þ¥ó¥É "postconf -m" ¤ò»È¤¤¤Þ¤¹¡£
transport ¥Æ¡¼¥Ö¥ë¤òÊÔ½¸¤·¤¿¸å¤Ï "postmap /etc/postfix/transport" ¤ò ɬ¤º¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£
¤³¤Î¥»¥¯¥·¥ç¥ó¤Ç¤ÏÀßÄê¤ÎÄɲÃÉôʬ¤ò¼¨¤·¤Þ¤¹¡£¤³¤ÎÀßÄê¤ò¤³¤Î ¥É¥¥å¥á¥ó¥È¤ÎÁ°È¾¤ÇµÄÏÀ¤·¤¿´ðËÜŪ¤ÊÀßÄê¾ðÊó¤ÈÁȤ߹ç¤ï¤»¤ëɬÍפ¬ ¤¢¤ê¤Þ¤¹¡£
¤¢¤Ê¤¿¤Î¥·¥¹¥Æ¥à¤¬¥ê¥â¡¼¥È¥µ¥¤¥È¤Î¡Ö¥»¥«¥ó¥À¥ê¡×MX ¥Û¥¹¥È¤Î¾ì¹ç¤Ë ¤ä¤é¤Ê¤±¤ì¤Ð¤¤¤±¤Ê¤¤¤Î¤Ï°Ê²¼¤Î¤³¤È¤À¤±¤Ç¤¹:
1 DNS: 2 the.backed-up.domain.tld IN MX 100 your.machine.tld. 3 4 /etc/postfix/main.cf: 5 relay_domains = . . . the.backed-up.domain.tld 6 smtpd_recipient_restrictions = 7 permit_mynetworks reject_unauth_destination 8 9 # NAT/¥×¥í¥¥·³°Éô¥¢¥É¥ì¥¹¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ 10 #proxy_interfaces = 1.2.3.4 11 12 relay_recipient_maps = hash:/etc/postfix/relay_recipients 13 14 /etc/postfix/relay_recipients: 15 user1@the.backed-up.domain.tld x 16 user2@the.backed-up.domain.tld x 17 . . .
¤¢¤Ê¤¿¤Î¥·¥¹¥Æ¥à¤¬¥ê¥â¡¼¥È¥µ¥¤¥È¤Î¡Ö¥×¥é¥¤¥Þ¥ê¡×MX ¥Û¥¹¥È¤Î¾ì¹ç¤Ë¤Ï¡¢ ¾å¤Ë²Ã¤¨¤Æ°Ê²¼¤â¤ª¤³¤Ê¤¤¤Þ¤¹:
18 /etc/postfix/main.cf: 19 transport_maps = hash:/etc/postfix/transport 20 21 /etc/postfix/transport: 22 the.backed-up.domain.tld relay:[their.mail.host.tld]
½ÅÍפÊÃí°Õ:
mydestination ¤Ë the.backed-up.domain.tld ¤ò¥ê¥¹¥È¥¢¥Ã¥×¤·¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£
virtual_alias_domains ¤Ë the.backed-up.domain.tld ¤ò¥ê¥¹¥È¥¢¥Ã¥×¤·¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£
virtual_mailbox_domains ¤Ë the.backed-up.domain.tld ¤ò¥ê¥¹¥È¥¢¥Ã¥×¤·¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£
1-7¹ÔÌÜ: ¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤«¤é "the.backed-up.domain.tld" °¸¤Î¥á¡¼¥ë¤ò ¤½¤Î¥É¥á¥¤¥ó¤Î¥×¥é¥¤¥Þ¥ê MX ¥Û¥¹¥È¤ËžÁ÷¤·¤Þ¤¹¡£
10¹ÔÌÜ: ¤³¤ì¤Ï¥í¡¼¥«¥ë¥Þ¥·¥ó¤Î IP ¥¢¥É¥ì¥¹¤È°Û¤Ê¤ë¥¢¥É¥ì¥¹¤ò À¤³¦Ãæ¤Ë¼¨¤·¤Æ¤¤¤ë NAT ¥ê¥ì¡¼¤ä¥×¥í¥¥·¤òÄ̤·¤Æ Postfix ¤¬¥á¡¼¥ë¤ò ¼õ¤±¼è¤ë¾ì¹ç¤Ëɬ¿Ü¤Ç¤¹¡£
12-16¹ÔÌÜ: "the.backed-up.domain.tld" ¥É¥á¥¤¥ó¤Î¥¢¥É¥ì¥¹¤Ç͸ú¤Ê ¤â¤Î¤Î¥ê¥¹¥È¤òÄêµÁ¤·¤Þ¤¹¡£¤³¤ì¤Ë¤è¤ê¥á¡¼¥ë¥¥å¡¼¤¬ÇÛÁ÷¤Ç¤¤Ê¤¤ MAILER-DAEMON ¥á¥Ã¥»¡¼¥¸¤ÇËä¤á¿Ô¤¯¤µ¤ì¤Ê¤¤¤è¤¦¤Ë¤·¤Þ¤¹¡£Í¸ú¤Ê¥¢¥É¥ì¥¹¤Î¥ê¥¹¥È¤ò´ÉÍý ¤Ç¤¤Ê¤¤¤Î¤Ç¤¢¤ì¤Ð¡¢"relay_recipient_maps =" (¤Ä¤Þ¤ê¶õ¤ÎÃÍ) ¤ò»ØÄꤹ¤ë¤«¡¢"@the.backed-up.domain.tld x" ¥ï¥¤¥ë¥É¥«¡¼¥É¤ò relay_recipients ¥Æ¡¼¥Ö¥ë¤Ë»ØÄꤷ¤Ê¤±¤ì¤Ð¤¤¤±¤Þ¤»¤ó¡£
22¹ÔÌÜ: [] ¤¬¤¢¤ë¤È Postfix ¤Ï MX ¸¡º÷¤ò¤·¤Þ¤»¤ó¡£
¤¢¤Ê¤¿¤Î¥·¥¹¥Æ¥à¤¬ db ¤ÎÂå¤ï¤ê¤Ë dbm ¥Õ¥¡¥¤¥ë¤ò»È¤¦¤Î¤Ç¤¢¤ì¤Ð¡¢hash ¤Ç¤Ï¤Ê¤¯ dbm ¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£Postfix ¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¸¡º÷¥Æ¡¼¥Ö¥ë¤Î ¼ïÎà¤òÃΤë¤Ë¤Ï¡¢¥³¥Þ¥ó¥É "postconf -m" ¤ò»È¤¤¤Þ¤¹¡£
transport ¥Æ¡¼¥Ö¥ë¤òÊÔ½¸¤·¤¿¸å¤Ï "postmap /etc/postfix/transport" ¤ò ɬ¤º¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£
Postfix < 2.2¤Ø¤ÎÃí°Õ: ¥Ð¥Ã¥¯¥¢¥Ã¥×¤Þ¤¿¤Ï¥×¥é¥¤¥Þ¥êMX¥É¥á¥¤¥ó¤Ø¤Î¥á¡¼¥ë¤ÎÃæ·Ñ»þ¤Ë fallback_relay µ¡Ç½¤ò»È¤ï¤Ê¤¤¤Ç ¤¯¤À¤µ¤¤¡£ºÇ½ªÅª¤ÊÇÛÁ÷Àè¤ËÅþã¤Ç¤¤Ê¤¤¤È¤¤Ë¡¢¥á¡¼¥ë¤¬Postfix MX¥Û¥¹¥È¤È fallback_relay ¥Û¥¹¥È¤Î´Ö¤Ç ¥ë¡¼¥×¤·¤Æ¤·¤Þ¤¤¤Þ¤¹¡£
¤³¤ì¤é¤ÏPostfix¥Ð¡¼¥¸¥ç¥ó2.2°Ê¹ß¤Ç¤Ï¥Ç¥Õ¥©¥ë¥È¤ÎÀßÄê¤Ç¤¹¡£
¤³¤Î¥»¥¯¥·¥ç¥ó¤Ç¤Ï¡¢¤Û¤È¤ó¤É¤Î»þ´Ö¥À¥¦¥ó¤·¤Æ¤¤¤ë¥À¥¤¥¢¥ë¥¢¥Ã¥×Àܳ¤Ë ±þÍѤ·¤Þ¤¹¡£24x7 ¤ÇÀܳ¤·¤Æ¤¤¤ë¥À¥¤¥¢¥ë¥¢¥Ã¥×Àܳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢¾å¤Î ¥í¡¼¥«¥ë¥¨¥ê¥¢¥Í¥Ã¥È¥ï¡¼¥¯ ¥»¥¯¥·¥ç¥ó¤ò»²¾È¤·¤Æ ¤¯¤À¤µ¤¤¡£
¤³¤Î¥»¥¯¥·¥ç¥ó¤Ç¤ÏÀßÄê¤ÎÄɲÃÉôʬ¤ò¼¨¤·¤Þ¤¹¡£¤³¤ÎÀßÄê¤ò¤³¤Î¥É¥¥å¥á¥ó¥È¤Î Á°È¾¤ÇµÄÏÀ¤·¤¿´ðËÜŪ¤ÊÀßÄê¾ðÊó¤ÈÁȤ߹ç¤ï¤»¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
¼«Ê¬¼«¿È¤Î¥Û¥¹¥È̾¤äIP¥¢¥É¥ì¥¹¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç (¤¿¤¤¤Æ¤¤¤Ï¥À¥¤¥¢¥ë¥¢¥Ã¥×¤ä ¥±¡¼¥Ö¥ëTV¡¢DSLÀܳ)¡¢"¼ÂºÝ¤Î¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥Û¥¹¥È̾¤ò »ý¤¿¤Ê¤¤¥Û¥¹¥È¤Ç¤Î Postfix" ¤Î¥»¥¯¥·¥ç¥ó¤â³Ø½¬¤¹¤ë¤Ù¤¤Ç¤¹¡£
¥Þ¥·¥ó¤¬¤Û¤È¤ó¤É¤Î»þ´ÖÀÚÃǤµ¤ì¤Æ¤¤¤ë¤Î¤Ç¤¢¤ì¤Ð¡¢Åþ㤬º¤Æñ¤Ê ¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤ÎÊÒ¶ù¤Ë Postfix ¤¬¥á¡¼¥ë¤òÇÛÁ÷¤Ç¤¤ëµ¡²ñ¤Ï¤¢¤Þ¤ê¤¢¤ê¤Þ¤»¤ó¡£ ¾ï¤ËÀܳ¤·¤Æ¤¤¤ë¥Þ¥·¥ó¤Ë¥á¡¼¥ë¤òÅϤ·¤Æ¤·¤Þ¤¦¤Î¤¬¤è¤¤¤Ç¤·¤ç¤¦¡£°Ê²¼¤Î Îã¤Ç¤Ï¡¢[] ¤Ë¤è¤Ã¤Æ Postfix ¤¬ DNS MX ¥ì¥³¡¼¥É¤ò¸¡º÷¤·¤Ê¤¤¤è¤¦¤Ë ¤·¤Æ¤¤¤Þ¤¹¡£
/etc/postfix/main.cf: relayhost = [smtprelay.someprovider.com]
¼«È¯Åª¤Ê SMTP ¥á¡¼¥ëÇÛÁ÷¤ò̵¸ú¤Ë¤·¤Þ¤¹ (¥ª¥ó¥Ç¥Þ¥ó¥É¥À¥¤¥¢¥ë¥¢¥Ã¥× IP ¤ò»È¤Ã¤Æ¤¤¤ë¾ì¹ç¤Î¤ß)¡£
Ä̾Postfix ¤ÏÅԹ礬¤è¤¤¤È¤¤Ë³°¹Ô¤¤Î¥á¡¼¥ë¤òÇÛÁ÷¤·¤è¤¦¤È¤·¤Þ¤¹¡£ ¥Þ¥·¥ó¤¬¥ª¥ó¥Ç¥Þ¥ó¥É¥À¥¤¥¢¥ë¥¢¥Ã¥× IP ¤ò»È¤Ã¤Æ¤¤¤ë¤È¡¢¿·¤·¤¤¥á¡¼¥ë¤ò ÅêÈ¡¤¹¤ë¤¿¤Ó¡¢Postfix ¤¬ÃÙ±ä¥á¡¼¥ë¤òÇÛÁ÷¤·¤è¤¦¤È¤¹¤ë¤¿¤Ó¤Ë¡¢¥·¥¹¥Æ¥à¤¬ ÅÅÏäò¤«¤±¤è¤¦¤È¤·¤Æ¤·¤Þ¤¦¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£¤½¤Î¤è¤¦¤ÊÅÅÏäò¤«¤±¤Ê¤¤¤è¤¦¤Ë ¤¹¤ë¤¿¤á¤Ë¡¢¼«È¯Åª¤Ê SMTP ¥á¡¼¥ëÇÛÁ÷¤ò̵¸ú¤Ë¤·¤Þ¤¹¡£
/etc/postfix/main.cfó› defer_transports = smtp (¥ª¥ó¥Ç¥Þ¥ó¥É¥À¥¤¥¢¥ë¥¢¥Ã¥× IP ¥Û¥¹¥È¤Î¤ß)
SMTP ¥¯¥é¥¤¥¢¥ó¥È ¤Î DNS lookups ¤ò̵¸ú¤Ë¤·¤Þ¤¹ (¥À¥¤¥¢¥ë¥¢¥Ã¥× LAN ¤Î¤ß).
/etc/postfix/main.cf: disable_dns_lookups = yes (¥ª¥ó¥Ç¥Þ¥ó¥É¥À¥¤¥¢¥ë¥¢¥Ã¥× IP ¥Û¥¹¥È¤Î¤ß)
°Ê²¼¤Î¥³¥Þ¥ó¥É¤ò PPP ¤Þ¤¿¤Ï SLIP ¥À¥¤¥¢¥ë¥¢¥Ã¥×¥¹¥¯¥ê¥×¥È¤ËÆþ¤ì¤Æ ¤¯¤À¤µ¤¤:
/usr/sbin/sendmail -q (¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥ê¥ó¥¯¤¬¾å¤¬¤ë¤¿¤Ó¤Ë)
Postfix sendmail ¥³¥Þ¥ó¥É¤ÎÀµ³Î¤Ê¾ì½ê¤Ï¥·¥¹¥Æ¥à¤Ë¤è¤ê¤Þ¤¹¡£Postfix sendmail ¥³¥Þ¥ó¥É¤¬¥·¥¹¥Æ¥à¤Î¤É¤³¤Ë¤¢¤ë¤«¤òÃΤë¤Ë¤Ï¡¢¥³¥Þ¥ó¥É"postconf sendmail_path" ¤ò»È¤Ã¤Æ ¤¯¤À¤µ¤¤¡£
¥á¡¼¥ë¥¥å¡¼¤¬ flush ¤µ¤ì¤¿¤«¤É¤¦¤«¤òÃΤë¤Ë¤Ï¡¢¼¡¤Î¤è¤¦¤Ê¤â¤Î¤ò»È¤Ã¤Æ ¤¯¤À¤µ¤¤:
#!/bin/sh # ¥á¡¼¥ëÇÛÁ÷¤ò»Ï¤á¤Þ¤¹¡£ /usr/sbin/sendmail -q # ÇÛÁ÷¤ò»Ï¤á¤µ¤»¤Þ¤¹¡£ sleep 10 # ¥á¥Ã¥»¡¼¥¸¤¬¤¹¤Ù¤Æ1ÅÙ¤ÏÇÛÁ÷¤¬»î¤µ¤ì¤ë¤Þ¤Ç¥ë¡¼¥×¤·¤Þ¤¹¡£ while mailq | grep '^[^ ]*\*' >/dev/null do sleep 10 done
¼«È¯Åª¤Ê SMTP ¥á¡¼¥ëÇÛÁ÷¤ò̵¸ú¤Ë ¤·¤Æ¤¤¤ë¾ì¹ç¡¢¥À¥¤¥¢¥ë¥¢¥Ã¥×¥ê¥ó¥¯¤¬¾å¤¬¤Ã¤Æ¤¤¤ë´Ö¤Ï»þ¡¹ "sendmail -q" ¥³¥Þ¥ó¥É¤â¼Â¹Ô¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¤³¤ì¤Ë¤è¤ê¿·¤·¤¯ÅêÈ¡¤µ¤ì¤¿¥á¡¼¥ë¤¬ ¥¥å¡¼¤«¤é flush ¤µ¤ì¤Þ¤¹¡£
¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï¼«Ê¬¼«¿È¤Î¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥Û¥¹¥È̾¤ò»ý¤¿¤Ê¤¤¥Û¥¹¥È¸þ¤±¤Ç¤¹¡£ ¤³¤ì¤é¤Ï¤¿¤¤¤Æ¤¤ DHCP ¤ä¥À¥¤¥¢¥ë¥¢¥Ã¥×¤ÇưŪ IP ¥¢¥É¥ì¥¹¤ò¼èÆÀ¤¹¤ë ¥·¥¹¥Æ¥à¤Ç¤¹¡£Postfix ¤Ï¥Þ¥·¥ó¾å¤Î¥¢¥«¥¦¥ó¥È¤Ë¶õÁÛ¤Î̾Á°¤¬¤¢¤ì¤ÐÌäÂê¤Ê¤¯ ¥á¡¼¥ë¤òÁ÷¼õ¿®¤·¤Þ¤¹¡£¤·¤«¤·¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Ë¥á¡¼¥ë¤òÁ÷¤ëºÝ¤Ë¤ÏE¥á¡¼¥ë ¥¢¥É¥ì¥¹¤Ë¶õÁÛ¥Û¥¹¥È̾¤ò»È¤¦¤³¤È¤Ï¤Ç¤¤Þ¤»¤ó¡£»È¤Ã¤Æ¤·¤Þ¤¦¤Èï¤â¤½¤Î ¥á¡¼¥ë¤ËÊÖ»ö¤òÊÖ¤»¤Ê¤¤¤«¤é¤Ç¤¹¡£¼ÂºÝ¡¢Â¸ºß¤·¤Ê¤¤¥É¥á¥¤¥ó̾¤Î¥á¡¼¥ë¥¢¥É¥ì¥¹¤ò µñÈݤ¹¤ë¥µ¥¤¥È¤ÏÁý¤¨¤Æ¤¤Æ¤¤¤Þ¤¹¡£
Ãí°Õ: °Ê²¼¤Î¾ðÊó¤ÏPostfix¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë°Í¸¤·¤Þ¤¹¡£»È¤Ã¤Æ¤¤¤ëPostfix¤Î ¥Ð¡¼¥¸¥ç¥ó¤òÃΤë¤Ë¤Ï¡¢¥³¥Þ¥ó¥É "postconf mail_version" ¤ò¼Â¹Ô¤·¤Þ¤¹¡£
Postfix 2.2¤Ï¥í¡¼¥«¥ë¤Î¶õÁÛE¥á¡¼¥ë¥¢¥É¥ì¥¹¤ò͸ú¤Ê¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥¢¥É¥ì¥¹¤Ç ÃÖ¤´¹¤¨¤ë¤Î¤Ë generic(5) ¥¢¥É¥ì¥¹¥Þ¥Ã¥Ô¥ó¥°¤ò»È¤¤¤Þ¤¹¡£¤³¤Î¥Þ¥Ã¥Ô¥ó¥°¤Ï ¥á¡¼¥ë¤¬¥Þ¥·¥ó¤ò½Ð¤Æ¹Ô¤¯¤È¤¡Ö¤Î¤ß¡×¼Â¹Ô¤µ¤ì¤Þ¤¹; Ʊ¤¸¥Þ¥·¥ó¾å¤Î¥æ¡¼¥¶´Ö¤Ç ¥á¡¼¥ë¤òÁ÷¤ë¤È¤¤Ë¤Ï»È¤ï¤ì¤Þ¤»¤ó¡£
°Ê²¼¤ÎÎã¤ÏÄɲ乤ëÀßÄê¤ò¼¨¤·¤Æ¤¤¤Þ¤¹¡£¤³¤ì¤ò¤³¤Î¥É¥¥å¥á¥ó¥È¤ÎÁ°È¾¤ÇµÄÏÀ¤·¤¿ ´ðËÜŪ¤ÊÀßÄê¾ðÊó¤È¹ç¤ï¤»¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
1 /etc/postfix/main.cf: 2 smtp_generic_maps = hash:/etc/postfix/generic 3 4 /etc/postfix/generic: 5 his@localdomain.local hisaccount@hisisp.example 6 her@localdomain.local heraccount@herisp.example 7 @localdomain.local hisaccount+local@hisisp.example
¥ê¥â¡¼¥È¥Û¥¹¥È¤ËSMTP¤Ç¥á¡¼¥ë¤òÁ÷¤ë¾ì¹ç:
5¹ÔÌÜ¤Ç his@localdomain.local ¤ò his ¤ÎISP¥á¡¼¥ë¥¢¥É¥ì¥¹¤Ç ÃÖ¤´¹¤¨¡¢
6¹ÔÌÜ¤Ç her@localdomain.local ¤ò her ¤ÎISP¥á¡¼¥ë¥¢¥É¥ì¥¹¤Ç ÃÖ¤´¹¤¨¡¢¤½¤·¤Æ
7¹ÔÌܤǾ¤Î¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤ò +local ¤È¤¤¤¦³ÈÄ¥¥¢¥É¥ì¥¹¤¬ÉÕ¤¤¤¿ his ¤ÎISP¥¢¥«¥¦¥ó¥È¤ÇÃÖ¤´¹¤¨¤Þ¤¹ (¤³¤ÎÎã¤Ç¤ÏISP¤¬ "+" ·Á¼°¤Î³ÈÄ¥¥¢¥É¥ì¥¹¤ò ¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤ÈÁÛÄꤷ¤Æ¤¤¤Þ¤¹)¡£
¤¢¤Ê¤¿¤Î¥·¥¹¥Æ¥à¤¬ db ¤ÎÂå¤ï¤ê¤Ë dbm ¥Õ¥¡¥¤¥ë¤ò»È¤¦¤Î¤Ç¤¢¤ì¤Ð¡¢ hash ¤Ç¤Ï¤Ê¤¯ dbm ¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£Postfix¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë ¸¡º÷¥Æ¡¼¥Ö¥ë¤Î¼ïÎà¤òÃΤë¤Ë¤Ï¡¢¥³¥Þ¥ó¥É "postconf -m" ¤ò»È¤¤¤Þ¤¹¡£
generic ¥Æ¡¼¥Ö¥ë¤òÊÔ½¸¤·¤¿¸å¤Ï "postmap /etc/postfix/generic" ¤ò ɬ¤º¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£
Postfix¤Ë¤È¤Ã¤Æ¤Î´°àú¤Ê²ò¤Ï¡¢¥á¡¼¥ë¤¬¥Þ¥·¥ó¤òÎ¥¤ì¤ë¤È¤¤Ë¡¢¥í¡¼¥«¥ë¤Î ¶õÁÛ E¥á¡¼¥ë¥¢¥É¥ì¥¹¤ò͸ú¤Ê¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥¢¥É¥ì¥¹¤Ë¥Þ¥Ã¥Ô¥ó¥°¤¹¤ë¤³¤È¤Ë ¤Ê¤ë¤Ç¤·¤ç¤¦ (Sendmail ¤Î generics ¥Æ¡¼¥Ö¥ë¤Î¤è¤¦¤Ë)¡£¤³¤ì¤Ï¶á¤¤¾Íè·×²è ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
¤·¤Ð¤é¤¯¤Î´Ö¤Ï¡¢Postfix ¤Ç¤Î²ò¤Ï¤Ç¤¤ë¤À¤±Í¸ú¤Ê¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥¢¥É¥ì¥¹¤ò »È¤¤¡¢ Postfix ¤Ë͸ú¤Ê¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥¢¥É¥ì¥¹¤«¤é¥í¡¼¥«¥ë¤Î¶õÁÛ¥¢¥É¥ì¥¹¤Ë ¥Þ¥Ã¥Ô¥ó¥°¤µ¤»¤ë¤³¤È¤Ç¤¹¡£¤³¤¦¤¹¤ë¤È¡¢¥á¡¼¥ë¤ò¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤ËÁ÷¤Ã¤¿¤ê¡¢ ¼«Ê¬¤Î͸ú¤Ê¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥¢¥É¥ì¥¹¤ò»ý¤¿¤Ê¤¤¥í¡¼¥«¥ë¶õÁÛ¥¢¥É¥ì¥¹¤Ø¤Î ¥á¡¼¥ë¤ò´Þ¤á¤Æ¡¢¥í¡¼¥«¥ë¤Î¶õÁÛ¥¢¥É¥ì¥¹¤Ë¥á¡¼¥ë¤òÁ÷¤ì¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£
¤³¤Î¥»¥¯¥·¥ç¥ó¤Ç¤ÏÀßÄê¤ÎÄɲÃÉôʬ¤ò¼¨¤·¤Þ¤¹¡£¤³¤ÎÀßÄê¤ò¤³¤Î¥É¥¥å¥á¥ó¥È¤Î Á°È¾¤ÇµÄÏÀ¤·¤¿´ðËÜŪ¤ÊÀßÄê¾ðÊó¤ÈÁȤ߹ç¤ï¤»¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
1 /etc/postfix/main.cf: 2 myhostname = hostname.localdomain 3 mydomain = localdomain 4 5 canonical_maps = hash:/etc/postfix/canonical 6 7 virtual_alias_maps = hash:/etc/postfix/virtual 8 9 /etc/postfix/canonical: 10 your-login-name your-account@your-isp.com 11 12 /etc/postfix/rtual.5.html">virtualeirtual: 13 your-account@your-isp.com your-login-name
ËÝÌõ:
2-3¹ÔÌÜ: ¤³¤³¤Ç¤Ï¶õÁÛ¥Û¥¹¥È̾¤òÃÖ¤´¹¤¨¤Þ¤¹¡£¥¤¥ó¥¿¡¼¥Í¥Ã¥È¾å¤Ë ¼Âºß¤¹¤ëÁÈ¿¥¤¬¤¹¤Ç¤Ë»È¤Ã¤Æ¤¤¤ë¥É¥á¥¤¥ó̾¤ò»È¤Ã¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£Ã¯¤â½êÍ ¤·¤Ê¤¤¤³¤È¤¬Êݾڤµ¤ì¤Æ¤¤¤ë¥É¥á¥¤¥ó̾¤ÎÎã¤Ï RFC 2606 ¤ò»²¾È¤·¤Æ ¤¯¤À¤µ¤¤¡£
5, 9, 10¹ÔÌÜ: ¤³¤ì¤Ï "your-login-name@hostname.localdomain" ¤«¤é "your-account@your-isp.com" ¤Ø¤Î¥Þ¥Ã¥Ô¥ó¥°¤òÍ¿¤¨¤Þ¤¹¡£¤³¤ÎÉôʬ¤Ïɬ¿Ü¤Ç¤¹¡£
7, 12, 13¹ÔÌÜ: "your-account@your-isp.com" °¸¤Î¥á¡¼¥ë¤ò ISP ¤Ë ¤Ç¤Ï¤Ê¤¯¥í¡¼¥«¥ë¤ËÇÛÁ÷¤·¤Þ¤¹¡£¤³¤ÎÉôʬ¤Ïɬ¿Ü¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¤¬ÊØÍø¤Ç¤¹¡£
¤¢¤Ê¤¿¤Î¥·¥¹¥Æ¥à¤¬ db ¤ÎÂå¤ï¤ê¤Ë dbm ¥Õ¥¡¥¤¥ë¤ò»È¤¦¤Î¤Ç¤¢¤ì¤Ð¡¢hash ¤Ç¤Ï¤Ê¤¯ dbm ¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£Postfix ¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¸¡º÷¥Æ¡¼¥Ö¥ë¤Î ¼ïÎà¤òÃΤë¤Ë¤Ï¡¢¥³¥Þ¥ó¥É "postconf -m" ¤ò»È¤¤¤Þ¤¹¡£
canonical ¥Æ¡¼¥Ö¥ë¤òÊÔ½¸¤·¤¿¸å¤Ï "postmap /etc/postfix/canonical" ¤ò ɬ¤º¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£
virtual ¥Æ¡¼¥Ö¥ë¤òÊÔ½¸¤·¤¿¸å¤Ï "postmap /etc/postfix/virtual" ¤òɬ¤º¼Â¹Ô ¤·¤Æ¤¯¤À¤µ¤¤¡£