Paul,

> This is becoming a little off topic. It appears I may have come across
> a problem with MySQL. When I run the query:
> "SELECT wb
> FROM wblist
> LEFT JOIN mailaddr ON wblist.sid = mailaddr.id
> WHERE (
> wblist.rid =1
> )
> AND (
> mailaddr.email
> IN (
> 'webmaster',  'yachtworld',  'com'
> )
> )
> ORDER BY mailaddr.priority DESC
> LIMIT 0 , 30;"
>
> The following error is generated:
> #1271 - Illegal mix of collations for operation ' IN '

It appears you default character set in MySQL (a ./configure option)
is different from the character set of the table  mailaddr.
The table charset as reported by:
  show create table mailaddr;

See section 10.3 of the MySQL manual:
  http://dev.mysql.com/doc/mysql/en/charset-defaults.html

You can use ALTER TABLE to change a charset of a table.
I'm not sure how to change the default charset of the server
except by recompiling it. There may be other easier solutions
that I'm not aware of.


Btw (unrelated to the above), the following test case
does not match what amavisd supplies as keys:

> IN ('webmaster',  'yachtworld',  'com')

as your log shows:

> (31600-04) lookup_sql  "[EMAIL PROTECTED]",
>   query args: "1", "[EMAIL PROTECTED]",
>   "@yachtworld.com", "@.yachtworld.com", "@.com", "@."

You left out the @ characters.

You did the same mistake in your table:

> INSERT INTO `mailaddr` VALUES (6, 7, '.aeroplan.com');
> INSERT INTO `mailaddr` VALUES (9, 7, 'aeroplan.com');

which should have been:

> INSERT INTO `mailaddr` VALUES (6, 7, '@.aeroplan.com');
> INSERT INTO `mailaddr` VALUES (9, 7, '@aeroplan.com');

From README.lookups:

| SQL LOOKUPS
...
|  - lookup for [EMAIL PROTECTED]
|  - lookup for [EMAIL PROTECTED] (only if $recipient_delimiter is '+')
|  - lookup for user+foo (only if domain part is local)
|  - lookup for user     (only local; only if $recipient_delimiter is '+')
|  - lookup for @example.com
|  - lookup for @.example.com
|  - lookup for @.com
|  - lookup for @.       (catchall)
| 
| NOTE:
|  this is different from hash and ACL lookups in two important aspects:
|    - key without '@' implies mailbox name, not domain name;

Mark


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
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