Arduino

Gentoo

Heater Controller

Linux

Saab

Wordpress

Squid: WARNING! Your cache is running out of filedescriptors | Fast way to create or assemble mdadm devices

Postfix, MySQL lookups and Temporary lookup failure

Linux Add comments

Feb 082010

After setting up postfix to use mysql as lookup backend for alias or virtual or whatever table, everything seems ok. Mails are delivered.
But sometimes strange “Postfix SMTP server: errors from ” e-mails are received. Usually more than one in the same second, then there can be no errors for days or weeks. Then they appear again. There is a “Temporary lookup failure” or “queue file write error” cited in those error e-mails but everything seems to work ok again. Even those e-mails that get error on first try get delivered on second try some minutes later.

One thing to look out for is
“warning: mysql query failed: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation ‘=’”
or something similar in mail logs.

If something like that is also present, then the problem is, that some messages use non US-ASCII characters in FROM or TO fields and postfix works under different locale than what is stored in mysql tables. In this case, postfix works under utf8 and mysql tables were latin1.

To see, what mysql uses, log on to mysql console and use
SHOW CREATE TABLE tbl_name;
for the tables that are used in proxy:mysql: lookups.

If these tables are indeed in one of those character set, converting them to the other might help.
As ALTER TABLE tbl_name CONVERT TO CHARACTER SET charset_name; changes also data types, if necessary, it might be wise to use
ALTER TABLE tbl_name CHARACTER SET charset_name;
for example:
alter table alias_domain character set utf8 collate utf8_general_ci;
Then also individual text fields must be converted like so:
alter table vacation modify email varchar(255) character set utf8;

There should be no more errors like that ever again.
And to why postfix gives usually a lot of error messages at once – if postfix gets one error, it remembers it for some time. In this situation, at least cache time is not measured in hours

Posted by owl on February 8, 2010 at 1:04 am

One Response to “Postfix, MySQL lookups and Temporary lookup failure”

Lari Temmes says:

January 28, 2011 at 3:10 pm

You should also check that MySQL in configured to handle enough connections. Same error will appear (queue error or resolve error).

Reply

Leave a Reply Cancel reply

Name (required)

E-mail (required)

URI

Your Comment

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Linux

Amavisd-new – release items from MySQL quarantine

Data Copy Over SSH

Fast way to create or assemble mdadm devices

Gentoo webapp-config

Installing grub on md raid boot device

KDE autologin

LDAP from command line

Multiple internet connections in one box

Rebuilding failed drive in linux md raid

RPM – uninstall packages listed more than once

Spamassassin and clean SQL database

Sphinx CentOS rpm-s

Squid: WARNING! Your cache is running out of filedescriptors

SSH Keepalive

SSH Port Forwarding

Archives

August 2011

January 2011

November 2010

October 2010

March 2010

February 2010

June 2009

April 2009

February 2009

December 2008

September 2008

July 2008

Recent Comments

owl on Migrating from Drupal 6.2.x to WordPress 3.2.x

Jordi Cabot on Migrating from Drupal 6.2.x to WordPress 3.2.x

Anonymous on Arduino and DS18B20 – 1-wire digital thermometer

Lari Temmes on Postfix, MySQL lookups and Temporary lookup failure

Anonymouswebcontrolguy on Arduino and DS18B20 – 1-wire digital thermometer

Translate this Page

Kontakt

Meta

Log in

Entries RSS

Comments RSS

© 2011 Ogalik OÜ | [email-masked] | Suffusion theme by Sayontan Sinha