Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

182 lines
5.4KB

  1. ###################################################################################################
  2. ### Base Settings ###
  3. #####################
  4. # Listen on all interfaces
  5. inet_interfaces = all
  6. # Use TCP IPv4
  7. inet_protocols = ipv4
  8. # Greet connecting clients with this banner
  9. smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
  10. # Fully-qualified hostname
  11. myhostname = mail.${DOMAIN}
  12. # Do not append domain part to incomplete addresses (this is the MUA's job)
  13. append_dot_mydomain = no
  14. # Trusted networks/hosts (these are allowed to relay without authentication)
  15. mynetworks =
  16. # Local
  17. 127.0.0.0/8
  18. # External
  19. #1.2.3.4/32
  20. ###################################################################################################
  21. ### Local Transport ###
  22. #######################
  23. # Disable local transport (so that system accounts can't receive mail)
  24. local_transport = error:Local Transport Disabled
  25. # Don't use local alias maps
  26. alias_maps =
  27. # Local domain (could be omitted, since it is automatically derived from $myhostname)
  28. mydomain = ${DOMAIN}
  29. # Mails for these domains will be transported locally
  30. mydestination =
  31. $myhostname
  32. localhost.$mydomain
  33. localhost
  34. ###################################################################################################
  35. ### Virtual Transport ###
  36. #########################
  37. # Deliver mail for virtual recipients to Dovecot
  38. virtual_transport = dovecot
  39. # Process one mail at one time
  40. dovecot_destination_recipient_limit = 1
  41. # Valid virtual domains
  42. virtual_mailbox_domains = hash:/etc/postfix/virtual_domains
  43. # Valid virtual recipients
  44. virtual_mailbox_maps = proxy:ldap:/etc/postfix/ldap_virtual_recipients.cf
  45. # Virtual aliases
  46. virtual_alias_maps = proxy:ldap:/etc/postfix/ldap_virtual_aliases.cf
  47. ###################################################################################################
  48. ### ESMTP Settings ###
  49. ######################
  50. ### SASL ###
  51. # Enable SASL (required for SMTP authentication)
  52. smtpd_sasl_auth_enable = yes
  53. # Enable SASL for Outlook-Clients as well
  54. broken_sasl_auth_clients = yes
  55. ### TLS ###
  56. # Enable TLS (required to encrypt the plaintext SASL authentication)
  57. smtpd_tls_security_level = may
  58. # Only offer SASL in a TLS session
  59. smtpd_tls_auth_only = yes
  60. # Certification Authority
  61. smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem
  62. # Public Certificate
  63. smtpd_tls_cert_file = /etc/ssl/certs/mail.domain.tld.crt
  64. # Private Key (without passphrase)
  65. smtpd_tls_key_file = /etc/ssl/private/mail.domain.tld.key
  66. # Randomizer for key creation
  67. tls_random_source = dev:/dev/urandom
  68. # TLS related logging (set to 2 for debugging)
  69. smtpd_tls_loglevel = 0
  70. # Avoid Denial-Of-Service-Attacks
  71. smtpd_client_new_tls_session_rate_limit = 10
  72. # Activate TLS Session Cache
  73. smtpd_tls_session_cache_database = btree:/etc/postfix/smtpd_session_cache
  74. # Deny some TLS-Ciphers
  75. smtpd_tls_exclude_ciphers =
  76. EXP
  77. EDH-RSA-DES-CBC-SHA
  78. ADH-DES-CBC-SHA
  79. DES-CBC-SHA
  80. SEED-SHA
  81. # Diffie-Hellman Parameters for Perfect Forward Secrecy
  82. # Can be created with:
  83. # openssl dhparam -2 -out dh_512.pem 512
  84. # openssl dhparam -2 -out dh_1024.pem 1024
  85. smtpd_tls_dh512_param_file = ${config_directory}/certs/dh_512.pem
  86. smtpd_tls_dh1024_param_file = ${config_directory}/certs/dh_1024.pem
  87. ###################################################################################################
  88. ### Connection Policies ###
  89. ###########################
  90. # Reject Early Talkers
  91. postscreen_greet_action = enforce
  92. ###################################################################################################
  93. ### Session Policies ###
  94. ########################
  95. # Recipient Restrictions (RCPT TO related)
  96. smtpd_recipient_restrictions =
  97. reject_non_fqdn_recipient
  98. reject_unknown_recipient_domain
  99. # Allow relaying for SASL authenticated clients and trusted hosts/networks
  100. # This can be put to smtpd_relay_restrictions in Postfix 2.10 and later
  101. permit_sasl_authenticated
  102. permit_mynetworks
  103. # If not authenticated or on mynetworks, reject mailing to external addresses
  104. reject_unauth_destination
  105. # Reject the following hosts
  106. check_sender_ns_access cidr:/etc/postfix/drop.cidr
  107. check_sender_mx_access cidr:/etc/postfix/drop.cidr
  108. # Additional blacklist
  109. reject_rbl_client ix.dnsbl.manitu.net
  110. # Finally permit (relaying still requires SASL auth)
  111. # WARNING: Due to this permit, everyone will be able to send emails to internal addresses without authentication. If this is set to reject though, the server does not receive emails from external addresses. Unfortunately I do not have a solution for this.
  112. permit
  113. # Reject the request if the sender is the null address and there are multiple recipients
  114. smtpd_data_restrictions = reject_multi_recipient_bounce
  115. # Sender Restrictions
  116. smtpd_sender_restrictions =
  117. reject_non_fqdn_sender
  118. reject_unknown_sender_domain
  119. # HELO/EHLO Restrictions
  120. smtpd_helo_restrictions =
  121. permit_mynetworks
  122. check_helo_access pcre:/etc/postfix/identitycheck.pcre
  123. #reject_non_fqdn_helo_hostname
  124. reject_invalid_hostname
  125. # Deny VRFY recipient checks
  126. disable_vrfy_command = yes
  127. # Require HELO
  128. smtpd_helo_required = yes
  129. # Reject instantly if a restriction applies (do not wait until RCPT TO)
  130. smtpd_delay_reject = no
  131. # Client Restrictions (IP Blacklist)
  132. smtpd_client_restrictions = check_client_access cidr:/etc/postfix/drop.cidr