I am using simplenews 1.1.2.10 with Drupal 4.6.3 (minor modifications - none that should affect mail).

I also have the following modules installed

smtp module
mail module

Generating a newsletter and sending only sends to the first 20 email addresses in the subscription list. Subsequent cron runs do not cause the other emails to be sent. I have tested this with over 200 sample email addresses that are all test emails and it is always 20.

All other mail-related tasks work including:
- user sign up
- user requesting lost password
- banner module sending notifications
- contact form on user profiles
- emailpage module
- enewsletter (CVS version)
- feedback module
- rsvp module (4.6.3)
- invite module
- signup module

Any help would be greatly appreciated. I know that it must be something inherent in my configuration or in the server I'm using (FreeBSD, PHP 4.x, php mail) as I know that Drupal uses this module and works just great.

Comments

DriesK’s picture

Very odd. In order to properly investigate this I would have to see chat's going on in the db during sending, but for now a few questions:

1. Does your cron.php actually run? Do you get a message like 'cron run completed' in the logs?

2. If the answer to 1. is yes, are other cron tasks than simplenews sending completed correctly (e.g. updating the search engine db, aggregating content, cleaning up the logs, ...)

3. What happens if you increase the 'initial send time' in simplenews settings? Which value is set now? If you set it to its maximum value, are there still only 20 e-mails being sent?

DriesK’s picture

... would have to see _what's_ going on ... :-)

Patrick Nelson’s picture

DriesK,

Thanks for your extremely quick reply! I'm very grateful.

In response:

1. Does your cron.php actually run? Do you get a message like 'cron run completed' in the logs? Yes. Logs show cron run completing.

2. If the answer to 1. is yes, are other cron tasks than simplenews sending completed correctly (e.g. updating the search engine db, aggregating content, cleaning up the logs, ...). Yes, all other jobs complete well - a regular one is aggregating content which you can clearly see the results of.

3. What happens if you increase the 'initial send time' in simplenews settings? Which value is set now? If you set it to its maximum value, are there still only 20 e-mails being sent? It is set to maximum allowed by 'max_execution_time' which is 55 seconds. I have root access to the server so it would be possible to increase this.

With regards to you "seeing chat's going on in the db during sending", I have no problem providing you the details to do this (I'm a very trusting soul!) if it gets the problem fixed.

Thanks again for your help.

DriesK’s picture

And another question. After the 20 mails are sent, which icon is shown in the 'sent items' tab? 'Sent' or 'Currently sending by cron'?

Patrick Nelson’s picture

The icon shows 'Sent'.

Patrick Nelson’s picture

Furthermore I've put a watchdog task in simplenews.module at line 746 (or thereabouts - my line numbers always seem to vary from everyone elses) as follows:

if(sn_mail_send($node)) {
db_query('UPDATE {sn_subscriptions} SET s_status = %d WHERE snid = %d', 1, $mail->snid);
$message = t('Newsletter %title sent to %email.', array('%title'=>theme('placeholder',$node->title), '%email'=>theme('placeholder',$mail->mail)));
watchdog('simplenews', $message, WATCHDOG_NOTICE);

And I am getting the reports that the emails are going through in the watchdog:

simplenews Dec 7 2005 - 1:16pm Newsletter Test Newsletter sent to XXXXX admin details

But, on the last run, I received absolutely no emails at all!

DriesK’s picture

Ok, so cron works, your experiment shows that all mails are being sent by simplenews, and simplenews therefore 'correctly' thinks that all mails have been sent out. Simplenews 'sends' all the mails (so more than 20), and the mail engine (probably sendmail) reports that the mail was properly accepted. The if (sn_mail_send-statement can't check whether the mail was actually sent, only whether it was correctly accepted by the mail engine.

The solution to your problem therfore has to be found elsewhere: either there is a problem with the sendmail configuration of your hoster, or (and that's more likely) your hoster limits the number of outgoing emails per time unit (can be per hour, per minute, ...). Try to ask them, and ask them if they can change this setting for you (if you can argument that you're not a spammer they may do that). Otherwise, you could use simplenews HEAD, which has a setting specifically to cope with this problem: you can set the number of emails being sent during each cron run. This setting is not available in simplenews 4.6. Unfortunately, simplenews HEAD only works with Drupal HEAD, so maybe it's better to wait until Drupal 4.7 is released, as Drupal HEAD is not stable enough yet.

Patrick Nelson’s picture

DriesK,

With regards to:

"The solution to your problem therfore has to be found elsewhere: either there is a problem with the sendmail configuration of your hoster, or (and that's more likely) your hoster limits the number of outgoing emails per time unit (can be per hour, per minute, ...). Try to ask them, and ask them if they can change this setting for you (if you can argument that you're not a spammer they may do that)"

I have complete control over the server - it's a dedicated server and I own it. So is this something that I could change myself? If so, where would I do it?

Thanks again for your help.

Patrick Nelson’s picture

Status: Active » Fixed

DriesK,

Found it. There is (was!) a mail wrapper on the server that was doing exactly what you said.

So that's absolutely brilliant - thank you very much for your help. And also a big plus for the Drupal community that we have going here: a support request that actually had nothing to do with the core product (Drupal) resolved by another member of the community in less than 2 hours. Where else could you get that?

Regards

Patrick

Patrick Nelson’s picture

Status: Fixed » Closed (fixed)