{"id":4,"date":"2018-04-25T10:21:50","date_gmt":"2018-04-25T10:21:50","guid":{"rendered":"https:\/\/ubuntu.science\/?p=4"},"modified":"2022-04-02T11:07:56","modified_gmt":"2022-04-02T09:07:56","slug":"comment-installer-postfix-tls-sur-ubuntu-16-04","status":"publish","type":"post","link":"https:\/\/rootfan.com\/fr\/how-to-install-postfix-tls-on-ubuntu-16-04\/","title":{"rendered":"Comment installer Postfix avec TLS sur Ubuntu 16.04"},"content":{"rendered":"<p>Premi\u00e8re installation de Postfix et de mailutils<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code\" data-no-translation=\"\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\napt-get install postfix mailutils\n<\/pre><\/div>\n\n\n<p>G\u00e9n\u00e9rer des certificats \u00e0 utiliser pour le cryptage TLS et\/ou l'authentification par certificat :<\/p>\n\n\n\n<!--more-->\n\n\n<div class=\"wp-block-syntaxhighlighter-code\" data-no-translation=\"\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ntouch smtpd.key\nchmod 600 smtpd.key\nopenssl genrsa 1024 &gt; smtpd.key\nopenssl req -new -key smtpd.key -x509 -days 3650 -out smtpd.crt # has prompts\nopenssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 3650 # has prompts\nmv smtpd.key \/etc\/ssl\/private\/\nmv smtpd.crt \/etc\/ssl\/certs\/\nmv cakey.pem \/etc\/ssl\/private\/\nmv cacert.pem \/etc\/ssl\/certs\/\n<\/pre><\/div>\n\n\n<p>Lorsque vous obtenez ce r\u00e9sultat (la deuxi\u00e8me \u00e9tape), vous entrez une phrase de passe de votre choix.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code\" data-no-translation=\"\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nEnter PEM pass phrase:\n<\/pre><\/div>\n\n\n<p>Configurez Postfix pour qu'il utilise le cryptage TLS pour le courrier entrant et sortant :<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code\" data-no-translation=\"\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npostconf -e 'smtp_tls_security_level = may'\npostconf -e 'smtpd_tls_security_level = may'\npostconf -e 'smtpd_tls_auth_only = no'\npostconf -e 'smtp_tls_note_starttls_offer = yes'\npostconf -e 'smtpd_tls_key_file = \/etc\/ssl\/private\/smtpd.key'\npostconf -e 'smtpd_tls_cert_file = \/etc\/ssl\/certs\/smtpd.crt'\npostconf -e 'smtpd_tls_CAfile = \/etc\/ssl\/certs\/cacert.pem'\npostconf -e 'smtpd_tls_loglevel = 1'\npostconf -e 'smtpd_tls_received_header = yes'\npostconf -e 'smtpd_tls_session_cache_timeout = 3600s'\npostconf -e 'tls_random_source = dev:\/dev\/urandom'\npostconf -e 'myhostname = server1.example.com' # remember to change this to yours\n<\/pre><\/div>\n\n\n<p>Je vous recommande \u00e9galement de le faire, sinon vous risquez d'avoir des probl\u00e8mes lors de l'envoi avec l'ipv6.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code\" data-no-translation=\"\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npostconf -e 'inet_protocols = ipv4'\n<\/pre><\/div>\n\n\n<p>Le nouveau fichier de configuration de Postfix est situ\u00e9 ici<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code\" data-no-translation=\"\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/etc\/postfix\/main.cf\n<\/pre><\/div>\n\n\n<p>Red\u00e9marrez Postfix avec cette commande<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code\" data-no-translation=\"\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/etc\/init.d\/postfix restart\n<\/pre><\/div>\n\n\n<p>Vous pouvez maintenant tester votre installation avec cette commande depuis la ligne de commande<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code\" data-no-translation=\"\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\necho \"Test mail from postfix\" | mail -s \"Test Postfix\" you@example.com\n<\/pre><\/div>\n\n\n<p>Et v\u00e9rifiez dans le journal que tout s'est bien pass\u00e9<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code\" data-no-translation=\"\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ntail -50 \/var\/log\/mail.log\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>Installez d'abord Postfix et mailutils G\u00e9n\u00e9rez les certificats \u00e0 utiliser pour le cryptage TLS et\/ou l'authentification par certificat :<\/p>","protected":false},"author":1,"featured_media":2832,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_focus_keyword":"","rank_math_title":"","rank_math_description":"Get a comprehensive tutorial on installing Postfix with TLS on Ubuntu 16.04 to set up a secure email server for your domain.","rank_math_robots":null,"rank_math_og_title":"","rank_math_og_description":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2],"tags":[3,4,29],"class_list":["post-4","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-postfix","tag-postfix","tag-tutorial","tag-ubuntu"],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/rootfan.com\/wp-content\/uploads\/noria.jpg?fit=2000%2C1200&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/rootfan.com\/fr\/wp-json\/wp\/v2\/posts\/4","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rootfan.com\/fr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rootfan.com\/fr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rootfan.com\/fr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rootfan.com\/fr\/wp-json\/wp\/v2\/comments?post=4"}],"version-history":[{"count":9,"href":"https:\/\/rootfan.com\/fr\/wp-json\/wp\/v2\/posts\/4\/revisions"}],"predecessor-version":[{"id":2845,"href":"https:\/\/rootfan.com\/fr\/wp-json\/wp\/v2\/posts\/4\/revisions\/2845"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rootfan.com\/fr\/wp-json\/wp\/v2\/media\/2832"}],"wp:attachment":[{"href":"https:\/\/rootfan.com\/fr\/wp-json\/wp\/v2\/media?parent=4"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rootfan.com\/fr\/wp-json\/wp\/v2\/categories?post=4"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rootfan.com\/fr\/wp-json\/wp\/v2\/tags?post=4"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}