I'm using the CS SVN version as of Apr24 including all the latest db changes. When trying to manually send a message I get a page-not-found error for:

admin/massmailer/queue?confirm=1

Cron.php called manually by an logged-in admin runs ok, but will fail if run anonymously. The message is listed as "submitted" but it is not sent.

Comments

dalin’s picture

I'm not sure if this relates at all but I can't access massmailer/phplist/phplist without getting a file not found error (yes the files are there).

It appears that the script is executing the part about updating the phplist db because my phplist_admin table is showing the correct values:

db_query("UPDATE {phplist_admin} SET password = '%s', email = '%s' WHERE loginname = 'admin'", $url['pass'], variable_get('site_mail', ini_get('sendmail_from')));

So it must be hanging up on the CURL part:

$postdata = array( 'login' => 'admin', 'password' => $url['pass']);

	$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;

I do have the CURL extensions:

CURL support enabled
CURL Information libcurl/7.12.0 OpenSSL/0.9.7a ipv6 zlib/1.2.1.2 libidn/0.5.6

I have reached the limits of my knowledge in debugging this. If anyone else has any insights...

dalin’s picture

More details:

When I click "Click here to continue to send" I get the page-not-found error. And it appears that I am "sort of" logged out. I have some blocks that are only shown to anonymous users, and some that are only shown to authenticated users. I see what the anonymous user would see. But I can still go to /admin without complaint, so I am still logged in.

I've confirmed that this is not the standard page-not-found error. A random string for a path will give me the file-not-found, but I see the proper blocks, I'm still logged in.

So massmailer is doing something funky with my session.

dalin’s picture

A bit more research resulted in the discovery that magic quotes was partially to blame for the problem.

Phplist has a .htaccess file here:
/modules/massmailer/engines/phplist/phplist/.htaccess

It turns magic_quotes_gpc on. This seems to cause problems on my host however. with MQ on I wasn't able to run phplist at all, I couldn't even view a readme.txt file in the directory. But turning magic_quotes off worked. I could view the readme and I was even able to send one test message.

The glory was short-lived however as now when I click "Click here to continue to send" I just get a blank screen. I'm not sure what changed (nothing as far as I can tell). But this seems to be a step in the wrong direction, atleast before I got a page-not-found-error, now nothing. Strangely enough I can still get to /modules/massmailer/engines/phplist/phplist/admin (but I'm not logged in).

And once again I'm at a point where I don't know how to continue debugging from here.

ekendra’s picture

i have the exact same issue. i sort of get 'logged out' when i do a manual send and nothing gets sent. and the submitted messages remain in the queue. how did you go with this as of course im very interested now.

ekendra’s picture

when i manually run cron.php it doesn't seem to do anything either? did u ever manage to get this happening?

dalin’s picture

ok, after much trial I've discovered the problem. What made this such a pain is the fact that it's actually two different problems.

The first being that I was running my entire site via SSL. Something in the mix didn't like that: atempting to manually send the messages just gave me a blank screen, same with trying to access phplist directly. If I dissable SSL and ran everything via good ol' http It would've worked worked were it not for the second problem.

My host (site5) doesn't run php as an appache module like most do, it runs it in CGI mode. This is good for security, but has the unfortunate effect of causing .htaccess "php_value" settings to really screw things up. Because phplist's .htaccess file includes "php_value magic_quotes_gpc on" I got a 404 error for every page I tried to view in that directory or lower. I couldn't even view a .txt file without getting "page not found". Commenting out the line makes all the problems go away.

You might say "But drupal's .htaccess file does the same thing". Yes but drupal's php_value settings are enclosed in if statements:

<IfModule mod_php4.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
</IfModule>
<IfModule sapi_apache2.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
</IfModule>

I will role a patch to do the same for this .htaccess file
As for the SSL problems I don't even know what would cause this problem.

dalin’s picture

hmmm. Not completely working yet. Mails are being sent, however I can't access /modules/massmailer/engines/phplist/phplist (I get a blank page) hence the unsubscribe links won't work.

A search leads me to believe that I'm the only one having this issue. So close yet so far.

dalin’s picture

I've posted a patch here:

http://civicspacelabs.org/home/node/16805

Unfortunately the patch cannot be applied to the Massmailer CVS here at drupal.org because the .htaccess file is included with phplist and not the drupal module.

sethcohn’s picture

Dave, you aren't the only one having the problem... I 'inherited' a site with similar troubles, and have identical results...