[#6182] convert_prefs_to_sql.php results in duplicate blacklist / whitelist rules
Summary convert_prefs_to_sql.php results in duplicate blacklist / whitelist rules
Queue Ingo
Queue Version 1.2-RC2
Type Bug
State Resolved
Priority 1. Low
Owners Jan Schneider <jan (at) horde (dot) org>
Requester liamr (at) deathstar (dot) org
Created 01/31/2008 (101 days ago)
Due
Updated 02/28/2008 (73 days ago)
Assigned 01/31/2008 (101 days ago)
Resolved 02/28/2008 (73 days ago)
Attachments
Milestone
Patch

History
02/28/2008 Jan Schneider Comment #3
State ⇒ Resolved
Taken from Horde DevelopersHorde Developers
Assigned to Jan Schneider
Reply to this comment
Fixed.
01/31/2008 Jan Schneider State ⇒ Assigned
Assigned to Horde DevelopersHorde Developers
 
01/31/2008 liamr (at) deathstar (dot) org Comment #2 Reply to this comment
The entry from horde_prefs that generated that set of rules is..

ingo          auto_update          1
ingo         rules        

Array
(
    [0] => Array
        (
            [name] => Whitelist
            [action] => 9
            [disable] =>
        )

    [1] => Array
        (
            [name] => Blacklist
            [action] => 7
            [disable] => 1
        )

    [2] => Array
        (
            [name] => machinemail
            [combine] => 2
            [conditions] => Array
                (
                    [0] => Array
                        (
                            [field] => From
                            [type] => 1
                            [match] => contains
                            [value] => root from scratch
                        )

                    [1] => Array
                        (
                            [field] => From
                            [type] => 1
                            [match] => contains
                            [value] => root@example.edu
                        )

                    [2] => Array
                        (
                            [field] => From
                            [type] => 1
                            [match] => contains
                            [value] => the root of all evil
                        )

                    [3] => Array
                        (
                            [field] => From
                            [type] => 1
                            [match] => contains
                            [value] => nefu-monitor
                        )

                    [4] => Array
                        (
                            [field] => From
                            [type] => 1
                            [match] => contains
                            [value] => flume
                        )

                )

            [action-value] => vacationfilter
            [action] => 2
            [stop] => 1
            [flags] => 0
            [disable] => 1
        )

    [3] => Array
        (
            [name] => ITCS SpamBox
            [combine] => 1
            [conditions] => Array
                (
                    [0] => Array
                        (
                            [field] => X-DSPAM-Result
                            [type] => 1
                            [match] => is
                            [value] => Spam
                        )

                )

            [action-value] => SpamBox
            [action] => 2
            [stop] => 1
            [flags] => 0
        )

)

ingo         whitelist        

Array
(
    [0] => address@example.com
    [1] => address@example.net
    [2] => address@example.org
)
01/31/2008 liamr (at) deathstar (dot) org Comment #1
Queue ⇒ Ingo
Summary ⇒ convert_prefs_to_sql.php results in duplicate blacklist / whitelist rules
Type ⇒ Bug
Priority ⇒ 1. Low
State ⇒ Unconfirmed
Reply to this comment
After running convert_prefs_to_sql.php, I ended up with two sets of "Whitelist / Blacklist" rules in positions 1-4.  It seems to happen randomly.. it worked for my account right now, but other users in this batch have the issue:

+---------+------------+-----------+-------------+------------+------------+-----------------+--------------+-----------+-------------+------------+
| rule_id | rule_owner | rule_name | rule_action | rule_value | rule_flags | rule_conditions | rule_combine | rule_stop | rule_active | rule_order |
+---------+------------+-----------+-------------+------------+------------+-----------------+--------------+-----------+-------------+------------+
|       1 | amw        | Whitelist |           9 | NULL       |       NULL | NULL            |         NULL |      NULL |           1 |          1 |
|       3 | amw        | Blacklist |           7 |            |       NULL | NULL            |         NULL |      NULL |           1 |          3 |
|       6 | amw        | Whitelist |           9 |            |          0 | a:0:{}          |            1 |         1 |           1 |          6 |
|       7 | amw        | Blacklist |           7 |            |          0 | a:0:{}          |            1 |         1 |           0 |          7 |
+---------+------------+-----------+-------------+------------+------------+-----------------+--------------+-----------+-------------+------------+
4 rows in set (0.00 sec)

This was a freshly created set of ingo_ tables, and the original horde_prefs ingo rules pref don't have  multiple blacklist and whitelist entries.