Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

184 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. # 25 MB
  35. message_size_limit = 26214400
  36. ###################################################################################################
  37. ### Virtual Transport ###
  38. #########################
  39. # Deliver mail for virtual recipients to Dovecot
  40. virtual_transport = dovecot
  41. # Process one mail at one time
  42. dovecot_destination_recipient_limit = 1
  43. # Valid virtual domains
  44. virtual_mailbox_domains = hash:/etc/postfix/virtual_domains
  45. # Valid virtual recipients
  46. virtual_mailbox_maps = proxy:ldap:/etc/postfix/ldap_virtual_recipients.cf
  47. # Virtual aliases
  48. virtual_alias_maps = proxy:ldap:/etc/postfix/ldap_virtual_aliases.cf
  49. ###################################################################################################
  50. ### ESMTP Settings ###
  51. ######################
  52. ### SASL ###
  53. # Enable SASL (required for SMTP authentication)
  54. smtpd_sasl_auth_enable = yes
  55. # Enable SASL for Outlook-Clients as well
  56. broken_sasl_auth_clients = yes
  57. ### TLS ###
  58. # Enable TLS (required to encrypt the plaintext SASL authentication)
  59. smtpd_tls_security_level = may
  60. # Only offer SASL in a TLS session
  61. smtpd_tls_auth_only = yes
  62. # Certification Authority
  63. smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem
  64. # Public Certificate
  65. smtpd_tls_cert_file = /etc/ssl/certs/mail.domain.tld.crt
  66. # Private Key (without passphrase)
  67. smtpd_tls_key_file = /etc/ssl/private/mail.domain.tld.key
  68. # Randomizer for key creation
  69. tls_random_source = dev:/dev/urandom
  70. # TLS related logging (set to 2 for debugging)
  71. smtpd_tls_loglevel = 0
  72. # Avoid Denial-Of-Service-Attacks
  73. smtpd_client_new_tls_session_rate_limit = 10
  74. # Activate TLS Session Cache
  75. smtpd_tls_session_cache_database = btree:/etc/postfix/smtpd_session_cache
  76. # Deny some TLS-Ciphers
  77. smtpd_tls_exclude_ciphers =
  78. EXP
  79. EDH-RSA-DES-CBC-SHA
  80. ADH-DES-CBC-SHA
  81. DES-CBC-SHA
  82. SEED-SHA
  83. # Diffie-Hellman Parameters for Perfect Forward Secrecy
  84. # Can be created with:
  85. # openssl dhparam -2 -out dh_512.pem 512
  86. # openssl dhparam -2 -out dh_1024.pem 1024
  87. smtpd_tls_dh512_param_file = ${config_directory}/certs/dh_512.pem
  88. smtpd_tls_dh1024_param_file = ${config_directory}/certs/dh_1024.pem
  89. ###################################################################################################
  90. ### Connection Policies ###
  91. ###########################
  92. # Reject Early Talkers
  93. postscreen_greet_action = enforce
  94. ###################################################################################################
  95. ### Session Policies ###
  96. ########################
  97. # Recipient Restrictions (RCPT TO related)
  98. smtpd_recipient_restrictions =
  99. reject_non_fqdn_recipient
  100. reject_unknown_recipient_domain
  101. # Allow relaying for SASL authenticated clients and trusted hosts/networks
  102. # This can be put to smtpd_relay_restrictions in Postfix 2.10 and later
  103. permit_sasl_authenticated
  104. permit_mynetworks
  105. # If not authenticated or on mynetworks, reject mailing to external addresses
  106. reject_unauth_destination
  107. # Reject the following hosts
  108. check_sender_ns_access cidr:/etc/postfix/drop.cidr
  109. check_sender_mx_access cidr:/etc/postfix/drop.cidr
  110. # Additional blacklist
  111. reject_rbl_client ix.dnsbl.manitu.net
  112. # Finally permit (relaying still requires SASL auth)
  113. # 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.
  114. permit
  115. # Reject the request if the sender is the null address and there are multiple recipients
  116. smtpd_data_restrictions = reject_multi_recipient_bounce
  117. # Sender Restrictions
  118. smtpd_sender_restrictions =
  119. reject_non_fqdn_sender
  120. reject_unknown_sender_domain
  121. # HELO/EHLO Restrictions
  122. smtpd_helo_restrictions =
  123. permit_mynetworks
  124. check_helo_access pcre:/etc/postfix/identitycheck.pcre
  125. #reject_non_fqdn_helo_hostname
  126. reject_invalid_hostname
  127. # Deny VRFY recipient checks
  128. disable_vrfy_command = yes
  129. # Require HELO
  130. smtpd_helo_required = yes
  131. # Reject instantly if a restriction applies (do not wait until RCPT TO)
  132. smtpd_delay_reject = no
  133. # Client Restrictions (IP Blacklist)
  134. smtpd_client_restrictions = check_client_access cidr:/etc/postfix/drop.cidr