{"id":792,"date":"2023-12-16T23:59:06","date_gmt":"2023-12-16T14:59:06","guid":{"rendered":"https:\/\/web.cloudfree.jp\/journal\/?p=792"},"modified":"2023-12-21T08:39:06","modified_gmt":"2023-12-20T23:39:06","slug":"%e3%83%ad%e3%83%bc%e3%82%ab%e3%83%ab%e7%92%b0%e5%a2%83%e3%81%a7%e3%82%82sendmail%e3%81%8c%e4%bd%bf%e3%81%88%e3%82%8b%e3%82%88%e3%81%86%e3%81%abfake-sendmail%e3%82%92setup%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/web.cloudfree.jp\/journal\/%e3%83%ad%e3%83%bc%e3%82%ab%e3%83%ab%e7%92%b0%e5%a2%83%e3%81%a7%e3%82%82sendmail%e3%81%8c%e4%bd%bf%e3%81%88%e3%82%8b%e3%82%88%e3%81%86%e3%81%abfake-sendmail%e3%82%92setup%e3%81%99%e3%82%8b\/","title":{"rendered":"\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u3067\u3082sendmail\u304c\u4f7f\u3048\u308b\u3088\u3046\u306bfake sendmail\u3092Setup\u3059\u308b"},"content":{"rendered":"<h3 class=\"wp-block-post-title\">\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u3067\u3082sendmail\u304c\u4f7f\u3048\u308b\u3088\u3046\u306bfake sendmail\u3092Setup\u3059\u308b<\/h3>\n\n\n<p class=\"has-tertiary-color has-text-color has-background has-small-font-size\" style=\"background-color:#8d8dd8;margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0\">2023-12-16 \u8a18\u8f09<br>\u6982\u8981 : \u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u3067\u3082sendmail\u304c\u4f7f\u3048\u308b\u3088\u3046\u306bfake sendmail\u3092Setup\u3059\u308b<br>Keyword : FakeSendmail, sendmail, \u30e1\u30fc\u30eb, windows<\/p>\n\n\n\n<p>sendmail\u304c\u9001\u308c\u308b\u306e\u306f\u3001php.ini\u306e[mail function]\u306b\u9069\u5207\u306a\u8a2d\u5b9a\u304c\u66f8\u304b\u308c\u3066\u3042\u308b\u304b\u3089\u3067\u3059\u3002<br>\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u306e\u521d\u671f\u5024\u306f\u4ee5\u4e0b\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>[mail function]\n; For Win32 only.\n; https:\/\/php.net\/smtp\nSMTP = localhost\n; https:\/\/php.net\/smtp-port\nsmtp_port = 25\n\n; For Win32 only.\n; https:\/\/php.net\/sendmail-from\n;sendmail_from = me@example.com\n\n; For Unix only.  You may supply arguments as well (default: &quot;sendmail -t -i&quot;).\n; https:\/\/php.net\/sendmail-path\n;sendmail_path =\n\n; Force the addition of the specified parameters to be passed as extra parameters\n; to the sendmail binary. These parameters will always replace the value of\n; the 5th parameter to mail().\n;mail.force_extra_parameters =\n\n; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename\nmail.add_x_header = Off\n\n; Use mixed LF and CRLF line separators to keep compatibility with some\n; RFC 2822 non conformant MTA.\nmail.mixed_lf_and_crlf = Off\n\n; The path to a log file that will log all mail() calls. Log entries include\n; the full path of the script, line number, To address and headers.\n;mail.log =\n; Log mail to syslog (Event Log on Windows).\n;mail.log = syslog<\/code><\/pre><\/div>\n\n\n\n<p>Unix\u3068Win32\u3067\u306a\u306b\u304b\u3068\u9055\u3046\u3088\u3046\u3067\u3059\u3002<br>\u30cd\u30c3\u30c8\u60c5\u5831\u3092\u307f\u307e\u3059\u3068\u3001Win32\u3067sendmail\u3092\u4f7f\u3048\u308b\u3088\u3046\u306b\u3059\u308b\u65b9\u6cd5\u306f\u3044\u308d\u3044\u308d\u3042\u308a\u307e\u3059\u304c\u3001\u4e00\u756a\u304a\u624b\u8efd\u306a\u306e\u306f FakeSendmail \u3092\u5229\u7528\u3059\u308b\u65b9\u6cd5\u306e\u3088\u3046\u3067\u3059\u3002<br><br>\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u306f\u3042\u304f\u307e\u3067\u30c6\u30b9\u30c8\u3067\u3059\u306e\u3067\u9001\u308c\u305f\u3089\u3088\u3057\u3068\u3057\u307e\u3059\u3002<br>Git\u304b\u3089\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u306f\u3053\u3061\u3089\u3002<br><br>Fake sendmail for Windows with TLS v1.2<a href=\"https:\/\/github.com\/sendmail-tls1-2\/main\" target=\"_blank\" rel=\"noreferrer noopener\"><br>https:\/\/github.com\/sendmail-tls1-2\/main<\/a><br><br>\u914d\u7f6e\u3057\u305f\u3089\u3001Apache\u306eCGI\u3092\u8acb\u3051\u3066\u3044\u308b php.ini\u3068<br>Fake sendmail \u30d5\u30a9\u30eb\u30c0\u5185\u306esemdmail.ini\u306e\u8a2d\u5b9a\u3092\u9069\u5207\u306b\u66f8\u3044\u305f\u3089\u5b8c\u4e86\u3002<br>\u30b5\u30fc\u30d0\u7528\u306b\u66f8\u3044\u305f\u30bd\u30fc\u30b9\u3001\u4f8b\u3048\u3070\u5148\u65e5\u306ePHP\u30bd\u30fc\u30b9\u304c\u305d\u306e\u307e\u307e\u30ed\u30fc\u30ab\u30eb\u3067\u3082\u8d70\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-php\" data-lang=\"PHP\"><code>mb_language(&#39;ja&#39;);\nmb_internal_encoding(&#39;UTF-8&#39;);\ndate_default_timezone_set(&quot;Asia\/Tokyo&quot;);\nsetlocale(LC_ALL, &#39;ja_JP.UTF-8&#39;);\n\n$to = &#39;test_dummy@gmail.dummy&#39;;\n$subject = &#39;\u65e5\u672c\u8a9e\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u304b\uff1f&#39;;\n$message = &quot;\u6625\u306f\u3042\u3051\u307c\u306e\u3002\\n\u3084\u3046\u3084\u3046\u767d\u304f\u306a\u308a\u3086\u304f\u5c71\u304e\u306f\\n\u3059\u3053\u3057\u3042\u304b\u308a\u3066&quot;;\n$headers = &quot;From: cfsid@svXX.cloudfree.ne.jp&quot;;\n\/\/ \u30e1\u30fc\u30eb\u3092\u9001\u4fe1\n$ret = mb_send_mail($to, $subject, $message, $headers);\nvar_dump($ret);<\/code><\/pre><\/div>\n\n\n\n<p>\u305d\u306e\u8a2d\u5b9a\u65b9\u6cd5\u306f\u3002<br>\u307e\u305aphp.ini<br>sendmail_path = \u304c\u809d\u3067\u3059\u3002\u307b\u304b\u306f\u5909\u3048\u3066\u306a\u3044\u3001\u3068\u3044\u3046\u3060\u3051\u3067\u3059\u3002<br>\u30d1\u30b9\u306f\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305fFakeSendmail\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u914d\u7f6e\u3057\u305f\u30d5\u30a9\u30eb\u30c0\u3092\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u4e0b\u8a18\u306e\u4f8b\u306f\u79c1\u306e\u5834\u5408\u3002<br>-t -i \u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u3064\u3051\u3068\u3051\u3070\u3088\u3044\u3082\u306e\u3060\u305d\u3046\u3067\u3059\u3002\u3053\u3053\u3067\u306f\u8aac\u660e\u306f\u7701\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\" data-file=\"php.ini\"><code>[mail function]\nsendmail_path =c:\/pgm\/sendmail\/FakeSendmailForWindowsWithTLSv_1_2\/sendmail.exe -t -i\nmail.add_x_header = Off\nmail.mixed_lf_and_crlf = Off<\/code><\/pre><\/div>\n\n\n\n<p>semdmail.ini \u306e\u521d\u671f\u72b6\u614b\u306f\u3053\u3046\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>; configuration for fake sendmail\n\n; if this file doesn&#39;t exist, sendmail.exe will look for the settings in\n; the registry, under HKLM\\Software\\Sendmail\n\n[sendmail]\n\n; you must change mail.mydomain.com to your smtp server,\n; or to IIS&#39;s &quot;pickup&quot; directory.  (generally C:\\Inetpub\\mailroot\\Pickup)\n; emails delivered via IIS&#39;s pickup directory cause sendmail to\n; run quicker, but you won&#39;t get error messages back to the calling\n; application.\n\nsmtp_server=mail.mydomain.com\n\n; smtp port (normally 25)\n\nsmtp_port=25\n\n; SMTPS (SSL) support\n;   auto = use SSL for port 465, otherwise try to use TLS\n;   ssl  = alway use SSL\n;   tls  = always use TLS\n;   none = never try to use SSL\n\nsmtp_ssl=tls\n\n; the default domain for this server will be read from the registry\n; this will be appended to email addresses when one isn&#39;t provided\n; if you want to override the value in the registry, uncomment and modify\n\n;default_domain=mydomain.com\n\n; log smtp errors to error.log (defaults to same directory as sendmail.exe)\n; uncomment to enable logging\n\nerror_logfile=error.log\n\n; create debug log as debug.log (defaults to same directory as sendmail.exe)\n; uncomment to enable debugging\n\n;debug_logfile=debug.log\n\n; if your smtp server requires authentication, modify the following two lines\n\nauth_username=\nauth_password=\n\n; if your smtp server uses pop3 before smtp authentication, modify the \n; following three lines.  do not enable unless it is required.\n\npop3_server=\npop3_username=\npop3_password=\n\n; force the sender to always be the following email address\n; this will only affect the &quot;MAIL FROM&quot; command, it won&#39;t modify \n; the &quot;From: &quot; header of the message content\n\nforce_sender=\n\n; force the sender to always be the following email address\n; this will only affect the &quot;RCTP TO&quot; command, it won&#39;t modify \n; the &quot;To: &quot; header of the message content\n\nforce_recipient=\n\n; sendmail will use your hostname and your default_domain in the ehlo\/helo\n; smtp greeting.  you can manually set the ehlo\/helo name if required\n\nhostname=<\/code><\/pre><\/div>\n\n\n\n<p>\u5909\u66f4\u5f8c\u3002<br>fakesendmail_sender@gmail.sample<br>\u306f\u30b5\u30f3\u30d7\u30eb\u30a2\u30c9\u30ec\u30b9\u3067\u3059\u3002<br>error.log \u306f\u540c\u4e00\u30d5\u30a9\u30eb\u30c0\u306e\u3082\u306e\u3002<br>gmail\u306f\u521d\u671f\u3067OAuth2.0\u306e\u8a8d\u8a3c\u3067\u3059\u304b\u3089\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u30fc\u30b6\u30fc\u540d\u30d1\u30b9\u30ef\u30fc\u30c9\u3067\u30e1\u30fc\u30eb\u9001\u4fe1\u3059\u308b\u306b\u306f\u4e8b\u524d\u306b\uff12\u6bb5\u968e\u8a8d\u8a3c\u306e\u8a2d\u5b9a\u3092\u3057\u3066\u30a2\u30d7\u30ea\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5f97\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\" data-file=\"sendmail.ini\"><code>[sendmail]\nsmtp_server=smtp.gmail.com\nsmtp_port=587\nsmtp_ssl=auto\nerror_logfile=error.log\n;debug_logfile=debug.log\nauth_username=fakesendmail_sender@gmail.sample\nauth_password=2dankai_password\npop3_server=\npop3_username=\npop3_password=\nforce_sender=\nforce_recipient=\nhostname=<\/code><\/pre><\/div>\n\n\n\n<p>auth_username<br>\u3068<br>$headers = &#8220;From: fakesendmail_sender@gmail.sample&#8221;;<br>\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306f\u4e00\u81f4\u3057\u3066\u3044\u306a\u3044\u3068\u30a8\u30e9\u30fc\u306b\u306a\u308b\u3088\u3046\u3067\u3059\u3002<br>error.log\u306b<br>Message is missing sender&#8217;s address<br>\u3068\u8868\u793a\u3055\u308c\u305f\u3089\u305d\u306e\u3042\u305f\u308a\u3092\u3054\u78ba\u8a8d\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u3067\u3082sendmail\u304c\u4f7f\u3048\u308b\u3088\u3046\u306bfake sendmail\u3092Setup\u3059\u308b<\/p>\n","protected":false},"author":1,"featured_media":793,"comment_status":"open","ping_status":"closed","sticky":false,"template":"wp-custom-template-x24-index","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[107,14,24],"_links":{"self":[{"href":"https:\/\/web.cloudfree.jp\/journal\/wp-json\/wp\/v2\/posts\/792"}],"collection":[{"href":"https:\/\/web.cloudfree.jp\/journal\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/web.cloudfree.jp\/journal\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/web.cloudfree.jp\/journal\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/web.cloudfree.jp\/journal\/wp-json\/wp\/v2\/comments?post=792"}],"version-history":[{"count":0,"href":"https:\/\/web.cloudfree.jp\/journal\/wp-json\/wp\/v2\/posts\/792\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/web.cloudfree.jp\/journal\/wp-json\/wp\/v2\/media\/793"}],"wp:attachment":[{"href":"https:\/\/web.cloudfree.jp\/journal\/wp-json\/wp\/v2\/media?parent=792"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/web.cloudfree.jp\/journal\/wp-json\/wp\/v2\/categories?post=792"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/web.cloudfree.jp\/journal\/wp-json\/wp\/v2\/tags?post=792"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}