You're not actually logged out...

Robin Monks - March 28, 2006 - 23:44
Project:Mass Mailer
Version:HEAD
Component:Code - PHPlist engine
Category:task
Priority:normal
Assigned:Unassigned
Status:active
Description

This patch allows Massmailer to use CURL to perform mail sending functions.

Also, I'd like to note that I can't take credit for this...I just tested and posted it.

Robin

#1

Robin Monks - March 28, 2006 - 23:47

project.module ate my attachment...

Robin

AttachmentSize
massmailer_without_cli.patch9.83 KB

#2

killes@www.drop.org - March 28, 2006 - 23:50

The patch is quite unclean and also not against the most recent version of phplist.module. Can I assume that the important changes are in phplist_process_queue? Any other changes that matter?

#3

killes@www.drop.org - March 29, 2006 - 01:38

I've cleaned the patch a bit. There are several places where I disagree with the patch.

-// Drupal sends mails in 8bit mode
-define('TEXTEMAIL_ENCODING','8bit');
-
-// We use PHPmailer for sending.
-define("PHPMAILER",1);
-

@@ -780,7 +780,7 @@ function phplist_send_mail($lids, $mid,

AttachmentSize
massmailer_without_cli.patch.txt5.04 KB

#4

Amazon - March 29, 2006 - 01:47

Robin, could looking into cleaning up the config file.

patch -p0 -u < ../../massmailer_without_cli.patch.txt
patching file engines/phplist/config.php
Hunk #1 FAILED at 74.
1 out of 2 hunks FAILED -- saving rejects to file engines/phplist/config.php.rej
patching file engines/phplist/phplist.module

#5

pauln600 - March 29, 2006 - 13:57

This patch also needs changes to PHPlist... more to come.

Paul N.

#6

Robin Monks - March 30, 2006 - 00:13

I just tested the attached patch to work on a new CivicSpace install. There was a small error which Paul Newby found and I corrected in this illiteration.

Robin

AttachmentSize
massmailer_no_cli_fixed.patch3.97 KB

#7

Robin Monks - March 31, 2006 - 19:33

Gerhard, what changes will be needed before you commit this patch?

Robin

#8

killes@www.drop.org - March 31, 2006 - 22:19

Robin, why are these changes in the patch?

-// Drupal sends mails in 8bit mode
-define('TEXTEMAIL_ENCODING','8bit');
-
-// We use PHPmailer for sending.
-define("PHPMAILER",1);
-

Paul said he didn't make them.

#9

killes@www.drop.org - March 31, 2006 - 23:52
Status:patch (code needs review)» active

applied the patch minus the parts that didn't belong there. Awaiting sql changes.

#10

killes@www.drop.org - April 4, 2006 - 02:23

manual processing of the mail queue seems to log users out.

#11

pauln600 - April 4, 2006 - 15:25

I'm not quite sure what you mean - manual being via the phplist admin interface directly?

Paul N.

#12

killes@www.drop.org - April 4, 2006 - 15:30

manual through the link we present in the Drupal admin menu.

#13

pauln600 - April 4, 2006 - 16:33

After you run it, you need to log back in to Drupal?

Paul N.

#14

killes@www.drop.org - April 4, 2006 - 16:39

yes

#15

pauln600 - April 4, 2006 - 16:46

Hm, I'm not seeing that in my install... anyone else?

The session handler is switched to 'files' in phplist config.php. What's the session handler set to in your drupal site settings.php?

Paul N.

#16

killes@www.drop.org - April 4, 2006 - 16:49

"user" as Drupal requires. It is possible my install is borked. But if phplist changes sets the session handler to files then problems are almost guaranteed.

#17

pauln600 - April 4, 2006 - 16:55

Please explain.

Paul N.

#18

killes@www.drop.org - April 4, 2006 - 17:02

Drupal calls several session function during a page request. All these functions assume that the cookie information is stored in our database (this is what session handler = user means to us) so if they can't find the info because the sessionhandler changed, I expect problems.

#19

pauln600 - April 4, 2006 - 18:16

PHPlist switches the session handler to 'files' and exits on completion. Since any session data in PHPlist would be saved in the filesystem, it shouldn't interfere with the Drupal session data.

#20

pauln600 - April 4, 2006 - 18:38

... also the PHPlist session_start fails because it's preceded by the Drupal session. If it didn't, we would need to disable it to prevent subsequent PHPlist admin access without login.

Pau N.

#21

datura - July 20, 2006 - 19:31
Title:Allow PHPList to use CURL instead of relying on CLI functions.» You're not actually logged out...

Take a look at this code:

  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $base_url.'/modules/massmailer/engines/phplist/phplist/admin/?page=processqueue' );
  curl_setopt($ch, CURLOPT_POST, 1 );
  curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  echo str_replace('<head>',"<head><base href=\"$base_url/modules/massmailer/engines/phplist/phplist/admin/\">",curl_exec($ch));
  exit;

What's happening is that the CURL is trying to access a page that drupal cannot find and returns that to the browser. Since it is CURL accessing the page, and the CURL user is not logged in to drupal, you see "Page not found" and it looks like you're not logged in. But really it is CURL that is not logged in.

The real issue is that the URL that CURL is trying to fetch is not a valid path...I'm digging into that part now.

Considering I haven't yet seen this thing work, any words of encouragement that this is a worthwhile endeavor would be greatly appreciated ;-)

#22

dalin - July 20, 2006 - 20:09

I've managed to get everything except unsubscribe working. Take a look at these issues:

http://drupal.org/node/60205
http://drupal.org/node/61766

 
 

Drupal is a registered trademark of Dries Buytaert.