sendmail の設定で特定のホストにメールを送る方法
Environment
Red Hat Enterprise Linux 5
Red Hat Enterprise Linux 6
Issue
- sendmail の設定で特定のホストにメールを送る方法は?
Resolution
これは、"/etc/mail/mailertable" ファイルに適切なエントリを追加することで可能です。このファイルを使用し、ドメインと、そのドメインに対してすべてのメールが送られる MTA を指定することができます。以下の例では、"mydomain.com" に送られるすべてのメールは、"backend.mail.server" に解決されるメールサーバーに自動的に転送されます。また、192.0.0.0 ネットワークから受け取ったすべてのメールは、"outbound.mail.server" に解決されるメールサーバーに転送されます。
たとえば、以下のようになります。
/etc/mail/mailertable
mydomain.com smtp:backend.mail.server
192. smtp:outgoing.mail.server
- 以下のコマンドを実行して、mailertable データベースを再構築します。
# makemap hash /etc/mail/mailertable.db < /etc/mail/mailertable
- sendmail を再起動します。
# service sendmail restart
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
