dakira / myroundcube

Automatically exported from code.google.com/p/myroundcube
0 stars 0 forks source link

[scheduled_sending] cron script (cron/sendmail.php) does not send out email messages #817

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Token: 93dd1aaaa302e8cb644a08cd8490947c (Don't modify this token!)
Version: 2.0.35 (14-04-2015)
PHP: 5.4.37
RCMAIL: 1.1.1
Database: mysql
SERVER: Apache/2
----
I.  Issue Description:

The cron script (scheduled_sending/cron/sendmail.php) does not send out the 
messages that are queued up for later delivery.

II. Steps to reproduce the Issue:
1. Create a new mail message in rouncube.
2. Set the message for scheduled_sending in the future.
3. Wait for the cron job to run. 

The cron job does get invoked and the scheduled_sending plugin is configured 
properly.

NOTE: I WAS ABLE TO FIX THIS AS FOLLOWS:

In the scheduled_sending/cron/sendmail.php script, the query uses the variable 
$time_start_s

$result=$rcmail->db->query("SELECT * FROM 
".dbtable(get_table_name('scheduled_sending'),$rcmail)." ^M
   WHERE ".dbq('runtime',$rcmail)."<? AND ".dbq('flag',$rcmail)."=?",$time_start_s,0);

$time_start_s has a NULL value, thus the query doesn't return values.  The 
variable $time_start does have a value (set previously in the script).  I 
changed the code to the following and the mail was sent correctly:

$result=$rcmail->db->query("SELECT * FROM 
".dbtable(get_table_name('scheduled_sending'),$rcmail)." ^M
   WHERE ".dbq('runtime',$rcmail)."<? AND ".dbq('flag',$rcmail)."=?",$time_start,0);

Original issue reported on code.google.com by skarama...@gmail.com on 1 May 2015 at 3:43

GoogleCodeExporter commented 8 years ago
I don't know where this assignment got lost. The appropiate fix is to insert @ 
top below $time_start ...

$time_start_s = time();

I have released a fix. Thanks!

Original comment by myroundc...@gmail.com on 1 May 2015 at 3:53