Product SiteDocumentation Site

13.3. Mail Transport Agent

Fedora offers two primary MTAs: Postfix and Sendmail. Postfix is configured as the default MTA, although it is easy to switch the default MTA to Sendmail. To switch the default MTA to Sendmail, as root, you can either uninstall Postfix or use the following command to switch to Sendmail:
alternatives --config mta
You can also use the following command to enable/disable the desired service:
systemctl enable|disable service.service

13.3.1. Postfix

元来、 IBM のセキュリティ専門家でありプログラマーの Wietse Venema によって開発された Postfix は、安全で迅速で設定が容易であるようにデザインされた Sendmail 対応の MTA です。
セキュリティを改善する為に、 Postfix はモジュラーデザインを使用して、 master デーモンによって制限付の権限を持つ小規模のプロセスが起動できるようにします。より小規模で、権限の低いプロセスは、メール配送の各種段階における特定のタスクを実行し、外部攻撃からの影響を低減する為に変更したルート環境で動作します。
Configuring Postfix to accept network connections from hosts other than the local computer takes only a few minor changes in its configuration file. Yet for those with more complex needs, Postfix provides a variety of configuration options, as well as third party add-ons that make it a very versatile and full-featured MTA.
Postfix の設定ファイルは人間に判読できるもので、 250 以上のディレクティブをサポートします。 Sendmail とは異なり、変更が反映されるのにマクロプロセッシングは必要でなく、通常使用されるオプションのほとんどは大幅なコメントが付いているファイルに記述されています。

13.3.1.1. Postfix のデフォルトインストール

The Postfix executable is /usr/sbin/postfix. This daemon launches all related processes needed to handle mail delivery.
Postfix stores its configuration files in the /etc/postfix/ directory. The following is a list of the more commonly used files:
  • access — Used for access control, this file specifies which hosts are allowed to connect to Postfix.
  • main.cf — The global Postfix configuration file. The majority of configuration options are specified in this file.
  • master.cf — Specifies how Postfix interacts with various processes to accomplish mail delivery.
  • transport — Maps email addresses to relay hosts.
The aliases file can be found in the /etc/ directory. This file is shared between Postfix and Sendmail. It is a configurable list required by the mail protocol that describes user ID aliases.

Configuring Postfix as a server for other clients

The default /etc/postfix/main.cf file does not allow Postfix to accept network connections from a host other than the local computer. For instructions on configuring Postfix as a server for other clients, refer to 「Postfix の基本的な設定」.
Restart the postfix service after changing any options in the configuration files under the /etc/postfix directory in order for those changes to take effect. To do so, run the following command as root:
systemctl restart postfix.service

13.3.1.2. Postfix の基本的な設定

By default, Postfix does not accept network connections from any host other than the local host. Perform the following steps as root to enable mail delivery for other hosts on the network:
  • Edit the /etc/postfix/main.cf file with a text editor, such as vi.
  • Uncomment the mydomain line by removing the hash sign (#), and replace domain.tld with the domain the mail server is servicing, such as example.com.
  • myorigin = $mydomain 行をアンコメントします。
  • Uncomment the myhostname line, and replace host.domain.tld with the hostname for the machine.
  • mydestination = $myhostname, localhost.$mydomain 行をアンコメントします。
  • Uncomment the mynetworks line, and replace 168.100.189.0/28 with a valid network setting for hosts that can connect to the server.
  • inet_interfaces = all 行をアンコメントします。
  • inet_interfaces = localhost 行をコメントします。
  • postfix サービスを再起動します。
これらのステップが終了すると、ホストは配送の為に外部の電子メールを受け付けます。
Postfix has a large assortment of configuration options. One of the best ways to learn how to configure Postfix is to read the comments within the /etc/postfix/main.cf configuration file. Additional resources including information about Postfix configuration, SpamAssassin integration, or detailed descriptions of the /etc/postfix/main.cf parameters are available online at http://www.postfix.org/.

13.3.1.3. Using Postfix with LDAP

Postfix can use an LDAP directory as a source for various lookup tables (e.g.: aliases, virtual, canonical, etc.). This allows LDAP to store hierarchical user information and Postfix to only be given the result of LDAP queries when needed. By not storing this information locally, administrators can easily maintain it.
13.3.1.3.1. /etc/aliases 検索の例
The following is a basic example for using LDAP to look up the /etc/aliases file. Make sure your /etc/postfix/main.cf contains the following:
alias_maps = hash:/etc/aliases, ldap:/etc/postfix/ldap-aliases.cf
Create a /etc/postfix/ldap-aliases.cf file if you do not have one created already and make sure it contains the following:
server_host = ldap.example.com
search_base = dc=example, dc=com
ここで ldap.example.com, example, および com は、利用可能な既存の LDAP サーバーの指定に置き換える必要があるパラメーターです。

/etc/postfix/ldap-aliases.cf ファイル

/etc/postfix/ldap-aliases.cf ファイルは、LDAP SSL および STARTTLS を有効化するパラメーターを含め、さまざまなパラメーターを指定できます。詳細はldap_table(5)マニュアルページを参照してください。
LDAP の詳細は「OpenLDAP」を参照してください。