OSDN Git Service

- added 'mail_func_workaround' setting to avoid mail() bare CRLF problem.
authorYoshinari Takaoka <takaoka@beatcraft.com>
Sun, 5 Jul 2009 13:52:50 +0000 (22:52 +0900)
committerYoshinari Takaoka <takaoka@beatcraft.com>
Sun, 5 Jul 2009 13:52:50 +0000 (22:52 +0900)
CHANGES
class/Ethna_MailSender.php
skel/etc.ini.php

diff --git a/CHANGES b/CHANGES
index 7242a6d..969ecfc 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -8,6 +8,9 @@
 - 国際化に関する変更
 -- デフォルトのタイムゾーンとして、date.timezone を 'Asia/Tokyo' に設定
 -- Ethna_I18N クラス に setTimeZone メソッドを追加 (static呼出)
+- Ethna_MailSender にて、メール送信に問題がある場合の設定として 'mail_func_workaround' を追加
+-- この値を true に設定すると、メールヘッダの改行コードを一律 CRLF にする処理を回避する
+-- $mail = new Ethna_MailSender(); $mail->setOption(array('mail_func_workaround')); でも設定可能
 
 *** bug fix
 
index 58bec6d..7bc53e3 100644 (file)
@@ -206,7 +206,11 @@ class Ethna_MailSender
         if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
             $body = str_replace("\n", "\r\n", $body);
         }
-        $header_line = str_replace("\n", "\r\n", $header_line);
+        $wa_config = 'mail_func_workaround';
+        if ($this->config->get($wa_config) == false
+         && isset($this->options[$wa_config]) == false) {
+            $header_line = str_replace("\n", "\r\n", $header_line);
+        }
 
         // 送信
         foreach (to_array($to) as $rcpt) {
index 984e2bd..48e4369 100644 (file)
@@ -79,6 +79,9 @@ $config = array(
     // i18n
     //'use_gettext' => false,
     
+    // mail 
+    //'mail_func_workaround' => false,
+
     // csrf
     // 'csrf' => 'Session',
 );