Some people are receiving newsletters for every cron run, even though I get "Delivery Status Notification (Failure)" messages from them. I'm not sure if other users get duplicate newsletters.

So I have to delete them manually from mail_spool and unsubscribe them to avoid the same thing happening in other newsletters.

Is there a way for simplenews to simply ignore if mails are successfully received or not, in order to stop sending them forever? Or is it a problem with the server outside simplenews?

I'm using cron via cpanel. This command: php /home/drupal/cron.php > /dev/null 2>&1

Please tell me what other system details you need.

Comments

berdir’s picture

Status: Active » Postponed (maintainer needs more info)

There are different ways a mail can "fail". How are you sending mails? through an external smtp server, mime mail, ...?

Sending mails is usually an asynchronous process. When a mail is actually "sent" by PHP, it is usally just forwarded to the local (or the configured one) mail server (e.g. postfix). If this happens, then the mail counts as successfully sent for Simplenews and should be marked as such. Only if that first step fails then it is recognised as a failed send for Simplenews.

If then the mail server fails to further deliver the mail, you'll receive such a delivery status notification. But Simplenews will never know that the mail failed to send, unless you set up bounce handling with the separate project (which I've never used and is afaik actually not compatible with 6.x-2.x)

So what you are describing is something that shouldn't happen. The only thing that I can imagine is that Simplenews fails to mark the mail spool entry as sent, for example due to a fatal error between actually sending the mail and trying to mark it as such. But it's strange that this would only happen for specific recipients.

I suggest you try to narrow this down. For example, enable detailed logging in the simplenews settings and then set up a dummy newsletter category with just one of the failing (or maybe a failing and a working) addresses. You need to inform that person in advance of course, or maybe find one that you control yourself where you have this problem. Then, send a newsletter of that category and watch the mail spool table and the recent log messages list to see if the mail is reported as sent or not and what happens to the mail spool table...

MashsaM’s picture

Hello,

Thanks for your patience.

I have the dblogs for the event. Unfortunately I had deleted the mail spool so I could not observe that.

I get this error every cron run, for every email sent:

PHP error:
"Unknown column 'error' in 'field list' query: UPDATE simplenews_mail_spool SET status = 2, error = 0, timestamp = 1325943663 WHERE msid IN(457) em /home/drupal/modules/simplenews/includes/simplenews.mail.inc na linha 426."

Simplenews is being sent via MIME mail.

I've read in another issue that this could be related to the upgrade process. Could this be the case?

berdir’s picture

Status: Postponed (maintainer needs more info) » Fixed

Yes, that query is the problem.

This is the query that attempts to write the result of the sent mail to the database. Because it fails this means that it will re-try on the next run.

It sounds like you are missing the error column, although I have no idea why, that column existed in 6.x-1.x as well, maybe you upgraded from a very old version of Simplenews 6.x-1.x?

Try to add a column called 'error' to the simplenews_mail_spool table according to the schema structure:

'error' => array(
'description' => 'A boolean indicating whether an error occured while sending the email.',
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
),

You might want to install the schema module to see if there are other inconsistencies.

MashsaM’s picture

Fixed! Thank you both.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

mstrelan’s picture

Version: 6.x-2.0-alpha2 » 6.x-2.x-dev
Status: Closed (fixed) » Needs work

Could it be that simplenews_update_6004() doesn't include the 'error' column?

miro_dietiker’s picture

Issue summary: View changes
Status: Needs work » Fixed

Closing old support requests.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.