Oefenweb.postfix

postfix

CI Ansible Galaxy

Debian系のシステムにPostfixサーバーを設定します。

要件

なし

変数

  • postfix_install [デフォルト: [postfix, mailutils, libsasl2-2, sasl2-bin, libsasl2-modules]]: インストールするパッケージ

  • postfix_hostname [デフォルト: {{ ansible_fqdn }}]: ホスト名、myhostnamemydestinationに使用されます

  • postfix_mailname [デフォルト: {{ ansible_fqdn }}]: メール名 (/etc/mailname内)、myoriginに使用されます

  • postfix_compatibility_level [オプション]: 後方互換性を有効にすると、Postfixは暗黙のデフォルト値に設定された設定を探し、後方互換性が必要なデフォルト設定が必要な場合にメッセージをログに記録します(例: 2, Postfix >= 3.0

  • postfix_default_database_type [デフォルト: hash]: newaliases, postalias, postmapコマンドに使用するデフォルトデータベースタイプ

  • postfix_aliases [デフォルト: []]: /etc/aliasesに確実に存在させるエイリアス

  • postfix_aliases_database_type [デフォルト: "{{ postfix_default_database_type }}"]: エイリアスに使用するデータベースタイプ

  • postfix_virtual_aliases [デフォルト: []]: /etc/postfix/virtualに確実に存在させる仮想エイリアス

  • postfix_sender_canonical_maps [デフォルト: []]: /etc/postfix/sender_canonical_maps内の送信者アドレスの書き換え

  • postfix_sender_canonical_maps_database_type [デフォルト: "{{ postfix_default_database_type }}"]: postfix_sender_canonical_mapsに使用するデータベースタイプ

  • postfix_recipient_canonical_maps [デフォルト: []]: /etc/postfix/recipient_canonical_maps内の受信者アドレスの書き換え

  • postfix_recipient_canonical_maps_database_type [デフォルト: "{{ postfix_default_database_type }}"]: postfix_recipient_canonical_mapsに使用するデータベースタイプ

  • postfix_transport_maps [デフォルト: []]: 受信者アドレスに基づくトランスポートマッピング /etc/postfix/transport_maps

  • postfix_transport_maps_database_type [デフォルト: "{{ postfix_default_database_type }}"]: postfix_transport_mapsに使用するデータベースタイプ

  • postfix_sender_dependent_relayhost_maps [デフォルト: []]: 送信者アドレスに基づくトランスポートマッピング /etc/postfix/sender_dependent_relayhost_maps

  • postfix_header_checks [デフォルト: []]: プライマリ非MIMEメッセージヘッダーのコンテンツ検査のためのルックアップテーブル /etc/postfix/header_checks

  • postfix_header_checks_database_type [デフォルト: regexp]: header_checksに使用するデータベースタイプ

  • postfix_generic [デフォルト: postfix_smtp_generic_maps]: 廃止, postfix_smtp_generic_mapsを使用してください

  • postfix_smtp_generic_maps [デフォルト: []]: /etc/postfix/generic内の一般的なテーブルアドレスマッピング

  • postfix_smtp_generic_maps_database_type [デフォルト: "{{ postfix_default_database_type }}"]: smtp_generic_mapsに使用するデータベースタイプ

  • postfix_mydestination [デフォルト: ["{{ postfix_hostname }}", 'localdomain', 'localhost', 'localhost.localdomain']]: このマシンがローカルに配信するドメインを指定します。他のマシンに転送するのではなく。

  • postfix_mynetworks [デフォルト: ['127.0.0.0/8', '[::ffff:127.0.0.0]/104', '[::1]/128']]: "信用できる"リモートSMTPクライアントのリスト

  • postfix_inet_interfaces [デフォルト: all]: バインドするネットワークインターフェース

  • postfix_inet_protocols [デフォルト: all]: Postfixが接続を作成または受け入れるときに使用するインターネットプロトコル

  • postfix_smtp_ipv4_bind [オプション]: 使用する送信ネットワークインターフェース(IPv4)

  • postfix_smtp_ipv6_bind [オプション]: 使用する送信ネットワークインターフェース(IPv6)

  • postfix_relayhost [デフォルト: ''(リレーするホストなし)]: すべてのメールをリレーするホスト名

  • postfix_relayhost_mxlookup [デフォルト: false(mxルックアップを使用しない)]: リレーホストのAレコードではなくMXレコードをルックアップします

  • postfix_relayhost_port [デフォルト: 587]: リレーポート(設定されている場合、postfix_relayhostに)

  • postfix_relaytls [デフォルト: false]: リレーhostに送信する際にTLSを使用

  • postfix_smtpd_client_restrictions [オプション]: クライアント制限のリスト

  • postfix_smtpd_helo_restrictions [オプション]: helo制限のリスト

  • postfix_smtpd_sender_restrictions [オプション]: 送信者制限のリスト

  • postfix_smtpd_recipient_restrictions [オプション]: 受信者制限のリスト

  • postfix_smtpd_relay_restrictions [オプション]: メールリレー制御のアクセス制限のリスト

  • postfix_smtpd_data_restrictions [オプション]: データ制限のリスト

  • postfix_sasl_auth_enable [デフォルト: true]: SMTPクライアントでSASL認証を有効にする

  • postfix_sasl_user [デフォルト: postmaster@{{ ansible_domain }}]: SASLリレーのユーザー名

  • postfix_sasl_password [デフォルト: k8+haga4@#pR]: SASLリレーのパスワード 変更することを忘れずに!

  • postfix_sasl_security_options [デフォルト: noanonymous]: SMTPクライアントのSASLセキュリティオプション

  • postfix_sasl_tls_security_option [デフォルト: noanonymous]: SMTPクライアントのSASL TLSセキュリティオプション

  • postfix_sasl_mechanism_filter [デフォルト: '']: SMTPクライアントのSASL認証メカニズムフィルター

  • postfix_smtp_tls_security_level [デフォルト: encrypt]: Postfix SMTPクライアントのデフォルトのSMTP TLSセキュリティレベル

  • postfix_smtp_tls_wrappermode [デフォルト: false]: Postfix SMTPクライアントがSTARTTLSコマンドを使用する代わりにレガシーSMTPSプロトコルを使用して接続をリクエスト

  • postfix_smtp_tls_note_starttls_offer [デフォルト: true]: そのサーバーに対してTLSがすでに有効でない場合、STARTTLSを提供するリモートSMTPサーバーのホスト名をログに記録

  • postfix_smtp_tls_cafile [オプション]: リモートSMTPサーバーの証明書または中間CA証明書を署名するために信頼されるルートCAのCA証明書を含むファイル(例: /etc/ssl/certs/ca-certificates.crt

  • postfix_smtpd_banner [デフォルト: $myhostname ESMTP $mail_name (Ubuntu)]: 挨拶のバナー テキストの最初に必ず$myhostnameを指定してください。これはSMTPプロトコルで必要です。

  • postfix_disable_vrfy_command [デフォルト: true]: SMTP VRFYコマンドを無効にします。これにより、メールアドレス採取に使用される技術のいくつかを防ぎます

  • postfix_message_size_limit [デフォルト: 10240000]: メッセージの最大サイズ(バイト数で、エンベロープ情報を含む)

  • postfix_smtpd_tls_cert_file [デフォルト: /etc/ssl/certs/ssl-cert-snakeoil.pem]: 証明書ファイルへのパス

  • postfix_smtpd_tls_key_file [デフォルト: /etc/ssl/certs/ssl-cert-snakeoil.key]: キーファイルへのパス

  • postfix_smtpd_security_level [オプション]: Postfix SMTPサーバーのSMTP TLSセキュリティレベル

  • postfix_smtp_tls_mandatory_ciphers [オプション]: Postfix SMTPクライアントが使用する必須TLSの最小暗号グレード

  • postfix_smtp_tls_mandatory_protocols [オプション]: Postfix SMTPクライアントが使用する必須TLS暗号化に関するTLSプロトコル

  • postfix_smtp_tls_protocols [オプション]: Postfix SMTPクライアントが使用する機会主義的TLS暗号化に関するTLSプロトコル

  • postfix_smtpd_tls_mandatory_ciphers [オプション]: Postfix SMTPサーバーが使用する必須TLS暗号化に関する最小暗号グレード

  • postfix_smtpd_tls_mandatory_protocols [オプション]: Postfix SMTPサーバーが必須TLS暗号化で受け入れるTLSプロトコル

  • postfix_smtpd_tls_protocols [オプション]: Postfix SMTPサーバーが機会主義的TLS暗号化で受け入れるTLSプロトコル

  • postfix_raw_options [デフォルト: []]: 追加の(未サポートの)設定を渡すための行のリスト

依存関係

  • debconf
  • debconf-utils

SASLリレーを使用しないシンプルな例:

---
- hosts: all
  roles:
    - oefenweb.postfix
  vars:
    postfix_aliases:
      - user: root
        alias: [email protected]

SASLリレーを使用しないメール転送のための仮想エイリアスを含むシンプルな例:

---
- hosts: all
  roles:
    - oefenweb.postfix
  vars:
    postfix_mydestination:
      - "{{ postfix_hostname }}"
      - '$mydomain'
      - localdomain
      - localhost
      - localhost.localdomain
    postfix_virtual_aliases:
      - virtual: [email protected]
        alias: [email protected]
      - virtual: [email protected]
        alias: [email protected], [email protected]

送信者アドレスを書き換えるシンプルな例:

---
- hosts: all
  roles:
    - oefenweb.postfix
  vars:
    postfix_sender_canonical_maps:
      - sender: root
        rewrite: [email protected]

リレーを有効にするためにリレーホスト名を指定する:

---
- hosts: all
  roles:
    - oefenweb.postfix
  vars:
    postfix_aliases:
      - user: root
        alias: [email protected]
    postfix_relayhost: mail.yourdomain.org

リレー用のドメイン名を提供し、ドメインのDNS MXレコードを使用するには:

---
- hosts: all
  roles:
    - oefenweb.postfix
  vars:
    postfix_aliases:
      - user: root
        alias: [email protected]
    postfix_relayhost: yourdomain.org
    postfix_relayhost_mxlookup: true

条件付きリレー:

---
- hosts: all
  roles:
    - oefenweb.postfix
  vars:
    postfix_transport_maps:
      - pattern: '[email protected]'
        result: ':'
      - pattern: '*'
        result: "smtp:{{ ansible_lo['ipv4']['address'] }}:1025"
    postfix_sender_dependent_relayhost_maps:
      - pattern: '[email protected]'
        result: 'DUNNO'
      - pattern: '[email protected]'
        result: 'DUNNO'
      - pattern: '*'
        result: "smtp:{{ ansible_lo['ipv4']['address'] }}:1025"

正規表現テーブルを使用したエイリアス(すべてのローカルメールを指定されたアドレスに転送):

---
- hosts: all
  roles:
    - oefenweb.postfix
  vars:
    postfix_aliases_database_type: regexp
    postfix_aliases:
      - user: /.*/
        alias: [email protected]

AWS SESのサポート用:

---
- hosts: all
  roles:
    - oefenweb.postfix
  vars:
    postfix_aliases:
      - user: root
        alias: [email protected]
    postfix_relayhost: email-smtp.us-east-1.amazonaws.com
    postfix_relaytls: true
    # AWS IAM SESの資格情報(アクセスキーではない):
    postfix_sasl_user: AKIXXXXXXXXXXXXXXXXX
    postfix_sasl_password: ASDFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

MailHogのサポート用:

---
- hosts: all
  roles:
    - oefenweb.postfix
  vars:
    postfix_aliases:
      - user: root
        alias: [email protected]
    postfix_relayhost: "{{ ansible_lo['ipv4']['address'] }}"
    postfix_relayhost_port: 1025
    postfix_sasl_auth_enable: false

Gmailのサポート用:

---
- hosts: all
  roles:
    - oefenweb.postfix
  vars:
    postfix_aliases:
      - user: root
        alias: [email protected]
    postfix_relayhost: smtp.gmail.com
    postfix_relaytls: true
    postfix_smtp_tls_cafile: /etc/ssl/certs/ca-certificates.crt
    postfix_sasl_user: 'foo'
    postfix_sasl_password: 'bar'

Googleアカウントの設定で追加のセキュリティを有効にし、2段階認証を使用するように設定した場合、Postfixはメールを送信できなくなり、/var/log/mail.logファイルにエラーメッセージが表示されることがあります。

この問題を解決するには、Googleアカウント設定の(アプリとサイトの許可)ページを訪問します。このページで、許可するアプリケーション名(Postfix)を入力し、生成ボタンをクリックします。生成されたパスワードでpostfix_sasl_password変数を設定します。

未処理の設定を追加する方法を示すシンプルな例:

---
- hosts: all
  roles:
    - oefenweb.postfix
  vars:
    postfix_raw_options:
      - |
        milter_default_action = accept
        milter_protocol = 6
        smtpd_milters = unix:opendkim/opendkim.sock unix:opendmarc/opendmarc.sock unix:spamass/spamass.sock unix:clamav/clamav-milter.ctl
        milter_connect_macros = "i j {daemon_name} v {if_name} _"
        policyd-spf_time_limit = 3600

ライセンス

MIT

著者情報

Mischa ter Smitten

フィードバック、バグレポート、リクエスト...

歓迎します!

プロジェクトについて

Set up a postfix server in Debian-like systems

インストール
ansible-galaxy install Oefenweb.postfix
ライセンス
mit
ダウンロード
344.4k
所有者