{"id":2320,"date":"2015-04-14T22:55:18","date_gmt":"2015-04-14T13:55:18","guid":{"rendered":"http:\/\/taitan916.info\/blog\/?p=2320"},"modified":"2024-01-12T22:50:34","modified_gmt":"2024-01-12T13:50:34","slug":"post-2320","status":"publish","type":"post","link":"https:\/\/taitan916.info\/blog\/archives\/2320","title":{"rendered":"CentOS 6.5\u306b\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0(postfix&#038;dovecot)\u3092\u5c0e\u5165\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>CentOS 6.5\u306b\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0(postfix&amp;dovecot)\u3092\u5c0e\u5165\u3057\u305f\u304b\u3063\u305f\u3002\u5177\u4f53\u7684\u306b\u306fThunderbird\u3067\u30e1\u30fc\u30eb\u306e\u9001\u53d7\u4fe1\u304c\u51fa\u6765\u308b\u72b6\u614b\u307e\u3067\u8a2d\u5b9a\u3057\u305f\u3044\u3002\u5c1a\u3001\u7d30\u304b\u3044\u8a2d\u5b9a\u306f\u3088\u304f\u5206\u304b\u3089\u306a\u3044\u306e\u3067\u6700\u4f4e\u9650\u306e\u8a2d\u5b9a\u3067\u5bfe\u5fdc\u3057\u305f\u304b\u3063\u305f\u3002\u4ee5\u4e0b\u306b\u4f5c\u696d\u74b0\u5883\u3068\u5c0e\u5165\u65b9\u6cd5\u3092\u30e1\u30e2\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2><span style=\"font-size: 14pt;\"><strong>\u4f5c\u696d\u74b0\u5883<\/strong><\/span><\/h2>\n<ul>\n<li>\u30b5\u30fc\u30d0\u74b0\u5883\uff1aCentOS 6.5\u300064bit<\/li>\n<li>\u30c9\u30e1\u30a4\u30f3\uff1ahoge.com<\/li>\n<li>\u30e1\u30fc\u30eb\u30e6\u30fc\u30b6\uff1awebmaster<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2><span style=\"font-size: 14pt;\"><strong>\u4f5c\u696d\u4e2d\u306f\u30ed\u30b0\u78ba\u8a8d\u3057\u306a\u304c\u3089\u306e\u65b9\u304c\u826f\u3044<\/strong><\/span><\/h2>\n<p>\u30e1\u30fc\u30eb\u30ed\u30b0\u306f\/var\/log\/maillog\u306b\u3042\u308b\u306e\u3067\u3001\u9001\u53d7\u4fe1\u304c\u3067\u304d\u306a\u3044\u3068\u304b\u30c8\u30e9\u30d6\u30eb\u304c\u3042\u308c\u3070\u78ba\u8a8d\u3059\u308b\u30022\u3064\u3050\u3089\u3044\u30bf\u30fc\u30df\u30ca\u30eb\u7acb\u3066\u3066\u304a\u3044\u3066\u7247\u65b9\u3067\u306f\u3001<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">tail -f \/var\/log\/maillog<\/pre>\n<p>\u3068\u304b\u3067\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u78ba\u8a8d\u306b\u3057\u3066\u304a\u3051\u3070\u5206\u304b\u308a\u3084\u3059\u304b\u3063\u305f\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2><span style=\"font-size: 14pt;\"><strong>\u5c0e\u5165\u65b9\u6cd5<\/strong><\/span><\/h2>\n<p>sendmail\u304c\u52d5\u3044\u3066\u3044\u308b\u5834\u5408\u306f\u5ff5\u306e\u305f\u3081\u6b62\u3081\u3066\u304a\u304f<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/etc\/rc.d\/init.d\/sendmail stop<\/pre>\n<p>postfix\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">yum -y install postfix<\/pre>\n<p>postfix\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">vi \/etc\/postfix\/main.cf<\/pre>\n<p>\u4ee5\u4e0b\u3092\u8ffd\u8a18\u3057\u3066\u3044\u304f<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">myhostname = mail.hoge.com\r\nmydomain = hoge.com\r\nmyorigin = $mydomain\r\ninet_interfaces = all\r\nmydestination = $myhostname, localhost.$mydomain, localhost, $mydomain\r\nmynetworks = 192.168.1.0\/24, 127.0.0.0\/8\r\nhome_mailbox = Maildir\/\r\nsmtpd_sasl_auth_enable = yes\r\nsmtpd_sasl_security_options = noanonymous\r\nsmtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination<\/pre>\n<p>\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u3092\u8a2d\u5b9a<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">iptables -I RH-Firewall-1-INPUT -p tcp -m tcp --dport smtp -j ACCEPT\r\niptables -I RH-Firewall-1-INPUT -p tcp -m tcp --dport pop3 -j ACCEPT\r\niptables -I RH-Firewall-1-INPUT -p tcp -m tcp --dport imap -j ACCEPT\r\n\/etc\/rc.d\/init.d\/iptables save<\/pre>\n<p>dovecot\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">yum -y install dovecot<\/pre>\n<p>dovecot\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">vi \/etc\/dovecot\/dovecot.conf<\/pre>\n<p>\u4ee5\u4e0b\u3092\u8ffd\u8a18\u3057\u3066\u3044\u304f<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">protocols = pop3 imap\r\ndisable_plaintext_auth = no<\/pre>\n<p>\u3082\u3046\u4e00\u3064\u306edovecot\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f(\u9055\u3044\u306f\u5206\u304b\u3089\u305a)<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">vi \/etc\/dovecot\/conf.d\/10-auth.conf<\/pre>\n<p>\u4ee5\u4e0b\u3092\u8ffd\u8a18\u3057\u3066\u3044\u304f<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">disable_plaintext_auth = no<\/pre>\n<p>\u65b0\u898f\u30e6\u30fc\u30b6\u8ffd\u52a0\u6642\u306b\u30e1\u30fc\u30eb\u30dc\u30c3\u30af\u30b9\u304c\u4f5c\u6210\u3055\u308c\u308b\u3088\u3046\u8a2d\u5b9a<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">mkdir -p \/etc\/skel\/Maildir\/{new,cur,tmp}\r\nchmod -R 700 \/etc\/skel\/Maildir\/<\/pre>\n<p>\u30e1\u30fc\u30eb\u7528\u306e\u30e6\u30fc\u30b6\u3092\u4f5c\u6210<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">useradd webmastert\r\npasswd webmaster<\/pre>\n<p>\u65e2\u5b58\u30e6\u30fc\u30b6\u306b\u30e1\u30fc\u30eb\u30dc\u30c3\u30af\u30b9\u3092\u4f5c\u6210\u3059\u308b\u5834\u5408\u306f\u305d\u306e\u30e6\u30fc\u30b6\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u4ee5\u4e0b\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3002\u4ee5\u4e0b\u3067\u306fhogehoge\u3068\u3044\u3046\u30e6\u30fc\u30b6\u306b\u5909\u66f4\u3057\u3066\u30e1\u30fc\u30eb\u30dc\u30c3\u30af\u30b9\u3092\u4f5c\u6210<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">su - hogehoge\r\nmkdir \/etc\/skel\/Maildir\r\nmkdir \/etc\/skel\/Maildir\/tmp\r\nmkdir \/etc\/skel\/Maildir\/cur\r\nmkdir \/etc\/skel\/Maildir\/new<\/pre>\n<p>SMTP-AUTH\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u8d77\u52d5\u8a2d\u5b9a<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">yum -y install cyrus*\r\nservice saslauthd start\r\nchkconfig saslauthd on<\/pre>\n<p>postfix\u3068dovecot\u3092\u8d77\u52d5<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">service postfix start\r\nservice dovecot start<\/pre>\n<p>\u5fc5\u8981\u306a\u3089\u81ea\u52d5\u8d77\u52d5\u3082\u8a2d\u5b9a\u3059\u308b<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">chkconfig postfix on\r\nchkconfig dovecot on<\/pre>\n<p>&nbsp;<\/p>\n<h2><span style=\"font-size: 14pt;\"><strong>\u305d\u306e\u4ed6<\/strong><\/span><\/h2>\n<h3>POP3\u3068\u306f<\/h3>\n<p>\u30e1\u30fc\u30eb\u3092\u53d7\u4fe1\u3059\u308b\u70ba\u306e\u30d7\u30ed\u30c8\u30b3\u30eb\u306e\u4e00\u3064\u3002\u30b5\u30fc\u30d0\u306b\u30e1\u30fc\u30eb\u3092\u6b8b\u3055\u306a\u3044\u70ba\u3001\u30b5\u30fc\u30d0\u306e\u8ca0\u8377\u306f\u8efd\u304f\u306a\u308b\u3051\u3069\u8907\u6570\u306e\u5834\u6240\u3067\u30e1\u30fc\u30eb\u3092\u898b\u308b\u3053\u3068\u304c\u3067\u304d\u306a\u3044\u3002<\/p>\n<h3>IMAP\u3068\u306f<\/h3>\n<p>\u30e1\u30fc\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u3044\u308b\u30b5\u30fc\u30d0\u304b\u3089\u53d7\u4fe1\u3059\u308b\u70ba\u306e\u30d7\u30ed\u30c8\u30b3\u30eb\u3002\u30b5\u30fc\u30d0\u306b\u30e1\u30fc\u30eb\u3092\u6b8b\u3059\u306e\u3067\u8907\u6570\u306e\u5834\u6240\u3067\u30e1\u30fc\u30eb\u3092\u898b\u308b\u3053\u3068\u304c\u51fa\u6765\u308b\u304c\u3001\u5b9a\u671f\u7684\u306b\u30e1\u30fc\u30eb\u3092\u524a\u9664\u3057\u3066\u3044\u304b\u306a\u3044\u3068\u8ca0\u8377\u306b\u306a\u308b\u3002<\/p>\n<h3>SMTP\u3068\u306f<\/h3>\n<p>\u30e1\u30fc\u30eb\u3092\u4f1d\u9001\u3059\u308b\u70ba\u306e\u30d7\u30ed\u30c8\u30b3\u30eb\u306e\u4e00\u3064\u3002POP3\u3084IMAP\u306f\u53d7\u4fe1\u3060\u3051\u3069\u3001SMTP\u306f\u9001\u4fe1\u3002<\/p>\n<h3>\u30e1\u30fc\u30e9\u30fc\u3067\u306e\u9001\u53d7\u4fe1\u306f\u5fc5\u8981\u306a\u304fPHP\u3067mail\u95a2\u6570\u3092\u4f7f\u3044\u305f\u3044\u5834\u5408<\/h3>\n<p>postfix\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u8d77\u52d5\u3059\u308b\u3060\u3051\u3067\u3001\u4ee5\u4e0b\u30bd\u30fc\u30b9\u3067\u9001\u4fe1\u3067\u304d\u308b\u307f\u305f\u3044\u3002\u7279\u306b\u8a2d\u5b9a\u306f\u5fc5\u8981\u306a\u3057\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">mb_language('ja');\r\nmb_internal_encoding('UTF-8');\r\n$from = 'hoge@hoge.com';\r\nif( mb_send_mail($from, 'subject', 'body', \"From: {$from}\\r\\n\", \"-f{$from}\") ){\r\n    \/\/\u6210\u529f\u6642\u51e6\u7406\r\n}else{\r\n    \/\/\u5931\u6557\u6642\u51e6\u7406\r\n}<\/pre>\n<h3>Thunderbird\u5074\u3067\u306e\u8a2d\u5b9a<\/h3>\n<p>\u300c\u30a2\u30ab\u30a6\u30f3\u30c8\u300d\u2192\u300c\u65b0\u3057\u3044\u30a2\u30ab\u30a6\u30f3\u30c8\u4f5c\u6210\u300d\u306e\u4e2d\u304b\u3089\u300c\u30e1\u30fc\u30eb\u300d\u3092\u9078\u3093\u3067\u9032\u3093\u3067\u3044\u3051\u3070OK\u3002IMAP\u3067\u78ba\u8a8d\u3057\u305f\u3068\u3053\u308d\u554f\u984c\u306a\u304b\u3063\u305f\u3002\u305f\u3060\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u8a2d\u5b9a\u304c\u3044\u3051\u306a\u3044\u3089\u3057\u304f\u8b66\u544a\u753b\u9762\u307f\u305f\u3044\u306a\u306e\u304c\u51fa\u308b\u306e\u3067\u3001\u4f8b\u5916\u8a2d\u5b9a\u307f\u305f\u3044\u306a\u611f\u3058\u3067\u9032\u3080\u3002\u3053\u306e\u8fba\u306e\u8a2d\u5b9a\u3068\u304b\u3082\u3061\u3083\u3093\u3068\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u305f\u3044\u3068\u3053\u308d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CentOS 6.5\u306b\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0(postfix&amp;dovecot)\u3092\u5c0e ... <\/p>\n","protected":false},"author":1,"featured_media":3999,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[7],"tags":[],"class_list":["post-2320","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/2320","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/comments?post=2320"}],"version-history":[{"count":0,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/2320\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/media\/3999"}],"wp:attachment":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/media?parent=2320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/categories?post=2320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/tags?post=2320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}