6.0.0-git
2019-05-19

[#12867] send reminder does not send mails
Summary send reminder does not send mails
Queue Whups
Queue Version 3.0.0RC3
Type Bug
State Resolved
Priority 1. Low
Owners jan (at) horde (dot) org
Requester samuel.wolf (at) wolf-maschinenbau (dot) de
Created 2013-11-27 (1999 days ago)
Due
Updated 2014-12-04 (1627 days ago)
Assigned 2013-11-28 (1998 days ago)
Resolved 2014-12-04 (1627 days ago)
Milestone
Patch No

History
2014-12-04 13:28:45 Jan Schneider State ⇒ Resolved
 
2014-11-25 17:14:33 samuel (dot) wolf (at) wolf-maschinenbau (dot) de Comment #28 Reply to this comment
Does this fix it?
Yes, thanks!
2014-11-25 16:43:49 Jan Schneider Comment #27
Assigned to Jan Schneider
Reply to this comment
Does this fix it?
2014-11-25 16:43:19 Git Commit Comment #26 Reply to this comment
Changes have been made in Git (FRAMEWORK_5_2):

commit 390d98c1eb357a8c602627a01eb5add9d3e8e109
Author: Jan Schneider <jan@horde.org>
Date:   Tue Nov 25 17:43:52 2014 +0100

     [jan] Fix sending reminders (Bug #12867).

  whups/docs/CHANGES |    1 +
  whups/package.xml  |    4 ++--
  2 files changed, 3 insertions(+), 2 deletions(-)

http://github.com/horde/horde/commit/390d98c1eb357a8c602627a01eb5add9d3e8e109
2014-11-25 16:43:12 Git Commit Comment #25 Reply to this comment
Changes have been made in Git (FRAMEWORK_5_2):

commit 6b9b264b8d12e92bbe5fc6c38a708575a0392aa6
Author: Jan Schneider <jan@horde.org>
Date:   Tue Nov 25 17:39:38 2014 +0100

     Fix sending reminders (Bug #12867).

  whups/lib/Driver.php |    5 ++++-
  1 files changed, 4 insertions(+), 1 deletions(-)

http://github.com/horde/horde/commit/6b9b264b8d12e92bbe5fc6c38a708575a0392aa6
2014-11-25 16:38:58 Git Commit Comment #24 Reply to this comment
Changes have been made in Git (master):

commit 56a7df71748c069f9e8186aca860a4cfcf4160f4
Author: Jan Schneider <jan@horde.org>
Date:   Tue Nov 25 17:39:38 2014 +0100

     Fix sending reminders (Bug #12867).

  whups/lib/Driver.php |    5 ++++-
  1 files changed, 4 insertions(+), 1 deletions(-)

http://github.com/horde/horde/commit/56a7df71748c069f9e8186aca860a4cfcf4160f4
2014-11-25 16:06:09 Jan Schneider Comment #23 Reply to this comment
Commit 7b096cdc9b3257349c3508d2cc8ac1902be88beb is the culprit.
https://github.com/horde/horde/commit/7b096cdc9b3257349c3508d2cc8ac1902be88beb
2014-11-25 14:30:00 samuel (dot) wolf (at) wolf-maschinenbau (dot) de Comment #22 Reply to this comment
@ Jan,

can you reproduce this issue with this informations?
2014-10-14 13:07:38 guenter (at) zamia (dot) org Comment #21 Reply to this comment
we just investigated this a bit further: problem seems to originate in 
this if-statement (Driver.php:515)

             if ($details && $details['type'] == 'user') {
                 $user_prefs = $GLOBALS['injector']
                     ->getInstance('Horde_Core_Factory_Prefs')
                     ->create('whups', array('user' => $details['user']));
                 if ($from['type'] == 'user' &&
                     $details['user'] == $from['user'] &&
                     $user_prefs->getValue('email_others_only')) {
                     continue;
                 }
             }

if we set email_others_only to 0, reminders are being sent. if we 
leave it to (default) 1, reminders are skipped because 
$details['user'] == $from['user']. this seems to originate from 
Whoups.php:960:

             $whups_driver->mail(array('recipients' => array($user => 'owner'),
                                       'subject' => $subject,
                                       'view' => $view,
                                       'template' => $message_file,
                                       'from' => $user));

where the same user is set in the recipients list as in the from field.


2014-10-13 17:44:36 samuel (dot) wolf (at) wolf-maschinenbau (dot) de Comment #20 Reply to this comment
whups/lib/Driver.php
             /* We may have no recipients due to users excluding themselves
              * from self notifies. */
             if (!$to) {
                 continue;
             }
             if ($details && $details['type'] == 'user') {
                 $user_prefs = $GLOBALS['injector']
                     ->getInstance('Horde_Core_Factory_Prefs')
                     ->create('whups', array('user' => $details['user']));
                 if ($from['type'] == 'user' &&
                     $details['user'] == $from['user'] &&
                     $user_prefs->getValue('email_others_only')) {
                       Horde::debug($from);
                        mail('samuel.wolf@wolf-maschinenbau.de','test--1', 
'nachrichttext');
                     continue;
                 }
             }
             mail('samuel.wolf@wolf-maschinenbau.de','test--2', 
'nachrichttext');
             if ($opts['ticket']) {
                 /* Add attachments. */


I receive "test--1", but never "test--2".


Horde Debug:

2014-10-13T19:28:18+02:00 DEBUG: Variable information:
array(4) {
   ["user"]=>
   string(11) "samuel.wolf"
   ["type"]=>
   string(4) "user"
   ["name"]=>
   string(11) "Samuel Wolf"
   ["email"]=>
   object(Horde_Mail_Rfc822_Address)#607 (4) {
     ["comment"]=>
     array(0) {
     }
     ["mailbox"]=>
     string(11) "samuel.wolf"
     ["_host":protected]=>
     string(20) "wolf-maschinenbau.de"
     ["_personal":protected]=>
     NULL
   }
}

../whups/config/prefs.local.php
$_prefs['email_others_only']['value'] = 1;
2014-10-13 13:21:23 Michael Rubinsky Comment #19 Reply to this comment
Anyway, next you should look in Whups_Driver::mail() to see where
things are failing. The mail is sent around line 614 .. $mail->send()
In which file?
whups/lib/Driver.php
2014-10-13 08:23:59 samuel (dot) wolf (at) wolf-maschinenbau (dot) de Comment #18 Reply to this comment
Anyway, next you should look in Whups_Driver::mail() to see where 
things are failing. The mail is sent around line 614 .. $mail->send()
In which file?
2014-10-12 21:46:50 Michael Rubinsky Comment #17 Reply to this comment

[Show Quoted Text - 13 lines]
Your install may, or may not be using PHP's mail() function - it 
depends on the transport you have configured.

Anyway, next you should look in Whups_Driver::mail() to see where 
things are failing. The mail is sent around line 614 .. $mail->send()
2014-10-12 11:43:45 samuel (dot) wolf (at) wolf-maschinenbau (dot) de Comment #16 Reply to this comment
$view->tickets = $utickets;
$subject = _("Reminder: Your open tickets");

Horde::debug($subject);
mail('samuel.wolf@wolf-maschinenbau.de','test', 'nachrichttext');

$whups_driver->mail(array('recipients' => array($user => 'owner'),
                                       'subject' => $subject,
                                       'view' => $view,
                                       'template' => $message_file,
                                       'from' => $user));

PHP mail work, I receive the test mail.
2014-10-11 17:04:35 samuel (dot) wolf (at) wolf-maschinenbau (dot) de Comment #15 Reply to this comment
The sending is done in Whups::sendReminders(), in lib/Whups.php
Add debug info in Whups.php:
###########################################################################
             $view->tickets = $utickets;
             $subject = _("Reminder: Your open tickets");
             $whups_driver->mail(array('recipients' => array($user => 'owner'),
                                       'subject' => $subject,
                                       'view' => $view,
                                       'template' => $message_file,
                                       'from' => $user));

             Horde::debug($subject);
###########################################################################

horde_debug.txt show then:
###########################################################################
2014-10-11T18:51:45+02:00 DEBUG: Variable information:
string(32) "Erinnerung: Ihre offenen Tickets"

Backtrace:
1. Whups::sendReminders() /var/www/https/horde/whups/admin/index.php:1133
2. Horde::debug() /var/www/https/horde/whups/lib/Whups.php:974

2014-10-11T18:51:45+02:00 DEBUG: Variable information:
string(32) "Erinnerung: Ihre offenen Tickets"

Backtrace:
1. Whups::sendReminders() /var/www/https/horde/whups/admin/index.php:1133
2. Horde::debug() /var/www/https/horde/whups/lib/Whups.php:974

[...]
###########################################################################

I guess that is the output we like to see and the problem is somewhere else.
Is there a way to pass the mail array into horde_debug.txt?

Whats the next step?

Note: Send mail on ticket creation/edit works.
2014-08-01 21:30:29 Jan Schneider Comment #14 Reply to this comment
The sending is done in Whups::sendReminders(), in lib/Whups.php
2014-08-01 15:17:14 samuel (dot) wolf (at) wolf-maschinenbau (dot) de Comment #13 Reply to this comment
Is there a point to start track down this issue?
whups 3.0.0 stable
horde 5.2.0 stable
2013-12-06 10:10:56 Jan Schneider Comment #12 Reply to this comment
Those are harmless PHP notices.
2013-12-05 22:26:24 samuel (dot) wolf (at) wolf-maschinenbau (dot) de Comment #11
New Attachment: horde_debug.log
Reply to this comment
better to read...
2013-12-05 22:24:33 samuel (dot) wolf (at) wolf-maschinenbau (dot) de Comment #10 Reply to this comment
Horde DEBUG log:
[...]
2013-12-05T23:17:45+01:00 DEBUG: HORDE [whups] PHP ERROR: Declaration 
of Horde_Form_Type_invalid::init() should be compatible with 
Horde_Form_Type::init() [pid 24373 on line 3839 of 
"/usr/share/php/Horde/Form/Type.php"]
2013-12-05T23:17:45+01:00 DEBUG: HORDE [whups] PHP ERROR: Declaration 
of Horde_Form_Type_country::init() should be compatible with 
Horde_Form_Type::init() [pid 24373 on line 908 of 
"/usr/share/php/Horde/Form/Type.php"]
2013-12-05T23:17:45+01:00 DEBUG: HORDE [whups] SQL  (0.0001s)
[...]
2013-12-05T23:17:45+01:00 DEBUG: HORDE [whups] PHP ERROR: Only 
variables should be assigned by reference [pid 24373 on line 47 of 
"/var/www/https/horde4/whups/lib/Form/SendReminder.php"]
[...]
2013-12-05T23:17:45+01:00 DEBUG: HORDE [whups] SQL  (0.0000s)
         SELECT ticket_id as id, ticket_owner as owner FROM whups_ticket_owners
           WHERE ticket_id = 723 [pid 24373 on line 319 of 
"/usr/share/php/Horde/Db/Adapter/Mysqli.php"]
2013-12-05T23:17:45+01:00 DEBUG: HORDE [whups] Reminders were sent. 
[pid 24373 on line 27 of 
"/usr/share/php/Horde/Core/Notification/Handler/Decorator/Hordelog.php"]
2013-12-05T23:17:45+01:00 DEBUG: HORDE [whups] SQL  (0.0004s)
[...]
2013-12-05T23:17:45+01:00 DEBUG: HORDE [whups] PHP ERROR: Only 
variables should be assigned by reference [pid 24373 on line 201 of 
"/usr/share/php/Horde/Form/Renderer.php"]
2013-12-05T23:17:45+01:00 DEBUG: HORDE [whups] PHP ERROR: Only 
variables should be assigned by reference [pid 24373 on line 232 of 
"/usr/share/php/Horde/Form/Renderer.php"]
2013-12-05T23:17:45+01:00 DEBUG: HORDE [whups] PHP ERROR: Only 
variables should be assigned by reference [pid 24373 on line 201 of 
"/usr/share/php/Horde/Form/Renderer.php"]
2013-12-05T23:17:45+01:00 DEBUG: HORDE [whups] PHP ERROR: Only 
variables should be assigned by reference [pid 24373 on line 232 of 
"/usr/share/php/Horde/Form/Renderer.php"]
2013-12-05T23:17:45+01:00 DEBUG: HORDE [whups] Max memory usage: 
20185088 bytes [pid 24373 on line 598 of 
"/usr/share/php/Horde/Registry.php"]
[...]
2013-11-29 13:04:14 samuel (dot) wolf (at) wolf-maschinenbau (dot) de Comment #9 Reply to this comment
I assume the assignee has an email address set in his preferences?
Yes ;-)
Other than that, no idea.
Will debug it on the weekend, maybe there some more information in the 
horde debug log.
2013-11-29 11:59:28 Jan Schneider Comment #8 Reply to this comment
I assume the assignee has an email address set in his preferences? 
Other than that, no idea.
2013-11-29 10:57:42 samuel (dot) wolf (at) wolf-maschinenbau (dot) de Comment #7 Reply to this comment
There's a difference between states and state categories. You can 
name your states any way you like, but make sure that your 
"Zugewiesen" state is of the state *category* "Assigned/Zugewiesen".
That is not the problem:
* State Name [ Zugewiesen ]
* State Description [ Someone has accepted responsibility for the ticket. ]
* State Category [ Assigned ]
2013-11-29 10:43:28 Jan Schneider Comment #6 Reply to this comment
There's a difference between states and state categories. You can name 
your states any way you like, but make sure that your "Zugewiesen" 
state is of the state *category* "Assigned/Zugewiesen".
2013-11-29 10:26:54 samuel (dot) wolf (at) wolf-maschinenbau (dot) de Comment #5
New Attachment: send_reminder_whups.png Download
Reply to this comment
You need states of the category "Assigned" and tickets need to be 
set to this state.
In my case "Zugewiesen", it work definitely in early versions RC1 or Beta.

2013-11-29 10:11:21 Jan Schneider Comment #4 Reply to this comment
You need states of the category "Assigned" and tickets need to be set 
to this state.
2013-11-28 16:59:19 samuel (dot) wolf (at) wolf-maschinenbau (dot) de Comment #3
New Attachment: customize_stats.png Download
Reply to this comment
Cannot reproduces, reminders are sent to assignees instantly here.
Is it a problem that we customize the stats?
If not, RC3 missing some git commits or I forget a config for send reminders?

2013-11-28 11:08:09 Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
Cannot reproduces, reminders are sent to assignees instantly here.
2013-11-27 11:31:10 samuel (dot) wolf (at) wolf-maschinenbau (dot) de Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Summary ⇒ send reminder does not send mails
Queue ⇒ Whups
Milestone ⇒
Patch ⇒ No
Reply to this comment
If I send reminders for a selected queue the notification comes up 
with "Reminders were sent.", but not one email were send.
No errors in the php error log.

Saved Queries