[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

postfix-gld: configuring mariadb



I just try to install postfix-gld on Debian stable. When creating the
tables in mariadb as described in README.Debian at the point where
/usr/share/gld/tables.mysql is sourced I get the following error:

ERROR 1071 (42000): Specified key was too long; max key length is 1000
byte

The problem is the creation of the greylist
CREATE TABLE greylist (
  ip char(45) NOT NULL default '',
  sender char(242) NOT NULL default '',
  recipient char(242) NOT NULL default '',
  first int(11) NOT NULL default '0',
  last int(11) NOT NULL default '0',
  n int(11) NOT NULL default '0',
  PRIMARY KEY  (ip,sender,recipient)
) ENGINE=MyISAM COMMENT='greylist';

First i wondered that 45+242+242=529 is less than 1000.

When trying to start gld, gld does not start and gives no error message.
Meanwhile I found out that the default charset is utf8mb4 with a maximum
size of 4 bytes and of course 4*529>1000.

I tried using an other charset with
CREATE TABLE greylist (
  ip char(45) NOT NULL default '',
  sender char(242) NOT NULL default '',
  recipient char(242) NOT NULL default '',
  first int(11) NOT NULL default '0',
  last int(11) NOT NULL default '0',
  n int(11) NOT NULL default '0',
  PRIMARY KEY  (ip,sender,recipient)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='greylist';

This works fine and gld starts.

Do you think this is a good idea to mix tables with different charsets,
or should I use the same charset for all tables? Do you want to add
charset information to tables.mysql or the README.Debian?

-- 
\ J. Dollinger Uni Ulm | zeitnot@irc | http://www.home.pages.de/~zeitnot/
 \    "What're quantum mechanics?"   --   "I don't know. People who    /
  \    repair quantums, I suppose."         (Terry Pratchett, Eric)   /


Reply to: