main.cf.j2 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. {% if ansible_prolog -%}
  2. {% from 'templates/ansible/prolog.j2' import prolog with context %}
  3. {{ prolog() }}
  4. {% endif -%}
  5. # See /usr/share/postfix/main.cf.dist for a commented, more complete version
  6. # Debian specific: Specifying a file name will cause the first
  7. # line of that file to be used as the name. The Debian default
  8. # is /etc/mailname.
  9. smtpd_banner = $myhostname ESMTP $mail_name
  10. biff = no
  11. # appending .domain is the MUA's job.
  12. append_dot_mydomain = no
  13. # Uncomment the next line to generate "delayed mail" warnings
  14. #delay_warning_time = 4h
  15. readme_directory = no
  16. # TLS parameters
  17. smtpd_tls_security_level = may
  18. smtpd_tls_loglevel = 1
  19. smtpd_tls_received_header = yes
  20. smtpd_tls_ask_ccert = yes
  21. smtpd_tls_req_ccert = no
  22. smtpd_tls_auth_only = yes
  23. smtpd_tls_mandatory_ciphers = high
  24. smtpd_tls_mandatory_exclude_ciphers = aNULL, RC4, MD5
  25. smtpd_tls_protocols = !SSLv2, !SSLv3
  26. smtpd_tls_dh1024_param_file = /etc/ssl/private/dh2048.pem
  27. smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
  28. smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
  29. smtpd_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
  30. smtpd_tls_session_cache_timeout = 3600
  31. smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
  32. smtp_tls_security_level = may
  33. smtp_tls_loglevel = 1
  34. smtp_tls_note_starttls_offer = yes
  35. smtp_tls_cert_file = $smtpd_tls_cert_file
  36. smtp_tls_key_file = $smtpd_tls_key_file
  37. smtp_tls_mandatory_ciphers = $smtpd_tls_mandatory_ciphers
  38. smtp_tls_mandatory_exclude_ciphers = $smtpd_tls_mandatory_exclude_ciphers
  39. smtp_tls_protocols = $smtpd_tls_protocols
  40. smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
  41. smtp_tls_session_cache_timeout = 3600
  42. smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
  43. myhostname = {{ ansible_fqdn }}
  44. myorigin = $myhostname
  45. mydomain = $myhostname
  46. mydestination = {{ ansible_fqdn }} {{ ansible_hostname }}
  47. alias_maps = hash:/etc/aliases
  48. alias_database = $alias_maps
  49. {% if smtp_relay is defined %}
  50. relayhost = {{ smtp_relay }}
  51. {% endif %}
  52. mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
  53. mailbox_command = procmail -a "$EXTENSION"
  54. mailbox_size_limit = 0
  55. message_size_limit = 0
  56. recipient_delimiter = +
  57. inet_interfaces = all
  58. disable_vrfy_command = yes
  59. smtpd_recipient_restrictions =
  60. permit_mynetworks,
  61. reject_non_fqdn_sender,
  62. reject_unauth_pipelining,
  63. reject_non_fqdn_recipient,
  64. reject_unknown_sender_domain,
  65. reject_unauth_destination,
  66. reject_unknown_recipient_domain,
  67. permit
  68. smtpd_client_restrictions =
  69. permit_mynetworks,
  70. reject_unauth_destination
  71. smtpd_helo_required = yes
  72. smtpd_helo_restrictions =
  73. permit_mynetworks,
  74. reject_non_fqdn_helo_hostname
  75. smtpd_sender_restrictions =
  76. permit_mynetworks,
  77. reject_non_fqdn_sender,
  78. reject_unknown_sender_domain