{"id":454,"date":"2015-06-26T23:34:09","date_gmt":"2015-06-26T14:34:09","guid":{"rendered":"http:\/\/www.typea.info\/blog\/index.php\/2015\/06\/26\/centospython\/"},"modified":"2015-06-26T23:34:09","modified_gmt":"2015-06-26T14:34:09","slug":"centospython","status":"publish","type":"post","link":"https:\/\/www.typea.info\/blog\/index.php\/2015\/06\/26\/centospython\/","title":{"rendered":"CentOS\u306b\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0\u30fc\u3092\u69cb\u7bc9\u3057\u3066Python\u304b\u3089\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3059\u308b"},"content":{"rendered":"<ul>\n<li><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2015\/01\/05\/aws_elastic_beanstalk_django_centos65_pydev1_django\" target=\"_blank\">(1) Django\u8d77\u52d5\u307e\u3067<\/a>\n<li><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2015\/01\/05\/aws_elastic_beanstalk_django_centos65_pydev2_tips_sshrds\" target=\"_blank\">(2) (TIPS) SSH\u3001RDS\u3078\u306e\u63a5\u7d9a<\/a>\n<li><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2015\/01\/05\/aws_elastic_beanstalk_django_centos65_pydev3_tips\" target=\"_blank\">(3) (TIPS) \u30ed\u30b0\u306e\u78ba\u8a8d\u3068\u30c7\u30d7\u30ed\u30a4\u7d50\u679c\u306e\u78ba\u8a8d<\/a>\n<li><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2015\/01\/05\/aws_elastic_beanstalk_django_centos65_pydev4\" target=\"_blank\">(4) \u3044\u304f\u3064\u304b\u306e\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c8<\/a>\n<li><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2015\/01\/05\/aws_elastic_beanstalk_django_centos65_pydev5\" target=\"_blank\">(5) \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u4f5c\u6210<\/a>\n<li><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2015\/01\/06\/aws_elastic_beanstalk_django_centos65_pydev6_createadmin\" target=\"_blank\">(6) createadmin \u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5b9f\u884c\u306e\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c8<\/a>\n<li><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2015\/01\/31\/aws_elastic_beanstalk_django_7_ipdns\" target=\"_blank\">(7) \u9759\u7684IP\u30a2\u30c9\u30ec\u30b9\u306e\u8a2d\u5b9a\u3068\u30c9\u30e1\u30a4\u30f3\u306e\u53d6\u5f97\u3068DNS\u306e\u8a2d\u5b9a<\/a>\n<li><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2015\/05\/20\/aws_elastic_beanstalk_rds_utf-8\" target=\"_blank\">AWS Elastic Beanstalk RDS \u306e\u6587\u5b57\u30b3\u30fc\u30c9\u3092utf-8\u306b\u8a2d\u5b9a\u3057\u306a\u304a\u3059<\/a>\n<li><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2015\/07\/02\/djangoaws_elasticbeanstalk\" target=\"_blank\">Django\u3067\u30d0\u30c3\u30c1\u51e6\u7406\u3092\u884c\u3046(AWS Elasticbeanstalk)<\/a> <\/li>\n<\/ul>\n<p>\u306d\u3089\u3044\u3068\u3057\u3066\u306f\u3001<a href=\"http:\/\/typea.info\/blg\/glob\/aws-elastic-beanstalk\/\">AWS Elastic Beanstalk<\/a> \u3092\u4f7f\u3063\u3066\u4f5c\u6210\u3057\u3066\u3044\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304b\u3089\u3001\u30e1\u30fc\u30eb\u3092\u98db\u3070\u3059\u3002<\/p>\n<p>ServersMan\u3067\u501f\u308a\u3066\u3044\u308b\u30ec\u30f3\u30bf\u30eb\u30b5\u30fc\u30d0\u30fc(CentOS6) \u306b\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0\u30fc\u3092\u69cb\u7bc9\u3057\u3001<a href=\"http:\/\/typea.info\/blg\/glob\/aws-elastic-beanstalk\/\">AWS Elastic Beanstalk<\/a> \u4e0a\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304b\u3089\u63a5\u7d9a\u3057\u3066\u30e1\u30fc\u30eb\u9001\u4fe1\u3092\u884c\u3046\u3002<\/p>\n<h2>1.\u30e1\u30fc\u30eb\u9001\u4fe1\u30b5\u30fc\u30d0\u30fc\u306e\u69cb\u7bc9<\/h2>\n<p><a href=\"http:\/\/www.amazon.co.jp\/gp\/product\/4881663070\/ref=as_li_ss_il?ie=UTF8&amp;camp=247&amp;creative=7399&amp;creativeASIN=4881663070&amp;linkCode=as2&amp;tag=typea09-22\"><img decoding=\"async\" border=\"0\" src=\"http:\/\/ws-fe.amazon-adsystem.com\/widgets\/q?_encoding=UTF8&amp;ASIN=4881663070&amp;Format=_SL160_&amp;ID=AsinImage&amp;MarketPlace=JP&amp;ServiceVersion=20070822&amp;WS=1&amp;tag=typea09-22\"><\/a><img loading=\"lazy\" decoding=\"async\" style=\"border-top-style: none !important; border-left-style: none !important; border-bottom-style: none !important; border-right-style: none !important; margin: 0px\" border=\"0\" alt=\"\" src=\"http:\/\/ir-jp.amazon-adsystem.com\/e\/ir?t=typea09-22&amp;l=as2&amp;o=9&amp;a=4881663070\" width=\"1\" height=\"1\"><\/p>\n<p>\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0\u30fc\u306e\u69cb\u7bc9\u306f\u3001\u5b8c\u5168\u306b\u4ee5\u4e0b\u306e\u30b5\u30a4\u30c8\u306e\u624b\u9806\u3092\u53c2\u8003\u306b\u3002<\/p>\n<ul>\n<li><a href=\"http:\/\/centossrv.com\/postfix.shtml\">\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0\u30fc\u69cb\u7bc9(Postfix+Dovecot)<\/a>\n<li><a href=\"http:\/\/fedorasrv.com\/postfix-tls.shtml\">\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0\u30fc\u9593\u901a\u4fe1\u5185\u5bb9\u6697\u53f7\u5316(OpenSSL+Postfix+Dovecot)<\/a> <\/li>\n<\/ul>\n<p>\u57fa\u672c\u7684\u306b\u4e0a\u8a18\u306e\u30b5\u30a4\u30c8\u306e\u624b\u9806\u901a\u308a\u306b\u3084\u308c\u3070OK\u3060\u3068\u601d\u3046\u3002<\/p>\n<p>\u3068\u306f\u3044\u3048\u3001\u3084\u306f\u308a\u300c\u3053\u306f\u307e\u308a\u300d\u306f\u3042\u3063\u305f\u306e\u3067\u3001\u5099\u5fd8\u3002<\/p>\n<h3>1.1 Postfix \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u8a2d\u5b9a<\/h3>\n<pre class=\"prettyprint linenums\"># yum install postfix<\/pre>\n<p>vi \/etc\/postfix\/main.cf<\/p>\n<pre class=\"prettyprint linenums\">myhostname = mail.typea.info\r\nmydomain = typea.info\r\nmyorigin = $mydomain\r\ninet_interfaces = all\r\nmydestination = $myhostname, localhost.$mydomain, localhost, $mydomain\r\nrelayhost = \r\nhome_mailbox = Maildir\/\r\nsmtpd_banner = $myhostname ESMTP unknown\r\n\r\nsmtpd_sasl_auth_enable = yes\r\n\r\n#smtpd_sasl_type = dovecot\r\n#smtpd_sasl_path = private\/auth\r\n#smtpd_sasl_security_options = noanonymous\r\n#smtpd_sasl_local_domain = $hyhostname\r\n#smtpd_recipient_restrictions = permit_mynetworks,permit_auth_destination,permit_sasl_authenticated,reject\r\n\r\nsmtpd_sasl_type = cyrus\r\nsmtpd_sasl_path = smtpd\r\n\r\nsmtp_sasl_password_maps = hash:\/etc\/postfix\/sasl_passwd\r\nsmtp_sasl_mechanism_filter = plain\r\nsmtpd_sasl_local_domain = $myhostname\r\nsmtpd_recipient_restrictions =\r\n    permit_mynetworks\r\n    permit_sasl_authenticated\r\n    reject_unauth_destination\r\n\r\nmessage_size_limit = 10485760\r\n\r\nsmtpd_use_tls = yes\r\nsmtpd_tls_cert_file = \/etc\/pki\/tls\/certs\/mail.pem\r\nsmtpd_tls_key_file = \/etc\/pki\/tls\/certs\/mail.pem\r\nsmtpd_tls_session_cache_database = btree:\/var\/lib\/postfix\/smtpd_scache<\/pre>\n<p><a href=\"https:\/\/ja.wikipedia.org\/wiki\/Simple_Authentication_and_Security_Layer\">SASL\u8a8d\u8a3c<\/a>\u306e\u5c0e\u5165<\/p>\n<p>\u3053\u306e\u3042\u305f\u308a\u306e\u624b\u9806\u3082<a href=\"http:\/\/fedorasrv.com\/postfix.shtml\">\u4e0a\u8a18\u30b5\u30a4\u30c8<\/a>\u306b\u4e01\u5be7\u306a\u8aac\u660e\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint linenums\"># yum -y install cyrus-sasl\r\n# \/etc\/rc.d\/init.d\/saslauthd start\r\n# chkconfig saslauthd on\r\n# vi \/etc\/postfix\/sasl_passwd\r\n# postmap \/etc\/postfix\/sasl_passwd \r\n# mkdir -p \/etc\/skel\/Maildir\/{new,cur,tmp}\r\n# chmod -R 700 \/etc\/skel\/Maildir\/<\/pre>\n<p>\u30e1\u30fc\u30eb\u30e6\u30fc\u30b6\u30fc\u306e\u8ffd\u52a0<\/p>\n<p>\u30e6\u30fc\u30b6\u30fc\u540d:phraseit\u3001\u30d1\u30b9\u30ef\u30fc\u30c9:password<\/p>\n<pre class=\"prettyprint linenums\"># echo \"password\" | saslpasswd2 -p -u mail.typea.info -c phraseit\r\n# sasldblistusers2 \r\nphraseit@mail.typea.info: userPassword\r\n\r\n# chgrp postfix \/etc\/sasldb2\r\n# cd \/etc\/sasldb2<\/pre>\n<p>\u57fa\u672c\u7684\u306b\u306f\u3001\u4e0a\u8a18\u306e2\u3064\u306e\u30ea\u30f3\u30af\u306b\u8a2d\u5b9a\u5024\u306e\u8aac\u660e\u306f\u3042\u308b\u306e\u3067\u3001\u305d\u3061\u3089\u3092\u53c2\u7167\u3002<\/p>\n<p>\u4e0a\u8a18\u306f\u8a2d\u5b9a\u5024\u306e\u629c\u7c8b\u3002<\/p>\n<h4>1.1.1 \u30ea\u30ec\u30fc\u30db\u30b9\u30c8\u306e\u554f\u984c<\/h4>\n<p>1\u3064\u7570\u306a\u308b\u306e\u306f\u3001\u81ea\u5206\u306e\u5951\u7d04\u3057\u3066\u3044\u308b\u30d7\u30ed\u30d0\u30a4\u30c0\u306e\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0\u30fc\u3092\u30ea\u30ec\u30fc\u30b5\u30fc\u30d0\u30fc\u3068\u3057\u3066\u5229\u7528\u3059\u3079\u304f\u8a2d\u5b9a(<a href=\"http:\/\/fedorasrv.com\/postfix.shtml\">\u5076\u7136\u4e0a\u8a18\u3068\u540c\u3058ASAHI\u30cd\u30c3\u30c8<\/a>)\u3057\u3066\u307f\u305f\u306e\u3060\u304c\u3001\u3046\u307e\u304f\u3044\u304b\u306a\u3044\u3002<\/p>\n<p><a href=\"http:\/\/fedorasrv.com\/op25b.shtml\">OP25B(Outbound Port 25 Blocking)\u5bfe\u7b56<\/a> \u304c\u539f\u56e0\u304b\u3068\u601d\u3044\u3001<\/p>\n<p><a href=\"http:\/\/asahi-net.jp\/support\/security\/op25b\/\">http:\/\/asahi-net.jp\/support\/security\/op25b\/<\/a> <br \/><a href=\"http:\/\/asahi-net.jp\/support\/security\/op25b\/op25b_biz.pdf\">http:\/\/asahi-net.jp\/support\/security\/op25b\/op25b_biz.pdf<\/a> <\/p>\n<blockquote>\n<p>\u52d5\u7684\uff29\uff30\u30a2\u30c9\u30ec\u30b9\u306b\u3088\u308b\u63a5\u7d9a\u3067Dynamic DNS\u7b49\u3067\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0\u30fc\u3092\u8a2d\u7f6e\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u4e2d\u7d99\u5c02\u7528 <br \/>\uff08Relay\uff09\u30b5\u30fc\u30d0\u30fc\u3092\u3054\u7528\u610f\u3057\u3066\u307e\u3059\u3002 <br \/>\u30fb op25b.asahi-net.or.jp <br \/>\u3054\u5229\u7528\u306b\u3042\u305f\u3063\u3066\u306f\u3001\u4ee5\u4e0b\u3092\u3054\u78ba\u8a8d\u304f\u3060\u3055\u3044\u3002 <br \/>\uff081\uff09\u672c\u30b5\u30fc\u30d0\u306f\u3001\u4e2d\u7d99\u5c02\u7528\uff08Relay\uff09\u30b5\u30fc\u30d0\u30fc\u3067\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u4e00\u822c\u7684\u306a\u4f7f\u7528\u4e0a\u5fc5\u8981\u3068\u8003\u3048\u3089\u308c\u308b\u30e9\u30a4\u30f3\u306b\u3066\u6700 <br \/>\u9069\u5316\u3057\u3001\u5bfe\u5fdc\u3055\u305b\u3066\u3044\u305f\u3060\u304d\u307e\u3059\u3002 <br \/>\uff082\uff09\uff21\uff33\uff21\uff28\uff29\u30cd\u30c3\u30c8\u306e\u63a5\u7d9a\u56de\u7dda\u3084\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0\u30fc\u3067\u306f\u3001\u6cd5\u4eba\u4f1a\u54e1\u898f\u7d04\u3067\u5b9a\u3081\u308b\u4f1a\u54e1\u306e\u7981\u6b62\u4e8b\u9805\u3068\u3057\u3066\u3001\u8ff7\u60d1\u30e1\u30fc <br \/>\u30eb\u306e\u767a\u4fe1\u3092\u7981\u3058\u3066\u3044\u307e\u3059\u3002\u63a5\u7d9a\u56de\u7dda\u3084\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u8ff7\u60d1\u30e1\u30fc\u30eb\u306e\u767a\u4fe1\u304c\u8a8d\u3081\u3089\u308c\u305f\u4f1a\u54e1\u306b\u5bfe\u3057\u3066\u306f\u3001\u30b5\u30fc <br \/>\u30d3\u30b9\u5229\u7528\u505c\u6b62\u3001\uff21\uff33\uff21\uff28\uff29\u30cd\u30c3\u30c8\u304b\u3089\u306e\u5f37\u5236\u9000\u4f1a\u7b49\u306e\u51e6\u7f6e\u3092\u8b1b\u3058\u307e\u3059\u3002 <\/p>\n<\/blockquote>\n<p>\u3068\u3044\u3046\u3053\uff54\u3067\u3001\u4f55\u30d1\u30bf\u30fc\u30f3\u304b\u8a66\u3057\u305f\u304c\u3001\u89e3\u6c7a\u3057\u306a\u3044\u306e\u3067\u65ad\u5ff5\u3002<\/p>\n<p>relayhost =<\/p>\n<p>\u3068\u3057\u305f\u3002GMail\u3001Hotmail\u3001ASAHI\u30cd\u30c3\u30c8\u3078\u30e1\u30fc\u30eb\u304c\u9001\u4fe1\u3055\u308c\u308b\u3053\u3068\u306f\u78ba\u8a8d\u3002<\/p>\n<h4>1.2 \u30e1\u30fc\u30eb\u9001\u4fe1\u30d7\u30ed\u30b0\u30e9\u30e0\u3068postfix\u306e\u8d77\u52d5\u8a2d\u5b9a<\/h4>\n<pre class=\"prettyprint linenums\"># alternatives --config mta\r\n\r\n2 \u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u3042\u308a 'mta' \u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002\r\n\r\n  \u9078\u629e       \u30b3\u30de\u30f3\u30c9\r\n-----------------------------------------------\r\n*+ 1           \/usr\/sbin\/sendmail.sendmail\r\n   2           \/usr\/sbin\/sendmail.postfix\r\n\r\nEnter \u3092\u62bc\u3057\u3066\u73fe\u5728\u306e\u9078\u629e [+] \u3092\u4fdd\u6301\u3059\u308b\u304b\u3001\u9078\u629e\u756a\u53f7\u3092\u5165\u529b\u3057\u307e\u3059:2\r\n\r\n# \/etc\/rc.d\/init.d\/postfix restart\r\npostfix \u3092\u505c\u6b62\u4e2d:                                          [\u5931\u6557]\r\npostfix \u3092\u8d77\u52d5\u4e2d:                                          [  OK  ]\r\n# chkconfig postfix on<\/pre>\n<h2>2.\u30e1\u30fc\u30eb\u53d7\u4fe1\u30b5\u30fc\u30d0\u30fc\u306e\u69cb\u7bc9<\/h2>\n<h4>2.1 dovecot\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u8a2d\u5b9a<\/h4>\n<pre class=\"prettyprint linenums\"># yum -y install dovecot<\/pre>\n<p>vi \/etc\/dovecot\/conf.d\/10-mail.conf<\/p>\n<pre class=\"prettyprint linenums\">mail_location = maildir:~\/Maildir<\/pre>\n<p>vi \/etc\/dovecot\/conf.d\/10-auth.conf<\/p>\n<pre class=\"prettyprint linenums\">disable_plaintext_auth = no<\/pre>\n<p>vi \/etc\/dovecot\/conf.d\/10-ssl.conf<\/p>\n<pre class=\"prettyprint linenums\">ssl = yes<\/pre>\n<h4>2.2 \u8d77\u52d5\u3068\u8d77\u52d5\u8a2d\u5b9a<\/h4>\n<pre class=\"prettyprint linenums\"># \/etc\/rc.d\/init.d\/dovecot start\r\nDovecot Imap \u3092\u8d77\u52d5\u4e2d:                                     [  OK  ]\r\n# chkconfig dovecot on<\/pre>\n<h2>3.SSL\u306e\u69cb\u6210<\/h2>\n<h4>3.1 \u516c\u958b\u9375\u306e\u4f5c\u6210<\/h4>\n<p><a href=\"https:\/\/blog.apar.jp\/linux\/678\/\">https:\/\/blog.apar.jp\/linux\/678\/<\/a> <br \/><a href=\"http:\/\/scientificsrv.com\/postfix-tls.shtml\">http:\/\/scientificsrv.com\/postfix-tls.shtml<\/a><\/p>\n<p>\u4ee5\u4e0b\u306e\u624b\u9806\u3067\u516c\u958b\u9375\u3092\u4f5c\u6210\u3059\u308b\u3002\u4e0a\u8a18\u306e\u30b5\u30a4\u30c8\u3092\u53c2\u8003\u306b\u671f\u9650\u309210\u5e74\u306b\u8a2d\u5b9a\u3057\u305f\u4e0a\u3067\u3001\u4f5c\u6210\u3059\u308b\u3002<\/p>\n<pre class=\"prettyprint linenums\">cd \/etc\/pki\/tls\/certs\/\r\ncp -ip Makefile Makefile.org\r\nsed -i 's\/365\/3650\/g' Makefile\r\n\r\n# make mail.pem\r\numask 77 ; \\\r\n        PEM1=`\/bin\/mktemp \/tmp\/openssl.XXXXXX` ; \\\r\n        PEM2=`\/bin\/mktemp \/tmp\/openssl.XXXXXX` ; \\\r\n        \/usr\/bin\/openssl req -utf8 -newkey rsa:2048 -keyout $PEM1 -nodes -x509 -days 3650 -out $PEM2 -set_serial 0 ; \\\r\n        cat $PEM1 &gt;  mail.pem ; \\\r\n        echo \"\"    &gt;&gt; mail.pem ; \\\r\n        cat $PEM2 &gt;&gt; mail.pem ; \\\r\n        rm -f $PEM1 $PEM2\r\nGenerating a 2048 bit RSA private key\r\n......................................................................................+++\r\n.................+++\r\nwriting new private key to '\/tmp\/openssl.qZKMXu'\r\n-----\r\nYou are about to be asked to enter information that will be incorporated\r\ninto your certificate request.\r\nWhat you are about to enter is what is called a Distinguished Name or a DN.\r\nThere are quite a few fields but you can leave some blank\r\nFor some fields there will be a default value,\r\nIf you enter '.', the field will be left blank.\r\n-----\r\nCountry Name (2 letter code) [XX]:JP\r\nState or Province Name (full name) []:Aichi\r\nLocality Name (eg, city) [Default City]:Owariasahi\r\nOrganization Name (eg, company) [Default Company Ltd]:typea.info\r\nOrganizational Unit Name (eg, section) []:\r\nCommon Name (eg, your name or your server's hostname) []:mail.typea.info\r\nEmail Address []:postmaster@mail.typea.info<\/pre>\n<h4>3.2 postfix \u306e\u8a2d\u5b9a<\/h4>\n<pre class=\"prettyprint linenums\"># vi \/etc\/postfix\/main.cf\r\nsmtpd_use_tls = yes\r\nsmtpd_tls_cert_file = \/etc\/pki\/tls\/certs\/mail.pem\r\nsmtpd_tls_key_file = \/etc\/pki\/tls\/certs\/mail.pem\r\nsmtpd_tls_session_cache_database = btree:\/var\/lib\/postfix\/smtpd_scache<\/pre>\n<h2>4.\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c8<\/h2>\n<h3>4.1 SASL\u8a8d\u8a3c\u306e\u30a8\u30e9\u30fc<\/h3>\n<p><a title=\"http:\/\/centossrv.com\/bbshtml\/webpatio\/2238.shtml\" href=\"http:\/\/centossrv.com\/bbshtml\/webpatio\/2238.shtml\">http:\/\/centossrv.com\/bbshtml\/webpatio\/2238.shtml<\/a><\/p>\n<pre class=\"prettyprint linenums\">Jun 20 16:00:59 dos-vps-srv53 postfix\/master[11252]: warning: \/usr\/libexec\/postfix\/smtpd: bad command startup -- throttling\r\nJun 20 16:14:25 dos-vps-srv53 postfix\/smtpd[11400]: warning: xsasl_cyrus_server_get_mechanism_list: no applicable SASL mechanisms\r\nJun 20 16:14:25 dos-vps-srv53 postfix\/smtpd[11400]: fatal: no SASL authentication mechanisms<\/pre>\n<p>\u4e0d\u8db3\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u78ba\u8a8d\u3068\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<pre class=\"prettyprint linenums\"># rpm -qa | grep cyrus-sasl\r\ncyrus-sasl-2.1.23-15.el6_6.2.i686\r\ncyrus-sasl-lib-2.1.23-15.el6_6.2.i686\r\ncyrus-sasl-devel-2.1.23-15.el6_6.2.i686\r\n\r\n# yum install -y cyrus-sasl-md5\r\n# yum install -y cyrus-sasl-plain<\/pre>\n<h2>5.DNS\u306e\u8a2d\u5b9a<\/h2>\n<p>\u30e0\u30fc\u30e0\u30fc\u30c9\u30e1\u30a4\u30f3\u306eDNS\u8a2d\u5b9a\u3067\u3001<a href=\"http:\/\/e-words.jp\/w\/MX%E3%83%AC%E3%82%B3%E3%83%BC%E3%83%89.html\">MX\u30ec\u30b3\u30fc\u30c9<\/a>\u306e\u8a2d\u5b9a\u3092\u884c\u3046\u3002<\/p>\n<p><a href=\"http:\/\/e-words.jp\/w\/A%E3%83%AC%E3%82%B3%E3%83%BC%E3%83%89.html\">A\u30ec\u30b3\u30fc\u30c9<\/a> \u3067\u8a2d\u5b9a\u3057\u305f\u30c9\u30e1\u30a4\u30f3\u306b\u5bfe\u3057\u3066\u3001MX\u30ec\u30b3\u30fc\u30c9\u3092\u5272\u308a\u5f53\u3066\u308b\u3002<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/CentOS-Mail-Server_1482B\/mail_server_dns.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"mail_server_dns\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"mail_server_dns\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/CentOS-Mail-Server_1482B\/mail_server_dns_thumb.jpg\" width=\"403\" height=\"240\"><\/a><\/p>\n<h2>6.\u78ba\u8a8d<\/h2>\n<h3>6.1 \u30b3\u30f3\u30bd\u30fc\u30eb\u304b\u3089\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3057\u3066\u307f\u308b<\/h3>\n<pre class=\"prettyprint linenums\">$ echo \"test mail\" | mail -s \"test title\" pppiroto@gmail.com<\/pre>\n<h3>6.2 \u30e1\u30fc\u30e9\u30fc\u306e\u8a2d\u5b9a<\/h3>\n<p>Outlook\u306e\u5834\u5408\u3001\u9001\u4fe1\u30b5\u30fc\u30d0\u30fc\u306e\u30dd\u30fc\u30c8\u3092 465 \u306b\u5909\u66f4\u3002<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/CentOS-Mail-Server_1482B\/mail_server03.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"mail_server03\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"mail_server03\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/CentOS-Mail-Server_1482B\/mail_server03_thumb.jpg\" width=\"358\" height=\"366\"><\/a><\/p>\n<h2>7.Python\u304b\u3089\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3059\u308b\u30b5\u30f3\u30d7\u30eb<\/h2>\n<p><a href=\"http:\/\/www.amazon.co.jp\/gp\/product\/479804315X\/ref=as_li_ss_il?ie=UTF8&amp;camp=247&amp;creative=7399&amp;creativeASIN=479804315X&amp;linkCode=as2&amp;tag=typea09-22\"><img decoding=\"async\" border=\"0\" src=\"http:\/\/ws-fe.amazon-adsystem.com\/widgets\/q?_encoding=UTF8&amp;ASIN=479804315X&amp;Format=_SL160_&amp;ID=AsinImage&amp;MarketPlace=JP&amp;ServiceVersion=20070822&amp;WS=1&amp;tag=typea09-22\"><\/a><img loading=\"lazy\" decoding=\"async\" style=\"border-top-style: none !important; border-left-style: none !important; border-bottom-style: none !important; border-right-style: none !important; margin: 0px\" border=\"0\" alt=\"\" src=\"http:\/\/ir-jp.amazon-adsystem.com\/e\/ir?t=typea09-22&amp;l=as2&amp;o=9&amp;a=479804315X\" width=\"1\" height=\"1\"><\/p>\n<p>\u7c21\u5358\u306aSSL\u30e1\u30fc\u30eb\u9001\u4fe1\u30b5\u30f3\u30d7\u30eb\u3092\u95a2\u6570\u5316<\/p>\n<p>\u4e0a\u8a18\u3067\u4f5c\u6210\u3057\u305f\u516c\u958b\u9375\u30d5\u30a1\u30a4\u30eb \/etc\/pki\/tls\/certs\/mail.pem \u3092\u30c0\u30a6\u30ed\u30fc\u30c9\u3057\u3001Python\u306e\u4ee5\u4e0b\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u3068\u540c\u3058\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u7f6e\u3044\u3066\u304a\u304f\u3002<\/p>\n<pre class=\"prettyprint linenums\"># -*-coding:utf-8 -*-\r\nimport smtplib\r\nimport email.utils\r\nfrom email.mime.text import MIMEText\r\nfrom email.header import Header\r\nimport os\r\n\r\nSMTP_CERT_FILE_NAME = 'mail.pem'\r\nSMTP_SERVER_HOST = 'mail.typea.info'\r\nSMTP_SERVER_PORT = '465'\r\nSMTP_USER_ID = 'phraseit'    \r\nSMTP_PASSWORD = '**********'\r\nSMTP_FROM_NAME = 'Phraseit' \r\nSMTP_FROM_ADDR = 'phraseit@mail.typea.info'   \r\nSMTP_TIME_OUT = 30\r\n\r\ndef send_mail(to_name, to_addr, subject, message):\r\n    '''\r\n    E-Mail\u3092\u9001\u4fe1\u3059\u308b\r\n    '''\r\n    DEBUG_LEVEL = True\r\n    pem_file = os.path.join(os.path.dirname(__file__), SMTP_CERT_FILE_NAME)\r\n    \r\n    charset = 'utf-8'\r\n    \r\n    msg = MIMEText(message, 'plain', charset)\r\n    msg['To'] = email.utils.formataddr((to_name, to_addr))\r\n    msg['From'] = email.utils.formataddr((SMTP_FROM_NAME,SMTP_FROM_ADDR))\r\n    msg['Subject'] = Header(subject, charset)\r\n    \r\n    server = smtplib.SMTP_SSL(\r\n                SMTP_SERVER_HOST, \r\n                SMTP_SERVER_PORT, \r\n                'phraseit.info', \r\n                pem_file, \r\n                pem_file, \r\n                SMTP_TIME_OUT)\r\n    \r\n    server.set_debuglevel(DEBUG_LEVEL)\r\n    try:\r\n        server.login(SMTP_USER_ID, SMTP_PASSWORD)\r\n        server.sendmail(SMTP_FROM_ADDR,\r\n                        [to_addr],\r\n                        msg.as_string())\r\n    finally:\r\n        server.quit()<\/pre>\n<p>\u4f5c\u6210\u3057\u305f\u30e1\u30fc\u30eb\u3092\u98db\u3070\u3057\u3066\u307f\u305f\u3002<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/CentOS-Mail-Server_1482B\/mail_server06.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"mail_server06\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"mail_server06\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/CentOS-Mail-Server_1482B\/mail_server06_thumb.jpg\" width=\"337\" height=\"215\"><\/a><\/p>\n<p>\u57fa\u672c\u8ff7\u60d1\u30e1\u30fc\u30eb\u306b\u632f\u308a\u5206\u3051\u3089\u308c\u308b\u304c\u3001Gmail\u3001Hotmail\u3001ISP(ASAHI\u30cd\u30c3\u30c8)\u3078\u306e\u30e1\u30fc\u30eb\u3068\u3082\u6b63\u5e38\u306b\u9001\u4fe1\u5b8c\u4e86\uff01<\/p>\n<p>\u3082\u3063\u3068\u7c21\u5358\u304b\u3068\u601d\u3063\u3066\u3044\u305f\u304c\u3001\u306a\u304b\u306a\u304b\u9762\u5012\u304f\u3055\u3044\u4f5c\u696d\u3060\u3002<\/p>\n<p>\u4e0a\u8a18\u30e1\u30fc\u30eb\u9001\u4fe1\u3092\u7d44\u307f\u8fbc\u3093\u3060\u3001Django \u3092 AWS Elasticbeanstalk \u304b\u3089\u8d77\u52d5\u3055\u305b\u3066\u3082\u3001\u554f\u984c\u306a\u304f\u30e1\u30fc\u30eb\u9001\u4fe1\u3092\u884c\u3046\u3053\u3068\u3082\u51fa\u6765\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>(1) Django\u8d77\u52d5\u307e\u3067 (2) (TIPS) SSH\u3001RDS\u3078\u306e\u63a5\u7d9a (3) (TIPS) \u30ed\u30b0\u306e\u78ba\u8a8d\u3068\u30c7\u30d7\u30ed\u30a4\u7d50\u679c\u306e\u78ba\u8a8d (4) \u3044\u304f\u3064\u304b\u306e\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c8 (5) \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u4f5c\u6210 (6) createa [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"","vkexunit_cta_each_option":"","footnotes":""},"categories":[80,64,20,8],"tags":[],"class_list":["post-454","post","type-post","status-publish","format-standard","hentry","category-aws-elastic-beanstalk","category-centos","category-python","category-server"],"veu_head_title_object":{"title":"","add_site_title":""},"_links":{"self":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/454","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=454"}],"version-history":[{"count":0,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/454\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=454"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=454"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=454"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}