{"id":613,"date":"2020-09-05T11:56:54","date_gmt":"2020-09-05T10:56:54","guid":{"rendered":"http:\/\/blog.chen-hongyi.com\/?p=613"},"modified":"2020-09-05T11:56:54","modified_gmt":"2020-09-05T10:56:54","slug":"config-ssmtp-in-docker","status":"publish","type":"post","link":"https:\/\/chen-hongyi.com\/?p=613","title":{"rendered":"config ssmtp in docker"},"content":{"rendered":"\n<p>I found  I can not send email with php in dokcer, because the ssmtp not installed. <\/p>\n\n\n\n<p>I added following section in Dockerfile:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>...\n# install MTA\nRUN apt-get update &amp;&amp; apt-get install -y ssmtp\n\nMAINTAINER hongyi.chen\n\n# Sendmail\nCOPY .\/ssmtp.conf \/etc\/ssmtp\/ssmtp.conf\n...<\/code><\/pre>\n\n\n\n<p>The SSMTP config like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>root=postmaster\nAuthUser={{smtp_username}}\nAuthPass={{smtp_password}}\nmailhub={{smtp_host}}:{{smtp_port}}\nUseTLS=YES\nUseSTARTTLS=YES\nrewriteDomain={{force_domain}}\nhostname={{host_name}}<\/code><\/pre>\n\n\n\n<p>Ref: <\/p>\n\n\n\n<p><a href=\"https:\/\/linuxhandbook.com\/linux-send-email-ssmtp\/\">https:\/\/linuxhandbook.com\/linux-send-email-ssmtp\/<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.techrepublic.com\/blog\/it-security\/use-ssmtp-to-send-e-mail-simply-and-securely\/\">https:\/\/www.techrepublic.com\/blog\/it-security\/use-ssmtp-to-send-e-mail-simply-and-securely\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I found I can not send email with php in &hellip; <a href=\"https:\/\/chen-hongyi.com\/?p=613\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-613","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=\/wp\/v2\/posts\/613","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=613"}],"version-history":[{"count":4,"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=\/wp\/v2\/posts\/613\/revisions"}],"predecessor-version":[{"id":617,"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=\/wp\/v2\/posts\/613\/revisions\/617"}],"wp:attachment":[{"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}