View Issue Details

IDProjectCategoryView StatusLast Update
0008549phplist applicationMessage Send Processpublic18-02-08 14:08
Reporterdanieleint 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.10.3 
Target Version2.10.7Fixed in Version2.10.5 
Summary0008549: message envelope not passed to php mailer, phpmailer does not set the correct Sender
DescriptionSe the summary and the patch.
Steps To ReproduceSend a newsletter using default values and set $message_envelope.
The message is sent with the wrong envelope sender.
TagsNo tags attached.

Relationships

related to 0003721 closed phplist 2.10.x 

Activities

16-11-06 09:13

 

set_envelope_with_phpmailer.patch (1,638 bytes)
Index: httpdocs/lists/admin/lib.php
===================================================================
--- httpdocs/lists/admin/lib.php	(revision 154)
+++ httpdocs/lists/admin/lib.php	(working copy)
@@ -257,6 +257,8 @@
 
   if (!ereg("dev",VERSION)) {
     $mail = new PHPlistMailer('systemmessage',$to);
+    # TODO: error handling
+    $mail->Sender = $GLOBALS["message_envelope"]; 
     $destinationemail = $to;
     $mail->add_text($message);
   } else {
@@ -268,6 +270,8 @@
         return 0;
       } else {
         $mail = new PHPlistMailer('systemmessage',$GLOBALS["developer_email"]);
+        # TODO: error handling
+        $mail->Sender = $GLOBALS["message_envelope"]; 
         $mail->add_text($message);
         $destinationemail = $GLOBALS["developer_email"];
       }
Index: httpdocs/lists/admin/phpmailer/class.phpmailer.php
===================================================================
--- httpdocs/lists/admin/phpmailer/class.phpmailer.php	(revision 154)
+++ httpdocs/lists/admin/phpmailer/class.phpmailer.php	(working copy)
@@ -435,7 +435,10 @@
                         $header, $params);
         }
         else
-            $rt = @mail($to, $this->EncodeHeader($this->Subject), $body, $header);
+            # TODO: error handling
+            ini_set("sendmail_from", $this->Sender);
+            $params = sprintf("-oi -f %s", $this->Sender);
+            $rt = @mail($to, $this->EncodeHeader($this->Subject), $body, $header, $params);
 
         if (isset($old_from))
             ini_set("sendmail_from", $old_from);
@@ -1499,4 +1502,4 @@
     }
 }
 
-?>
\ No newline at end of file
+?>

hola

26-11-06 21:02

reporter   ~0021411

hello - I am not sure why you are adding the new logic to phpmailer - if you look at the conditional that would invoke the code you changed the else is dealing with the Sender param not being sent

if ($this->Sender != "" && strlen(ini_get("safe_mode"))< 1)

danieleint

06-12-06 15:36

reporter   ~0021765

Hellp, hola is right.
The patch should be valid for the file lists/admin/lib.php

michiel

18-12-06 17:43

manager   ~0022107

the use of ini_set("sendmail_from", $this->Sender);
in your patch suggests you're working on a windows system.
That makes it harder to test for me to see that it works.

So, am I correct to understand that you think that changing

if ($this->Sender != "" && strlen(ini_get("safe_mode"))< 1)

in lib.php will fix it instead?

hola

18-12-06 20:06

reporter   ~0022112

hmmm that code you mention Michiel was already in the phpmailer class - I doubled checked on your 2.10.3 release and here it is below

 if ($this->Sender != "" && strlen(ini_get("safe_mode"))< 1)
        {
            $old_from = ini_get("sendmail_from");
            ini_set("sendmail_from", $this->Sender);
            $params = sprintf("-oi -f %s", $this->Sender);
            $rt = @mail($to, $this->EncodeHeader($this->Subject), $body,
                        $header, $params);
        }
        else
            $rt = @mail($to, $this->EncodeHeader($this->Subject), $body, $header);

hola

18-12-06 20:07

reporter   ~0022113

Can you please highlight why this would be an issue on non-windows platforms as I am running phplist on Linux

michiel

18-12-06 20:28

manager   ~0022116

well, I don't get the problem on Linux at all, so to get it fixed, someone with windows will have to figure out how to fix it.

hola

18-12-06 20:32

reporter   ~0022117

I don't even know what the problem is with phpmailer. I was just commenting on the fact that phpmailer already had the set_ini. I think I am missing something here... I will just watch from now on.

user1822

30-07-07 17:01

  ~0029870

envelope included in mail object construction of PHPListMailer
Second patch was already like this.
This issues report is quite confusing, try to be more clear:
• What did you do (incl. platform)
• What did you expect
• What did you get