Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ---------------------------------------------------------
- # See /usr/share/postfix/main.cf.dist for a commented, more complete version
- # ---------------------------------------------------------
- # Debian specific: Specifying a file name will cause the first
- # line of that file to be used as the name. The Debian default
- # is /etc/mailname.
- # 29/12/2016: Optimisation Postfix
- # http://postfix.traduc.org/index.php/TUNING_README.html
- #myorigin = /etc/mailname
- smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
- biff = no
- # Limite de taille pour 1 EMAIL
- message_size_limit = 51200000
- # appending .domain is the MUA's job.
- append_dot_mydomain = no
- # Uncomment the next line to generate "delayed mail" warnings
- #delay_warning_time = 4h
- # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
- # information on enabling SSL in the smtp client.
- myhostname = apollo.kerv.fr
- alias_maps = hash:/etc/aliases,hash:/etc/mail/sympa/aliases
- alias_database = hash:/etc/aliases,hash:/etc/mail/sympa/aliases
- myorigin = /etc/mailname
- mydestination = localhost
- relayhost =
- mynetworks = 127.0.0.0/8 99.000.000.111 99.000.000.222
- mailbox_command =
- mailbox_size_limit = 0
- inet_interfaces = all
- readme_directory = no
- # Ajout de quelques drectives
- # http://www.cyberciti.biz/tips/postfix-spam-filtering-with-blacklists-howto.html
- #
- disable_vrfy_command = yes
- # ---------------------------------------------------------
- # default
- # ---------------------------------------------------------
- default_destination_recipient_limit = 100
- #default_process_limit = 10
- default_process_limit = 30
- # https://www.skyminds.net/serveur-dedie-ajouter-lauthentification-spf-sender-id-et-dkim-a-postfix-et-bind9-avec-opendkim/
- # This means that postfix will up to two concurrent
- # connections per receiving domains. The default value is 20.
- #default_destination_concurrency_limit = 5
- # Postfix will add a delay between each message to the same receiving domain.
- # default_destination_rate_delay = 5s
- # Limit the number of recipients of each message.
- # If a message had 20 recipients on the same domain, postfix will break it out
- #default_extra_recipient_limit = 3
- # ---------------------------------------------------------
- # Slow
- # ---------------------------------------------------------
- slow_destination_recipient_limit = 20
- slow_destination_concurrency_limit = 2
- transport_maps = hash:/etc/postfix/transport
- # ---------------------------------------------------------
- # POSTSCREEN
- # ---------------------------------------------------------
- # == https://effraie.org/doc/serveur/archi_mail#combattre_le_spampostscreen_amavis_spamassassin_et_clamav
- postscreen_access_list = permit_mynetworks
- postscreen_dnsbl_sites = zen.spamhaus.org*3
- b.barracudacentral.org*2
- bl.spameatingmonkey.net*2
- dnsbl.ahbl.org*2
- bl.spamcop.net
- dnsbl.sorbs.net
- psbl.surriel.com
- bl.mailspike.net
- swl.spamhaus.org*-4
- list.dnswl.org=127.[0..255].[0..255].0*-2
- list.dnswl.org=127.[0..255].[0..255].1*-3
- list.dnswl.org=127.[0..255].[0..255].[2..255]*-4
- postscreen_dnsbl_threshold = 3
- postscreen_dnsbl_action = enforce
- postscreen_greet_banner = You have to respect RFCs
- postscreen_greet_action = enforce
- # ========== Il semble queles règles sont passées l'une après l'autre donc l'ordre à une importance
- # ========== https://effraie.org/doc/serveur/archi_mail#combattre_le_spampostscreen_amavis_spamassassin_et_clamav
- # Restrictions smtpd
- # http://postfix.traduc.org/index.php/SMTPD_ACCESS_README.html
- # smtpd_sender_restrictions = reject_unknown_sender_domain
- smtpd_recipient_restrictions =
- # Whitelist & Blacklist
- check_client_access hash:/etc/postfix/client_checks,
- check_sender_access hash:/etc/postfix/sender_checks,
- # --- ces régles sont pour tous:
- # reject_non_fqdn_recipient,
- reject_non_fqdn_sender,
- reject_unknown_recipient_domain,
- reject_unknown_sender_domain,
- reject_unauth_pipelining,
- # --- mes utilisateurs:
- permit_mynetworks,
- permit_sasl_authenticated,
- # --- Bloquer quand il n'y a pas de reverse DNS
- reject_unknown_reverse_client_hostname,
- # --- Bloquer quand le HELO/EHLO-hostnames est mal configuré
- reject_non_fqdn_hostname,
- # 15/10/2015-01:09= remis en fonction: reject_invalid_hostname,
- reject_invalid_hostname,
- reject_invalid_helo_hostname,
- # --- Test des RBL List
- # reject_rbl_client list.dsbl.org, # warning: 187.126.227.212.list.dsbl.org: RBL lookup error: Host or domain name not found. Name service error for name=187.126.227.212.list.dsbl.org type=A: Host not found
- reject_rbl_client sbl.spamhaus.org,
- reject_rbl_client cbl.abuseat.org,
- reject_rbl_client dul.dnsbl.sorbs.net,
- # --- Je ne suis pas responsable de ça :
- reject_unauth_destination,
- # --- SPF - POLICY - postfix-policyd-spf-perl
- # https://www.howtoforge.com/postfix_spf
- check_policy_service unix:private/policy,
- # --- Greylisting
- # 15/09/16 supprimé car le service deconne - de toute manière, je voulais l'enlever !
- # check_policy_service inet:127.0.0.1:10023,
- # 15/09/16 (TEST) Suite MAJ postgrey qui prend en charge l'IP v6
- # http://serverfault.com/questions/471581/postfix-warning-connect-to-127-0-0-110023-connection-refused-not-receiving
- # 15/09/16 : ne fonctionne toujours pas
- # check_policy_service inet:11.22.33.44:10023,
- # --- Si tous ça est ok,
- # permit
- # ----------------------------------------------------
- # ---------------------------------------------------------
- # SYMPA - Mailing List
- # 26/11/2016
- # ---------------------------------------------------------
- transport_maps = regexp:/etc/postfix/transport_regexp
- sympa_destination_recipient_limit = 1
- sympabounce_destination_recipient_limit = 1
- recipient_delimiter = +
- # ---------------------------------------------------------
- # DOVECOT
- # ---------------------------------------------------------
- virtual_transport = dovecot
- dovecot_destination_recipient_limit = 1
- # virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
- # virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
- # virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
- virtual_mailbox_domains = proxy:mysql:/etc/postfix/sql/mysql_virtual_domains_maps.cf
- virtual_alias_maps =
- proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_maps.cf,
- proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_maps.cf,
- proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_catchall_maps.cf
- #hash:/etc/mail/sympa/aliases
- virtual_mailbox_maps =
- proxy:mysql:/etc/postfix/sql/mysql_virtual_mailbox_maps.cf,
- proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_mailbox_maps.cf
- # ---------------------------------------------------------
- # Additional for quota support
- # ---------------------------------------------------------
- # virtual_create_maildirsize = yes
- # virtual_mailbox_extended = yes
- # virtual_mailbox_limit_maps = mysql:/etc/postfix/sql/mysql_virtual_mailbox_limit_maps.cf
- # virtual_mailbox_limit_override = yes
- # virtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his diskspace quota, please try again later.
- # virtual_overquota_bounce = yes
- # http://debian-facile.org/doc:reseau:postfix ==> uniquement si PAS DOVECOT
- # virtual_uid_maps = static:5000
- # virtual_gid_maps = static:5000
- # virtual_mailbox_base = /home/vmail
- # ---------------------------------------------------------
- # OPENDKIM
- # ---------------------------------------------------------
- # http://lea-linux.org/documentations/DKIM_SPF_Postfix
- # Déplacé pour éviter la double signature dans master.cf -o smtpd_milters=inet:localhost:12345
- # double signature : http://serverfault.com/questions/475416/is-there-a-reason-why-dkim-signs-every-mail-twice
- # double signature : http://david.mercereau.info/motclef/postfix/
- # La ligne vide ci-dessous est indispensable
- # milter_default_action = accept
- # milter_protocol = 6
- # smtpd_milters =
- # smtpd_milters = inet:localhost:12345
- # non_smtpd_milters = inet:localhost:12345
- # ---------------------------------------------------------
- # SASL parameters
- # ---------------------------------------------------------
- # En commun avec le tutoriel= http://www.tictech.info/post/mail_postfix
- # Use Dovecot to authenticate.
- smtpd_sasl_type = dovecot
- # Referring to /var/spool/postfix/private/auth
- smtpd_sasl_path = private/auth
- smtpd_sasl_auth_enable = yes
- broken_sasl_auth_clients = yes
- smtpd_sasl_security_options = noanonymous
- smtpd_sasl_local_domain =
- smtpd_sasl_authenticated_header = yes
- # ---------------------------------------------------------
- # TLS parameters
- # ---------------------------------------------------------
- # smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
- # smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
- # smtpd_use_tls=yes
- smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
- smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
- # Replace this with your SSL certificate path if you are using one.
- #smtpd_tls_cert_file=/etc/openssl/CERTIFICATES/monserveur.mail.fr_cert.cert
- #smtpd_tls_key_file=/etc/openssl/PRIVATE_KEYS/monserveur.mail.fr_key.pem
- # 28/12/2016: LetsEncrypt
- smtpd_tls_cert_file=/etc/letsencrypt/live/monserveur.mail.fr/fullchain.pem
- smtpd_tls_key_file=/etc/letsencrypt/live/monserveur.mail.fr/privkey.pem
- # The snakeoil self-signed certificate has no need for a CA file. But
- # if you are using your own SSL certificate, then you probably have
- # a CA certificate bundle from your provider. The path to that goes
- # here.
- #smtpd_tls_CAfile=/path/to/ca/file
- smtpd_use_tls = yes
- smtp_tls_security_level = may
- smtpd_tls_security_level = may
- smtpd_tls_auth_only = yes
- smtp_tls_note_starttls_offer = yes
- smtpd_tls_loglevel = 1
- smtpd_tls_received_header = yes
- smtpd_tls_session_cache_timeout = 3600s
- tls_random_source = dev:/dev/urandom
- #smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
- #smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
- inet_protocols = ipv4
- # ---------------------------------------------------------
- # Header manipulation
- # ---------------------------------------------------------
- enable_original_recipient = yes
- # https://www.debian-administration.org/article/168/Greylisting_with_Postfix_and_other_antispam_stuff.
- # That single one line change is estimated to stop 60% of spam!
- header_checks = regexp:/etc/postfix/header_checks.cf
- # ---------------------------------------------------------
- mime_header_checks = regexp:/etc/postfix/mime_header_checks.cf
- # ---------------------------------------------------------
- # Body manipulation
- # ---------------------------------------------------------
- body_checks = regexp:/etc/postfix/body_checks.cf
- # ---------------------------------------------------------
- # ---------------------------------------------------------
- # smtp_helo_restrictions
- # ---------------------------------------------------------
- # http://www.unixwiz.net/techtips/postfix-HELO.html
- smtpd_delay_reject = yes
- smtpd_helo_required = yes
- smtpd_helo_restrictions =
- permit_mynetworks,
- # reject_unknown_helo_hostname,
- check_helo_access hash:/etc/postfix/helo_access,
- permit
- # Rejeter le courrier provenant d'une adresse inexistante. Cette forme de filtrage aide à ralentir les vers et autres
- # logiciels malfaisant mais peut poser problème avec les applications maison qui envoient du courrier avec une adresse
- # inexistante. Pour cette raison, cette fonctionnalité est désactivée par défaut
- smtpd_reject_unlisted_sender = no
- # Rejeter le courrier à destination d'une adresse inexsistante. Cette forme de filtrage aide à garder la file d'attente
- # vide des messages non livrables MAILER-DAEMON messages. Cette fonctionnalité est activée par défaut
- smtpd_reject_unlisted_recipient = no
- # ---------------------------------------------------------
- # DMARC
- # ---------------------------------------------------------
- milter_default_action = accept
- milter_protocol = 6
- smtpd_milters = inet:127.0.0.1:8893
- non_smtpd_milters = inet:127.0.0.1:8893
- # non_smtpd_milters = $smtpd_milters
- # ---------------------------------------------------------
- # AMAVIS
- # ---------------------------------------------------------
- content_filter = amavis:[127.0.0.1]:10024
- receive_override_options = no_address_mappings
- # ---------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment