Hello,

I'm migrating my database from postgresql to mysql and
I found a problem with the order that the rules are read.

I have this registers in policy table.
+----+----------------------+-----------------+-----------------+------------------------------+
| id | policy_name   | spam_tag2_level | spam_kill_level |
spam_quarantine_cutoff_level |
+----+----------------------+-----------------+-----------------+------------------------------+
|  4 | domain.com    |               5 |               9 |
              20 |
+----+------------------+---------------------+-----------------+------------------------------+
|  5 | [email protected]     |               3 |               7 |
                     20 |
+----+------------------+---------------------+-----------------+------------------------------+

users table:
+----+----------+-----------+-------------------+----------+-------+
| id | priority | policy_id | email             | fullname | local |
+----+----------+-----------+-------------------+----------+-------+
|  2 |        7 |         4 | @domain.com | NULL     | Y     |
+----+----------+-----------+-------------------+----------+-------+
|  3 |        7 |         5 | [email protected] | NULL     | Y     |
+----+----------+-----------+-------------------+----------+-------+

When the account '[email protected]' receive an e-mail, amavisd works
with the values defined
to policy 'domain.com' rather than work with specific rules
(policy_name [email protected]).

With postgresql database I didn't have this problem.

To fix it, I've added in amavisd.conf the following content.

$sql_select_policy = 'SELECT *,users.id FROM users,policy'.
     ' WHERE (users.policy_id=policy.id) AND (users.email IN (%k))'.
     ' ORDER BY users.priority,users.id DESC';

It works, but I would like to know if it is correct.

Regards,

Lucas

------------------------------------------------------------------------------
_______________________________________________
AMaViS-user mailing list
[email protected] 
https://lists.sourceforge.net/lists/listinfo/amavis-user 
 AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3 
 AMaViS-HowTos:http://www.amavis.org/howto/ 

Reply via email to