main.cf.j2 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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_use_tls = yes
  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_session_cache_timeout = 3600
  23. smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
  24. smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
  25. smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
  26. smtp_use_tls = yes
  27. smtp_tls_loglevel = 1
  28. smtp_tls_note_starttls_offer = yes
  29. smtp_tls_session_cache_timeout = 3600
  30. smtp_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
  31. smtp_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
  32. smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
  33. myhostname = {{ ansible_fqdn }}
  34. myorigin = $myhostname
  35. mydomain = $myhostname
  36. mydestination = {{ ansible_fqdn }} {{ ansible_hostname }}
  37. alias_maps = hash:/etc/aliases
  38. alias_database = $alias_maps
  39. {% if smtp_relay is defined %}
  40. relayhost = {{ smtp_relay }}
  41. {% endif %}
  42. mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
  43. mailbox_command = procmail -a "$EXTENSION"
  44. mailbox_size_limit = 0
  45. message_size_limit = 0
  46. recipient_delimiter = +
  47. inet_interfaces = all
  48. disable_vrfy_command = yes
  49. smtpd_recipient_restrictions =
  50. permit_mynetworks,
  51. reject_non_fqdn_sender,
  52. reject_unauth_pipelining,
  53. reject_non_fqdn_recipient,
  54. reject_unknown_sender_domain,
  55. reject_unauth_destination,
  56. reject_unknown_recipient_domain,
  57. permit
  58. smtpd_client_restrictions =
  59. permit_mynetworks,
  60. reject_unauth_destination
  61. smtpd_helo_required = yes
  62. smtpd_helo_restrictions =
  63. permit_mynetworks,
  64. reject_non_fqdn_helo_hostname
  65. smtpd_sender_restrictions =
  66. permit_mynetworks,
  67. reject_non_fqdn_sender,
  68. reject_unknown_sender_domain