
{"id":1631,"date":"2025-02-17T23:06:51","date_gmt":"2025-02-17T12:06:51","guid":{"rendered":"https:\/\/www.hogepiyo.com\/wp\/?p=1631"},"modified":"2025-02-17T23:06:53","modified_gmt":"2025-02-17T12:06:53","slug":"postfix-%e3%81%a7%e3%83%a1%e3%83%bc%e3%83%ab%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%82%92%e6%a7%8b%e7%af%89","status":"publish","type":"post","link":"https:\/\/www.hogepiyo.com\/wp\/?p=1631","title":{"rendered":"Postfix \u3067\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0\u30fc\u3092\u69cb\u7bc9"},"content":{"rendered":"\n<p>Postfix \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002\u4eca\u56de\u306f\u9001\u4fe1\u5c02\u7528\u3068\u3057\u3066\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<dl class=\"definition-table\">\n<dt>\u30b5\u30fc\u30d0\u30fc<\/dt>\n<dd>LXD \u30b2\u30b9\u30c8<\/dd>\n<dt>CPU<\/dt>\n<dd>2\u30b3\u30a2<\/dd>\n<dt>\u30e1\u30e2\u30ea\u30fc<\/dt>\n<dd>4GB<\/dd>\n<dt>OS<\/dt>\n<dd>Ubuntu Server 24.04 LTS 64Bit<\/dd>\n<\/dl>\n\n\n\n<figure class=\"wp-block-table\">\n<table style=\"width: 100%; height: 70px;\">\n<thead>\n<tr style=\"height: 36px;\">\n<th style=\"height: 36px;\">apt \u30d1\u30c3\u30b1\u30fc\u30b8<\/th>\n<th style=\"height: 36px;\">\u30d0\u30fc\u30b8\u30e7\u30f3<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"height: 34px;\">\n<td style=\"height: 34px;\">postfix<\/td>\n<td style=\"height: 34px;\">3.8.6-1build2 amd64<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">\u30b3\u30f3\u30c6\u30f3\u30c4<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69f3552781cb7\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69f3552781cb7\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.hogepiyo.com\/wp\/?p=1631\/#%E3%83%91%E3%83%83%E3%82%B1%E3%83%BC%E3%82%B8%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB\" >\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.hogepiyo.com\/wp\/?p=1631\/#Postfix_%E3%82%92%E8%A8%AD%E5%AE%9A\" >Postfix \u3092\u8a2d\u5b9a<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.hogepiyo.com\/wp\/?p=1631\/#%E3%83%A1%E3%83%BC%E3%83%AB%E9%80%81%E4%BF%A1%E3%83%86%E3%82%B9%E3%83%88\" >\u30e1\u30fc\u30eb\u9001\u4fe1\u30c6\u30b9\u30c8<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.hogepiyo.com\/wp\/?p=1631\/#%E5%8F%82%E8%80%83\" >\u53c2\u8003<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E3%83%91%E3%83%83%E3%82%B1%E3%83%BC%E3%82%B8%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB\"><\/span>\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067 Postfix \u3092\u30a4\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install postfix<\/code><\/pre>\n\n\n\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u4e2d\u306b\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3092\u30a6\u30a3\u30b6\u30fc\u30c9\u3067\u78ba\u8a8d\u3055\u308c\u308b\u306e\u3067\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>General mail configuration type: Internet Site<\/p>\n\n\n\n<p>System mail name: \u00a0example.com<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Postfix_%E3%82%92%E8%A8%AD%E5%AE%9A\"><\/span>Postfix \u3092\u8a2d\u5b9a<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30a6\u30a3\u30fc\u30b6\u30fc\u30c9\u3092\u4f7f\u3063\u3066 Postfix \u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dpkg-reconfigure postfix<\/code><\/pre>\n\n\n\n<p>Recipient for root and postmaster mail: &lt;USER_NAME><\/p>\n\n\n\n<p>Other destinations to accept mail for (blank for none):\u00a0 &lt;DOMAIN><\/p>\n\n\n\n<p>Force synchronous updates on mail queue? No<\/p>\n\n\n\n<p>Local networks: 127.0.0.0\/8 [::ffff:127.0.0.0]\/104 [::1]\/128 192.168.1.0\/24<\/p>\n\n\n\n<p>Mailbox size limit (bytes):\u00a00<\/p>\n\n\n\n<p>Local address extension character: +<\/p>\n\n\n\n<p>Internet protocols to use: all<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30e1\u30fc\u30eb\u30dc\u30c3\u30af\u30b9\u5f62\u5f0f\u3092 Maildir \u306b\u5909\u66f4\u3057\u307e\u3059\u3002\u5b9f\u969b\u306e\u8a2d\u5b9a\u5024\u306f \/etc\/postfix\/main.cf \u306b\u4fdd\u5b58\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u76f4\u63a5\u7de8\u96c6\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo postconf -e 'home_mailbox = Maildir\/'<\/code><\/pre>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u5916\u90e8\u304b\u3089\u306e\u63a5\u7d9a\u3092\u7121\u52b9\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo postconf -e 'inet_interfaces = loopback-only'<\/code><\/pre>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067 TLS \u306e\u8a2d\u5b9a\u3092\u3057\u307e\u3059\u3002Let&#8217;s Encrypt \u3067\u767a\u884c\u3055\u308c\u305f\u7121\u6599 SSL \u8a3c\u660e\u66f8\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo postconf -e 'smtp_tls_security_level = may'\nsudo postconf -e 'smtpd_tls_security_level = may'\nsudo postconf -e 'smtp_tls_note_starttls_offer = yes'\nsudo postconf -e 'smtpd_tls_key_file = \/etc\/letsencrypt\/live\/<strong>foo.example.com<\/strong>\/privkey.pem'\nsudo postconf -e 'smtpd_tls_cert_file = \/etc\/letsencrypt\/live\/<strong>foo.example.com<\/strong>\/cert.pem'\nsudo postconf -e 'smtpd_tls_loglevel = 1'\nsudo postconf -e 'smtpd_tls_received_header = yes'\nsudo postconf -e 'myhostname = <strong>mail.example.com<\/strong>'<\/code><\/pre>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067 Postfix \u3092\u518d\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart postfix.service<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E3%83%A1%E3%83%BC%E3%83%AB%E9%80%81%E4%BF%A1%E3%83%86%E3%82%B9%E3%83%88\"><\/span>\u30e1\u30fc\u30eb\u9001\u4fe1\u30c6\u30b9\u30c8<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3057\u3066\u30c6\u30b9\u30c8\u3057\u307e\u3059\u3002From \u30a2\u30c9\u30ec\u30b9\u3092\u9069\u5207\u306b\u8a2d\u5b9a\u3057\u306a\u3044\u3068\u53d7\u4fe1\u5074\u3067\u30b9\u30d1\u30e0\u30e1\u30fc\u30eb\u3068\u3057\u3066\u8b58\u5225\u3055\u308c\u308b\u6050\u308c\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sendmail -t &lt;&lt;EOF\nFrom: sender@example.com\nTo: recipient@example.com\nSubject: \u30c6\u30b9\u30c8\u30e1\u30fc\u30eb\n\n\u3053\u308c\u306f\u30c6\u30b9\u30c8\u30e1\u30fc\u30eb\u306e\u672c\u6587\u3067\u3059\u3002\nEOF<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%8F%82%E8%80%83\"><\/span>\u53c2\u8003<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/ubuntu.com\/server\/docs\/install-and-configure-postfix\" title=\"\">Install and configure Postfix | Ubuntu<\/a><\/li>\n<\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Postfix \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002\u4eca\u56de\u306f\u9001\u4fe1\u5c02\u7528\u3068\u3057\u3066\u8a2d\u5b9a\u3057\u307e\u3059\u3002 \u30b5\u30fc\u30d0\u30fc LXD \u30b2\u30b9\u30c8 CPU 2\u30b3\u30a2 \u30e1\u30e2\u30ea\u30fc 4GB OS Ubuntu Server 24.04 L &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.hogepiyo.com\/wp\/?p=1631\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Postfix \u3067\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0\u30fc\u3092\u69cb\u7bc9&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[260],"tags":[274,264,266,270],"class_list":["post-1631","post","type-post","status-publish","format-standard","hentry","category-ubuntu-24-04-lts-server","tag-postfix-ja","tag-ubuntu-24-04","tag--ja","tag-270"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hogepiyo.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1631","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hogepiyo.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hogepiyo.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hogepiyo.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hogepiyo.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1631"}],"version-history":[{"count":7,"href":"https:\/\/www.hogepiyo.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1631\/revisions"}],"predecessor-version":[{"id":1638,"href":"https:\/\/www.hogepiyo.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1631\/revisions\/1638"}],"wp:attachment":[{"href":"https:\/\/www.hogepiyo.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1631"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hogepiyo.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1631"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hogepiyo.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}