main.cf.j2 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
  18. smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
  19. smtpd_use_tls=yes
  20. smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
  21. smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
  22. # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
  23. # information on enabling SSL in the smtp client.
  24. myhostname = {{ ansible_fqdn }}
  25. myorigin = $myhostname
  26. mydomain = $myhostname
  27. mydestination = {{ ansible_fqdn }} {{ ansible_hostname }}
  28. alias_maps = hash:/etc/aliases
  29. alias_database = $alias_maps
  30. {% if smtp_relay is defined %}
  31. relayhost = {{ smtp_relay }}
  32. {% endif %}
  33. mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
  34. mailbox_command = procmail -a "$EXTENSION"
  35. mailbox_size_limit = 0
  36. message_size_limit = 0
  37. recipient_delimiter = +
  38. inet_interfaces = all
  39. disable_vrfy_command = yes
  40. smtpd_recipient_restrictions =
  41. permit_mynetworks,
  42. reject_non_fqdn_sender,
  43. reject_unauth_pipelining,
  44. reject_non_fqdn_recipient,
  45. reject_unknown_sender_domain,
  46. reject_unauth_destination,
  47. reject_unknown_recipient_domain,
  48. permit
  49. smtpd_client_restrictions =
  50. permit_mynetworks,
  51. reject_unauth_destination
  52. smtpd_helo_required = yes
  53. smtpd_helo_restrictions =
  54. permit_mynetworks,
  55. reject_non_fqdn_helo_hostname
  56. smtpd_sender_restrictions =
  57. permit_mynetworks,
  58. reject_non_fqdn_sender,
  59. reject_unknown_sender_domain