[imp] Return-Path/redirect problem

Liam Hoekenga liamr at umich.edu
Tue Jan 21 17:37:31 PST 2003


Which version of compose is going to end up in 3.2?  Is 2.621 (or a 
descendant) likely to make it into the release, or could the code be 
back-ported in time for the next release?

> As I said, if someone tests out a sendmail patch, verifies it works, 
> and
> sends it to me, I'll get it into PEAR.

This is against PEAR Mail v1.0.2.   It's lifted directly from 
Mail/smtp.php, and it seems to work, though I've only done minor 
testing.

diff -U 2 /usr/local/php-4.2.3/lib/pear/Mail/sendmail.php sendmail.php
--- /usr/local/php-4.2.3/lib/pear/Mail/sendmail.php     Mon Jan 13 
14:35:55 2003
+++ sendmail.php        Tue Jan 21 17:31:25 2003
@@ -95,4 +95,12 @@

          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.');



More information about the imp mailing list