--- src/mysql_drv.c 2006-09-21 20:25:19.000000000 +0200 +++ src/mysql_drv.c.new 2007-09-21 22:12:17.092607928 +0200 @@ -2489,6 +2489,16 @@ goto FAILURE; } +#if MYSQL_VERSION_ID >= 50013 + /* enable automatic reconnect for MySQL >= 5.0.13 */ + snprintf(attrib, sizeof(attrib), "%sReconnect", prefix); + if (_ds_match_attribute(CTX->config->attributes, attrib, "true")) + { + my_bool reconnect = 1; + mysql_options(dbh, MYSQL_OPT_RECONNECT, &reconnect); + } +#endif + if (hostname[0] == '/') { if (!mysql_real_connect (dbh, NULL, user, password, db, 0, hostname, --- src/dspam.conf.in 2006-06-23 05:11:31.000000000 +0200 +++ src/dspam.conf.in.new 2007-11-18 19:25:05.250073750 +0100 @@ -305,6 +305,7 @@ #MySQLPass changeme #MySQLDb dspam #MySQLCompress true +#MySQLReconnect true # If you are using replication for clustering, you can also specify a separate # server to perform all writes to. @@ -315,6 +316,7 @@ #MySQLWritePass changeme #MySQLWriteDb dspam_write #MySQLCompress true +#MySQLReconnect true # If your replication isn't close to real-time, your retraining might fail if # the signature isn't found. One workaround for this is to use the write @@ -486,6 +488,7 @@ #MySQLPass.DECAlpha changeme #MySQLDb.DECAlpha dspam #MySQLCompress.DECAlpha true +#MySQLReconnect.DECAlpha true # #Profile Sun420R #MySQLServer.Sun420R 10.0.0.2 @@ -494,6 +497,7 @@ #MySQLPass.Sun420R changeme #MySQLDb.Sun420R dspam #MySQLCompress.Sun420R false +#MySQLReconnect.Sun420R true # #DefaultProfile DECAlpha --- doc/mysql_drv.txt 2006-05-13 03:12:58.000000000 +0200 +++ doc/mysql_drv.txt.new 2007-11-18 19:41:19.438956750 +0100 @@ -127,6 +127,11 @@ MySQLPass changeme MySQLDb dspam MySQLCompress true +MySQLReconnect true + +If you are using MySQL >= 5.0.13 and have problems with DSPAM dropping the +connection to your MySQL instance, then set MySQLReconnect to true to allow +the mysql_drv to try to re-establish stale and/or dead connections. Or if you'd like to connect via TCP, use the IP address and port of the MySQL server. DSPAM checks to see if the first character of the HOSTNAME field