cvs: pear /Mail/Mail smtp.php
| From: | Richard Heyes | Date: | Fri, 23 Aug 2002 21:11:51 +0000 |
| Subject: | cvs: pear /Mail/Mail smtp.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-5914@lists.php.net to get a copy of this message | ||
richard Fri Aug 23 17:11:51 2002 EDT
Modified files:
/pear/Mail/Mail smtp.php
Log:
Add patch for Return-Path provided by Chuck/Chris Adams
Cheers.
Index: pear/Mail/Mail/smtp.php
diff -u pear/Mail/Mail/smtp.php:1.1 pear/Mail/Mail/smtp.php:1.2
--- pear/Mail/Mail/smtp.php:1.1 Sun Jul 21 03:37:25 2002
+++ pear/Mail/Mail/smtp.php Fri Aug 23 17:11:51 2002
@@ -23,7 +23,7 @@
* Net_SMTP:: class.
* @access public
* @package Mail
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
class Mail_smtp extends Mail {
@@ -121,6 +121,14 @@
}
list($from, $text_headers) = $this->prepareHeaders($headers);
+
+ // Since few MTAs are going to allow this header to be forged
+ // unless it's in the MAIL FROM: exchange, we'll use Return-Path
+ // instead of From: if it's set
+ if (!empty($headers['Return-Path'])) {
+ $from = $headers['Return-Path'];
+ }
+
if (!isset($from)) {
return new PEAR_Error('No from address given');
}