How to setup postfix to access to the database with procedures

Discussion in 'Server Operation' started by voltron81, Jan 14, 2010.

  1. voltron81

    voltron81 New Member

    Hi to everybody.

    I've realized a mailserver with postfix, using this how-to: http://www.howtoforge.com/virtual-users-domains-postfix-courier-mysql-squirrelmail-debian-lenny

    It's working fine, but for the final configuration I need to access to the mysql database via procedures...
    So I created the procedures like that:
    Code:
    DELIMITER $$
    
    DROP PROCEDURE IF EXISTS `get_virtualrelaydomains` $$
    CREATE DEFINER=`xxxxxx`@`%` PROCEDURE `get_virtualrelaydomains`(IN domain1 VARCHAR(45))
    BEGIN
    SELECT domain FROM mail_transport WHERE domain = domain1;
    END $$
    
    DELIMITER ;
    and the .cf files like this:
    Code:
    user = xxxxx
    password = xxxxxx
    dbname = xxxxxx
    query = CALL get_virtualrelaydomains('%s')
    hosts = 127.0.0.1
    
    but it's not working... it's giving me this kind of problems:
    Code:
     postfix/proxymap[9339]: warning: mysql query failed: PROCEDURE xxxx.get_virtualrelaydomains can't return a result set in the given context
    etc...

    Any idea how to setup postfix in this way?

    Thanks
    Michele
     

Share This Page