Cron should process all rows in og2list_inbound_content table

dkruglyak - June 13, 2007 - 08:04
Project:Organic groups list manager
Version:4.7.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:needs review
Description

When an email is received that matches the domain but none of the available list aliases, it gets stuck in og2list_inbound_content table, ignored and neither processed nor cleared in any way. This is obviously wrong, at the very least these invalid emails should be removed.

The fix is trivial and includes a few changes in og2list_cron. First replace the first query to fetch all incoming rows without a join:

    $result = db_query_range('SELECT c.* FROM {og2list_incoming_content} c ORDER BY c.mid ASC', 0, variable_get('og2list_incoming_number', 10));

Second part is to take 3 post-processing delete statements out of count($mail->og_nids) condition:

          db_query('DELETE FROM {og2list_incoming_content} WHERE mid = %d', $mail->mid);
          db_query('DELETE FROM {og2list_incoming_groups} WHERE mid = %d', $mail->mid);
          db_query('DELETE FROM {og2list_attachment} WHERE mid = %d', $mail->mid);

I have this working in production with no problem.

 
 

Drupal is a registered trademark of Dries Buytaert.