Backport(バックポート) #3582
OpenPNE.ymlに設定したmail_envelope_fromがReturnPathに反映されない
100%
Description
現象¶
OpenPNE.ymlにmail_envelope_fromの設定を行っても、設定値がReturnPathに反映されません。
config/OpenPNE.yml 96 # SNS から送信するメールの Envelope From (Return-Path ヘッダ) に指定するアドレス (PHP の safe_mode が有効な環境では指定できません) 97 # Envelope From (Return-Path header) address for sending e-mail from the SNS (cannot use if your PHP's safe_mode setting is on) 98 mail_envelope_from: "return@example.com"
原因¶
opMailSend::executeにて上記の設定値を
Zend_Mail::setReturnPathに引き渡しておりますが、このメソッドが期待通り動作していないようです。
lib/util/opMailSend.class.php 211 $mailer = new Zend_Mail('iso-2022-jp'); 212 $mailer->setHeaderEncoding(Zend_Mime::ENCODING_BASE64) 213 ->setFrom($from) 214 ->addTo($to) 215 ->setSubject(mb_encode_mimeheader($subject, 'iso-2022-jp')) 216 ->setBodyText(mb_convert_encoding($body, 'JIS', 'UTF-8'), 'iso-2022-jp', Zend_Mime::ENCODING_7BIT); 217 218 if ($envelopeFrom = sfConfig::get('op_mail_envelope_from')) 219 { 220 $mailer->setReturnPath($envelopeFrom); 221 }
関連情報¶
http://framework.zend.com/manual/1.12/ja/zend.mail.additional-headers.html
Note: Return-Path
もしメールに Return-Path を設定する場合は、sendmail トランスポートの設定をご覧ください。 残念ながら、 setReturnPath($email) メソッドはこの目的を果たしません。
http://framework.zend.com/manual/1.12/ja/zend.mail.introduction.html#zend.mail.introduction.sendmail
Related issues
Associated revisions
History
#1
Updated by Mutsumi Imamura almost 9 years ago
- Copied from Bug(バグ) #3358: OpenPNE.ymlに設定したmail_envelope_fromがReturnPathに反映されない added
#2
Updated by Akihiro KOBAYASHI almost 9 years ago
- File opMailSend.class.php View added
プルリクエストしました
https://github.com/openpne/OpenPNE3/pull/118
able to reflect the data of "mail_envelope_from" to "ReturnPath"(fixed #3582)
一応念のため、修正ファイルも添付しておきます
#3
Updated by Akihiro KOBAYASHI almost 9 years ago
- Status changed from New(新規) to Accepted(着手)
#4
Updated by Akihiro KOBAYASHI almost 9 years ago
- Status changed from Accepted(着手) to Pending Review(レビュー待ち)
- % Done changed from 0 to 50
#5
Updated by Mutsumi Imamura almost 9 years ago
- Assignee set to Akihiro KOBAYASHI
#6
Updated by Yuya Watanabe almost 9 years ago
- Status changed from Pending Review(レビュー待ち) to Rejected(差し戻し)
note-2 のプルリクエストは master 向けのようです. stable-3.8.x 向けのものでプルリクエストをお願いします.
#7
Updated by Akihiro KOBAYASHI almost 9 years ago
- Status changed from Rejected(差し戻し) to Accepted(着手)
- % Done changed from 50 to 0
#8
Updated by Akihiro KOBAYASHI almost 9 years ago
- Status changed from Accepted(着手) to Pending Review(レビュー待ち)
- % Done changed from 0 to 50
#9
Updated by Rimpei Ogawa almost 9 years ago
#3358 note-6, 7 の内容を以下でプルリクエストしています。
fixed mail Return-Path header (BP for stable-3.8.x) by balibali · Pull Request #124 · openpne/OpenPNE3
https://github.com/openpne/OpenPNE3/pull/124
#10
Updated by Yuya Watanabe almost 9 years ago
- Status changed from Pending Review(レビュー待ち) to Pending Testing(テスト待ち)
- % Done changed from 50 to 70
#11
Updated by isao sano almost 9 years ago
- Status changed from Pending Testing(テスト待ち) to Fixed(完了)
- % Done changed from 70 to 100
確認いたしました。問題ありません。