Am 11.01.2010 13:25 schrieb Stefan Priebe: > I would like to do the auth and rcpt_ok via MySQL. Is there a good way > to share the DB Connection? Or do i have to connect to MySQL for each > query? If there is a way - where to store the dbh Handle - so that all > childs can use it? > Hi Stefan,
you should keep the DB connection for a single SMTP request only - I had to learn this myself: See the discussion on http://www.nntp.perl.org/group/perl.qpsmtpd/2007/08/msg7144.html And please have a look at my db/suite - where the DBI connection is stored in $qp->connection->notes() On http://dienstleistung-kultur.de/qpsmtpd/db_common.shtml#inheritance you'll find a skeleton for an own plugin inheriting from db/common, which provides all the database handling stuff. Just say in /etc/qpsmtpd/plugins db/base db/your_plugin and in db/your_plugin you can easily access your database defined in /etc/qpsmtpd/db_base via the methods provided by db/common. db/suite runs on our server in production on QPSMTPD forkserver 0.32 in combination with Exim 4.63, MySQL 5.0.32 and Dovecot 1.0rc15 on Debian Etch - never change a running system ;-) Please see http://dienstleistung-kultur.de/qpsmtpd/ Sincerely, Ernesto -- ______________________________________________________________________ Dienstleistung Kultur Ltd. & Co. KG Lützenstr. 10, 10711 Berlin Telephon +49-(0)30 - 89 09 56 59 Prokurist Ernst-J. Johnsdorf Faksimile +49-(0)30 - 89 09 56 60 HRA 41207 Berlin-Charlottenburg http://dienstleistung-kultur.de USt-IdNr. DE 261 999 858 mailto:m...@dienstleistung-kultur.de ______________________________________________________________________ Dienstleistung Kultur Ltd. 27, Gloucester Street, London WC1N 3AX Companies House, Cardiff, No. 6512436 Director Ute-I. Pehlke ______________________________________________________________________