[dev] Whups 3.0 Mail Filter

Chris Smith chris.adam.smith at gmail.com
Thu May 23 15:10:13 UTC 2013


Hi,

Again, thanks for all your hard work with Horde, it's so very much
appreciated- hopefully soon I'll be able to contribute a theme back to you!

I recently posted a bug report recently against Whups 3.0-git about its
handling of the mail filter (/usr/bin/whups-mail-filter), although I was
disappointed not to receive a reply (even a rejection for being an idiot!).

Does anyone have the whups-mail-filter running from whups 3.0 (H5 stable)
correctly? I note that I can't reply to emails sent from bugs.horde.org, so
I guess the Horde projects itself currently doesn't use this feature?

The problem I was having involved the mail filter refusing to load a list
of the application's queues- I've since stripped apart what's happening,
and wonder if anyone could please give me a hand?

What happens:
Run: /usr/bin/whups-mail-filter --queue-id 6
Error:
====================

Fatal Error:
--queue-name or --queue-id must specify a valid and public queue. Available
queues:

1. Horde_Cli->fatal() /usr/bin/whups-mail-filter:180

====================

Which is odd, because I've trashed all of the permissions in Horde relating
to whups, yet there are still no queues shown- they should be listed after
"Available queues:"

Code:
if (isset($opts_hash['--queue-id'])) {
 $queues = $whups_driver->getQueues();
 foreach ($queues as $queueId => $queueName) {
        if (strcasecmp($queueId, $opts_hash['--queue-id']) == 0) {
            $info['queue'] = $queueId;
            break;
        }
}
.. then later...
if (isset($queues)) {
            $msg .= ' ' . _("Available queues:") . _dump($queues);
        }


But $queues is always empty although you can see them as a protected
property of the Whups_Driver object:
...
 ["_queues":protected]=>
  array(5) {
    [14]=>
    string(10) "EmailQueue"
    [7]=>
    string(9) "XXXX"
    [6]=>
    string(8) "YYYY"
    [9]=>
    string(5) "ZZZZ "
    [8]=>
    string(5) "AAAA"
  }
..

I'd trash all of the permissions themselves, but it's impossible from
within Horde.
The same happens when you try to search for a single Queue, e.g. from
/lib/Ticket.php:

$queue = $whups_driver->getQueue($info['queue']);
$queue is always empty.

I've a little PHP experience- I've managed to force the filter to accept
the Ticket by explicitly setting the $info array within the
'whups-mail-filter' script
I can create separate filters for each of the queues, but it seems this way
won't update an existing ticket.

What's even more strange is how it creates the ticket. When I force the
acceptance of the New Ticket by setting the $info array, the ticket is
created correctly. Which is perfect, thanks!
But before the end of processing the filter script it gives this warning:
====================

Fatal Error:
You do not have permission to access this ticket (30).
In /var/https/life/whups/lib/Driver/Sql.php on line 1154

1. Whups_Mail::processMail() /usr/bin/whups-mail-filter:192
2. Whups_Ticket::newTicket() /var/https/whups/lib/Mail.php:219
3. Whups_Ticket->notify() /var/https/whups/lib/Ticket.php:136
4. Whups_Driver_Sql->getListeners() /var/https/whups/lib/Ticket.php:844
5. Whups_Driver_Sql->getTicketDetails()
/var/https/whups/lib/Driver/Sql.php:2676

====================
Which should not be the case- even if I change the permissions of Whups
(Tickets, Form Replies and Queues) to:
Guest: Allow: Show,Read, Edit, Delete
Authenticated users: Allow: Show,Read, Edit, Delete

If you've read this far, thank you! If you please have any clues as to what
I can try to have get the filter accepting mail I'd be very grateful.

Is this an effect of using the git version of whups, even though it's the
stable build?

Lastly, versions:
Linux: 64bit 12.04 LTS
PHP 5.3.10-1 with Suhosin-Patch (cli) Zend Engine v2.3.0,
Apache/2.2.22
mysql  Ver 14.14 Distrib 5.5.29
Horde 5.0.4 (recently upgraded using "pear -a -B -c horde" - was aiming for
5.1 but apparently it's not been released to stable yet, so it just updated
some of the packages)

Any pointers or suggestions would be most appreciated, thanks!


More information about the dev mailing list