Opensourcetechブログ(ZeusITCamp裏BLOG)

オープンソース技術 開発研究所による主にオープンソースに関するブログです。

main.cf(postfixの設定ファイル)における行頭の空白の持つ意味(fatal unknown inet_protocols value)

 

こんにちは、オープンソース技術 開発研究所鯨井貴博です音譜

 f:id:opensourcetech:20140811122503p:plain

 

今回は、Postfix設定(main.cf)でちょっとはまった備忘録です。

 

main.cfの設定が以下のようになっている場合、

 パラメータinet_interfacesはどのような値が設定されるでしょう?

-------

#myhostname = host.domain.tld
#myhostname = virtual.domain.tld
myhostname = mail.testdomain.local

# The mydomain parameter specifies the local internet domain name.
# The default is to use $myhostname minus the first component.
# $mydomain is used as a default value for many other configuration
# parameters.
#
#mydomain = domain.tld
mydomain = testdomain.local

# SENDING MAIL
#
# The myorigin parameter specifies the domain that locally-posted
# mail appears to come from. The default is to append $myhostname,
# which is fine for small sites.  If you run a domain with multiple
# machines, you should (1) change this to $mydomain and (2) set up
# a domain-wide alias database that aliases each user to
# user@that.users.mailhost.
#
# For the sake of consistency between sender and recipient addresses,
# myorigin also specifies the default domain name that is appended
# to recipient addresses that have no @domain part.
#
#myorigin = $myhostname
#myorigin = $mydomain
myorigin = $mydomain

# RECEIVING MAIL

# The inet_interfaces parameter specifies the network interface
# addresses that this mail system receives mail on.  By default,
# the software claims all active interfaces on the machine. The
# parameter also controls delivery of mail to user@[ip.address].
#
# See also the proxy_interfaces parameter, for network addresses that
# are forwarded to us via a proxy or network address translator.
#
# Note: you need to stop/start Postfix when this parameter changes.
#
inet_interfaces = all
#inet_interfaces = $myhostname
#inet_interfaces = $myhostname, localhost
#inet_interfaces = localhost

# Enable IPv4, and IPv6 if supported
inet_protocols = all

# The proxy_interfaces parameter specifies the network interface
# addresses that this mail system receives mail on by way of a
# proxy or network address translation unit. This setting extends
# the address list specified with the inet_interfaces parameter.
#
# You must specify your proxy/NAT addresses when your system is a
# backup MX host for other domains, otherwise mail delivery loops
# will happen when the primary MX host is down.
#
#proxy_interfaces =
#proxy_interfaces = 1.2.3.4

# The mydestination parameter specifies the list of domains that this
# machine considers itself the final destination for.
#
# These domains are routed to the delivery agent specified with the
# local_transport parameter setting. By default, that is the UNIX
# compatible delivery agent that lookups all recipients in /etc/passwd
# and /etc/aliases or their equivalent.
#
# The default is $myhostname + localhost.$mydomain.  On a mail domain
# gateway, you should also include $mydomain.
#
# Do not specify the names of virtual domains - those domains are
# specified elsewhere (see VIRTUAL_README).
#
# Do not specify the names of domains that this machine is backup MX
# host for. Specify those names via the relay_domains settings for
# the SMTP server, or use permit_mx_backup if you are lazy (see
# STANDARD_CONFIGURATION_README).
#
# The local machine is always the final destination for mail addressed
# to user@[the.net.work.address] of an interface that the mail system
# receives mail on (see the inet_interfaces parameter).
#
# Specify a list of host or domain names, /file/name or type:table
# patterns, separated by commas and/or whitespace. A /file/name
# pattern is replaced by its contents; a type:table is matched when
# a name matches a lookup key (the right-hand side is ignored).
# Continue long lines by starting the next line with whitespace.
#
# See also below, section "REJECTING MAIL FOR UNKNOWN LOCAL USERS".
#
#mydestination = $myhostname, localhost.$mydomain, localhost
       mail.$mydomain, www.$mydomain, ftp.$mydomain
#mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain,
       mail.$mydomain, www.$mydomain, ftp.$mydomain

 

 

 

正解は、

inet_interfaces = all          mail.$mydomain, www.$mydomain, ftp.$mydomainとなります。

 

これは、main.cfにおいては、

設定行の先頭が空白の場合、前の行からの継続であると判断される為です。

 

上記のように設定がされてしまった場合、

postfixの起動時に「fatal unknown inet_protocols value」とエラーメッセージが出力されます。

 

オープンソース技術 開発研究所

 f:id:opensourcetech:20140811122503p:plain

 

 

Postfixが試験範囲に含まれるLPICレベル2を学ばれている方は、

こちらもどうぞ。

 LPICレベル2は取得できる!!

footerのテストです