oscommerce不達メール

|

サーバー設定
/etc/mail/trusted-usersにapacheを追加

不達メールの通知先を変更する件で、以下のファイルの変更方法ですが、
catalog/includes/classes/email.php
admin/includes/classes/email.php

例えば、次のように編集すればいいと思います。

(変更前) 514行目
------------------------------------------------------------
if (EMAIL_TRANSPORT == 'smtp') {
return mail($to_addr, $subject, $this->output, 'From: ' . $from . $this->lf . 'To: ' . $to . $this->lf . implode($this->lf, $this->headers) . $this->lf . implode($this->lf, $xtra_headers));
} else {
return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers));
}
------------------------------------------------------------

(変更後)
------------------------------------------------------------
$bounce_mail_option = '-f' . (defined('BOUNCE_EMAIL_ADDRESS') ? BOUNCE_EMAIL_ADDRESS : STORE_OWNER_EMAIL_ADDRESS);
if (EMAIL_TRANSPORT == 'smtp') {
return mail($to_addr, $subject, $this->output,
('From: ' . $from . $this->lf . 'To: ' . $to . $this->lf . implode($this->lf, $this->headers) . $this->lf . implode($this->lf, $xtra_headers)),
$bounce_mail_option
);
} else {
return mail($to, $subject, $this->output,
('From: ' . $from . $this->lf . implode($this->lf, $this->headers) . $this->lf . implode($this->lf, $xtra_headers)),
$bounce_mail_option
);
}
------------------------------------------------------------
↑ 2007/07/20訂正

-------------------------------------------------

不達メールについて
メンバー登録や注文後に送られる自動送信のメールが不達の場合に指定
のメールアドレスに帰ってくるように出来たらと思うのですが?
mb_send_mailのoptionにreply to:を追加すればいいのでは。
でも相手先のサーバーによってはreplyを見ない場合もあるので
万能ではないはず。
sendmailを使っているなら、-f <<送信元アドレス>>が指定できます。
具体的には、PHP の mail() 関数の5番目の引数で指定できますので、
http://jp.php.net/manual/ja/function.mail.php (例 3)
catalog/includes/classes/email.php
admin/includes/classes/email.php
に少し手を入れれば、通知先を変更できます。

どこかに(例えば [catalog|admin]/includes/application_top.php)
define('EMAIL_BOUNCE', 'webmaster@example.com');
のように転送先を指定する行を挿入して、

以下のファイルの mail() 関数を呼んでいる部分を書き換えます。
catalog/includes/classes/email.php
admin/includes/classes/email.php

例) catalog/includes/classes/email.php L.468
---------------------------------------------------
return mail($to,
$subject,
$this->output,
'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers),
"-f".EMAIL_BOUNCE
);
---------------------------------------------------
ただし、これはメールサーバにパラメータを受け渡すものなので、
メールサーバによっては、うまく働かないかもしれません。

-----------------------------
http://blog.buchanweb.net/?itemid=59

カテゴリ

このブログ記事について

このページは、adminが2006年12月19日 02:29に書いたブログ記事です。

ひとつ前のブログ記事は「zencart1.3用friendly URL」です。

次のブログ記事は「zencart不達メール」です。

最近のコンテンツはインデックスページで見られます。過去に書かれたものはアーカイブのページで見られます。