bobnethu

main.cf

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