{"id":10999,"date":"2026-03-24T10:29:54","date_gmt":"2026-03-24T01:29:54","guid":{"rendered":"https:\/\/www.k-in.co.jp\/niwakan\/?p=10999"},"modified":"2026-03-24T10:29:54","modified_gmt":"2026-03-24T01:29:54","slug":"mail-server%e3%81%ae%e7%a7%bb%e8%a1%8c%ef%bc%88%e3%81%9d%e3%81%ae53%ef%bc%89postfix%e3%80%81dovecot%e3%81%ae%e5%86%8d%e6%a7%8b%e7%af%89","status":"publish","type":"post","link":"https:\/\/www.k-in.co.jp\/niwakan\/archives\/2026\/03\/10999\/","title":{"rendered":"mail server\u306e\u79fb\u884c\uff08\u305d\u306e53\uff09Postfix\u3001Dovecot\u306e\u518d\u69cb\u7bc9"},"content":{"rendered":"<p>\u53e4\u3044port\u6b8b\u3057\u3066\u3044\u305f\u305b\u3044\u3067\u3001\u3042\u3061\u3053\u3061\u306e\u4e0d\u6574\u5408\u304c\u51fa\u305f\u3002<br \/>\npostfix\u5468\u308a\u306e\u8a2d\u5b9a\u304c\u304a\u304b\u3057\u306a\u3053\u3068\u306b\u306a\u3063\u3066\u3044\u308b\u3088\u3046\u3060\u3002<br \/>\n\u4eca\u56de\u3082Gemini\u3055\u3093\u306b\u5168\u9762\u7684\u306b\u4f9d\u5b58\u3057\u3066\u4fee\u6b63\u3057\u3066\u3044\u308b\u3002<br \/>\n<!--more--><\/p>\n<p>local\u540c\u58eb\u3067\u306e\u30e1\u30fc\u30eb\u306e\u9063\u308a\u53d6\u308a\u304c\u304c\u3067\u304d\u306a\u3044\u3002<\/p>\n<pre class=\"height:300 lang:default decode:true\" title=\"\"># \u539f\u56e0\u3068\u306a\u308b\u8a2d\u5b9a\u4f8b\r\nsmtpd_helo_restrictions = \r\n    permit_mynetworks,\r\n    reject_unknown_helo_hostname,   <-- \u3053\u308c\u304c\u539f\u56e0\r\n    reject_invalid_helo_hostname,\r\n    permit<\/pre>\n<p>\u3053\u3053\u3092<\/p>\n<pre class=\"height:300 lang:default decode:true\" title=\"\">smtpd_helo_restrictions =\r\n    permit_mynetworks,\r\n    permit_sasl_authenticated,\r\n    reject_invalid_helo_hostname,\r\n    reject_non_fqdn_helo_hostname,\r\n    # reject_unknown_helo_hostname \u306f\u81ea\u5b85\u30b5\u30fc\u30d0\u30fc\u74b0\u5883\u3067\u306f\u7121\u52b9\u306b\u3059\u308b\u304b\u3001\r\n    # \u8a8d\u8a3c\u306e\u5f8c\u306b\u6301\u3063\u3066\u304f\u308b\u306e\u304c\u5b89\u5168\u3067\u3059\u3002\r\n    permit<\/pre>\n<p>\u3068\u76f4\u308b\u305d\u3046\u3060\u3002<br \/>\n\u3067\u3082\u30c0\u30e1\u3067\u3057\u305f\u301c\uff08\u6d99\uff09<\/p>\n<p>\u6b21\u306b\u63d0\u793a\u3055\u308c\u3066\u3044\u305f\u306e\u304c\u3001<\/p>\n<pre class=\"height:300 lang:default decode:true\" title=\"\"># master.cf \u306e\u4f8b\r\nsmtps     inet  n       -       n       -       -       smtpd\r\n  -o syslog_name=postfix\/smtps\r\n  -o smtpd_tls_wrappermode=yes\r\n  -o smtpd_sasl_auth_enable=yes\r\n  -o smtpd_helo_restrictions=reject_unknown_helo_hostname  <-- \u3053\u3053\u3067\u76f4\u63a5\u62d2\u5426\u8a2d\u5b9a\u304c\u66f8\u304b\u308c\u3066\u3044\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059<\/pre>\n<p>\u66f8\u304b\u308c\u3066\u3044\u307e\u3057\u305f\u301c(^_^;;<\/p>\n<p>\u3068\u4e91\u3046\u3053\u3068\u3067\u3001local\u3067\u306e\u30e1\u30fc\u30eb\u306f\u9001\u308b\u3053\u3068\u304c\u3067\u304d\u305f\u3002<br \/>\n\u6b21\u306bGmail\u306b\u9001\u308b\u3068\u3001<\/p>\n<div style=\"background: #F2EAD4; padding: 15px; border: 0px solid #F2EAD4; border-radius: 10px; word-break: break-all;\">host gmail-smtp-in.l.google.com[142.251.169.27] said:<br \/>\n   550-5.7.26 Your email has been blocked because the sender is<br \/>\n   unauthenticated. 550-5.7.26 Gmail requires all senders to authenticate with<br \/>\n   either SPF or DKIM. 550-5.7.26  550-5.7.26  Authentication results:<br \/>\n   550-5.7.26  DKIM = did not pass 550-5.7.26  SPF [k-in.co.jp] with ip:<br \/>\n   [219.117.245.33] = did not pass 550-5.7.26  550-5.7.26  For instructions on<br \/>\n   setting up authentication, go to 550 5.7.26<\/div>\n<p>\u3068\u5f3e\u304b\u308c\u305f\u3002<\/p>\n<p>SPF\uff1fDKIM\uff1f\uff1f\u4f55\u3060\u4f55\u3060\uff1f<br \/>\n\u3068\u306a\u308b\u8a33\u3055\u2026\u2026<\/p>\n<p>sudo port install opendkim<br \/>\n\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u304c\u8a2d\u7f6e\u3055\u308c\u306a\u3044\u305e\u301c\uff08\u6d99\uff09<\/p>\n<p>Gemini\u3055\u3093\u306b\u6700\u5c0f\u9650\u306e\u8a2d\u5b9a\u3092\u6559\u3048\u3066\u3082\u3089\u3063\u3066\u3082\u30c0\u30e1\u3002<br \/>\n\/opt\/local\/share\/doc\uff08\u4f55\u6545\u306bdoc\uff1f\uff09\/opendkim\u306bopendkin.conf.sample\u304c\u3042\u3063\u305f\u306e\u3067\u3001\u305d\u308c\u3092\/etc\u306bopendkim.conf\u3068\u3057\u3066\u30b3\u30d4\u30fc\u3002<br \/>\n\u305d\u306e\u5185\u5bb9\u3092\u5f04\u308b\u3053\u3068\u306b\u3002<br \/>\n\u3055\u3063\u304dGemini\u3055\u3093\u306b\u6559\u3048\u3066\u8cb0\u3063\u305f\u6240\u3092\u4fee\u6b63\u3057\u3066\u3001\u66f4\u306bMacPorts\u6a19\u6e96\u306edirectry\u306b\u7f6e\u304d\u63db\u3048\u52d5\u304f\u3088\u3046\u306b\u306a\u3063\u305f\u3002<br \/>\nnmap\u3067\u306f\u5229\u7528\u3059\u308b\u30dd\u30fc\u30c8\u304c\u958b\u3044\u3066\u898b\u3048\u306a\u3044\u3002<\/p>\n<pre class=\"height:300 lang:default decode:true\" title=\"\"># Postfix (main.cf) \u3078\u306e\u8ffd\u8a18\r\nsmtpd_milters = inet:127.0.0.1:8891\r\nnon_smtpd_milters = $smtpd_milters\r\nmilter_default_action = accept<\/pre>\n<p>opendki\u3092\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u304b\u3089\u8d77\u52d5\u3057\u3001\u52d5\u4f5c\u78ba\u8a8d\u3002<\/p>\n<p># 8891\u756a\u3092\u4f7f\u3063\u3066\u3044\u308b\u30d7\u30ed\u30bb\u30b9\u3092\u8868\u793a<\/p>\n<pre class=\"height:300 lang:default decode:true\" title=\"\">sudo lsof -i :8891\r\nCOMMAND    PID     USER   FD   TYPE             DEVICE SIZE\/OFF NODE NAME\r\nopendkim 15784 _postfix    4u  IPv4 0x912280153d7fcd03      0t0  TCP localhost:ddi-tcp-4 (LISTEN)<\/pre>\n<p>\u3068\u52d5\u304f\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u3053\u307e\u3067\u306bopendkim.conf\u306e\u4e2d\u3067\u3001<\/p>\n<pre class=\"height:300 lang:default decode:true\" title=\"\">#Socket                 inet:8891@localhost\r\nSocket                  inet:8891@192.168.0.35<\/pre>\n<p>\u3068\u9006\u5f15\u304d\u306b\u5931\u6557\u3057\u3066\u3044\u305f\u308a\u3057\u307e\u3057\u305f\u308f\u3002<\/p>\n<p>\u305d\u3057\u3066\u30ed\u30b0\u3067\u30a8\u30e9\u30fc\u304c\u306a\u3044\u304b\u8abf\u3079\u3066\u3044\u305f\u3089\u3001clamd\u304c\u30a8\u30e9\u30fc\u3092\u8d77\u3053\u3057\u3066\u3044\u3066\u3001\u66f4\u306bclamav\u304c\u6d88\u3048\u3066\u306a\u304f\u306a\u3063\u3066\u3044\u305f\u306e\u3067\u3001\u3044\u3064\u8fc4\u7d4c\u3063\u3066\u3082\u7d42\u308f\u3089\u306a\u3044\uff08\u6d99\uff09<\/p>\n<p>sudo port -n -s install clamav<br \/>\n\u3060\u3068<\/p>\n<pre class=\"height:300 lang:default decode:true\" title=\"\">--->  Computing dependencies for clamav\r\nThe following dependencies will be installed: \r\n cargo \r\n gawk \r\n help2man +perl5_34\r\n libssh2 \r\n p5.34-locale-gettext \r\n rust \r\n texinfo +perl5_34<\/pre>\n<p>\u3068\u306a\u3063\u3066\u3001\u66f4\u306b<br \/>\nError: Failed to build rust: command execution failed<br \/>\n\u3060\u3068\u2026\u2026\u2026\u7d42\u308f\u3089\u306d\u3047\u3002<\/p>\n<p>\u307e\u305fclang-17\u3060\u3088\u3002<br \/>\n<code>sudo port -n -s install rust <strong>configure.compiler=clang<\/strong><\/code><br \/>\n\u3068\u3001\u304a\u307e\u3051\u3092\u3064\u3051\u3066\u30ea\u30c8\u30e9\u30a4\u3002<br \/>\n\u307e\u305f\u30c0\u30e1\u3060\u3063\u305f\u306e\u3067\u3001\u4eca\u5ea6\u306f\u30d0\u30a4\u30ca\u30ea\u3092\u843d\u3068\u3059\u3053\u3068\u306b\u3059\u308b\u3002\uff08\u30aa\u30d7\u30b7\u30e7\u30f3\u306e-n\u3068-s\u3092\u53d6\u308b\uff09<br \/>\n\u305d\u308c\u3067\u3082\u30c0\u30e1\u3060\u3063\u305f\uff08xcode\u74b0\u5883\u306b\u306fld_classic\u304c\u7121\u3044\u305d\u3046\u3060\u3002\u30a8\u30e9\u30fc\u304c\u51fa\u305f\uff09\u306e\u3067\u5916\u3057\u3066\u307f\u308b\u3002<br \/>\n<code>sudo port install rust configure.compiler=clang build.jobs=1 configure.ldflags=\"-Wl,-ld_classic\"<\/code><br \/>\n\u3069\u3046\u306b\u3082\u30c0\u30e1\u305d\u3046<\/p>\n<p>\u3068\u4e91\u3046\u3053\u3068\u3067\u3001\u30b5\u30fc\u30d0\u30fc\u74b0\u5883\u3092MacPorts\u3092\u65b0\u898f\u306b\u5165\u308c\u76f4\u3059\u3053\u3068\u3067\u6539\u5584\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3059\u3002<br \/>\n\u305d\u306e\u524d\u306b\u3001\u30b5\u30fc\u30d0\u30fc\u74b0\u5883\uff08Web\u3068Mail\u3001DNS\u3001DHCPD\u3068\u304b\u8272\u3005\uff09\u3092\u79fb\u884c\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<br \/>\n\u30c7\u30fc\u30bf\u3001\u74b0\u5883\u8a2d\u5b9a\u3001\u8272\u3005\u79fb\u52d5\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u305d\u308c\u307e\u3067\u4eca\u306e\u30b5\u30fc\u30d0\u30fc\u3092\u9a19\u3057\u9a19\u3057\u4f7f\u3063\u3066\u3044\u304b\u306a\u3044\u3068\u2026\u2026\uff08\u3068\u307b\u307b<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53e4\u3044port\u6b8b\u3057\u3066\u3044\u305f\u305b\u3044\u3067\u3001\u3042\u3061\u3053\u3061\u306e\u4e0d\u6574\u5408\u304c\u51fa\u305f\u3002 postfix\u5468\u308a\u306e\u8a2d\u5b9a\u304c\u304a\u304b\u3057\u306a\u3053\u3068\u306b\u306a\u3063\u3066\u3044\u308b\u3088\u3046\u3060\u3002 \u4eca\u56de\u3082Gemini\u3055\u3093\u306b\u5168\u9762\u7684\u306b\u4f9d\u5b58\u3057\u3066\u4fee\u6b63\u3057\u3066\u3044\u308b\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[115],"tags":[225,175,148,231,24],"class_list":["post-10999","post","type-post","status-publish","format-standard","hentry","category-software","tag-clamav","tag-postfix","tag-server","tag-spf-dkim","tag-system"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/posts\/10999","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/comments?post=10999"}],"version-history":[{"count":2,"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/posts\/10999\/revisions"}],"predecessor-version":[{"id":11004,"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/posts\/10999\/revisions\/11004"}],"wp:attachment":[{"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/media?parent=10999"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/categories?post=10999"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/tags?post=10999"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}