From owner-freebsd-questions@FreeBSD.ORG Mon Nov 22 23:59:18 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ED7EC16A4CE; Mon, 22 Nov 2004 23:59:18 +0000 (GMT) Received: from mxfep02.bredband.com (mxfep02.bredband.com [195.54.107.73]) by mx1.FreeBSD.org (Postfix) with ESMTP id A99B543D2D; Mon, 22 Nov 2004 23:59:17 +0000 (GMT) (envelope-from peter.schuller@infidyne.com) Received: from scode-whitestar.mine.nu ([83.226.138.136] [83.226.138.136]) by mxfep02.bredband.com with ESMTP <20041122235916.NJFS6427.mxfep02.bredband.com@scode-whitestar.mine.nu>; Tue, 23 Nov 2004 00:59:16 +0100 Received: from localhost (localhost [127.0.0.1]) by scode-whitestar.mine.nu (Postfix) with ESMTP id 082E117B878; Tue, 23 Nov 2004 01:00:31 +0100 (CET) From: Peter Schuller To: freebsd-questions@freebsd.org Date: Tue, 23 Nov 2004 01:00:28 +0100 User-Agent: KMail/1.7 References: <41A24148.1000400@schmittnet.com> <41A2840D.9020104@confabulator.net> <41A277A1.5080001@schmittnet.com> In-Reply-To: <41A277A1.5080001@schmittnet.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200411230100.30160.peter.schuller@infidyne.com> cc: questions@freebsd.org cc: "Ryan J. Cavicchioni" cc: "Bill Schmitt \(SW\)" Subject: Re: Setting up Postfix with PosgreSQLon FreeBSD X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Nov 2004 23:59:19 -0000 Hello, > Thanks for responding, Ryan, but I'm confused. I have managed to start > postgres with a user I called pgsql. The install appears to do that with > a user called postgres but doesn't reference postfix. How do I tell > postfix that I want to use postgres? Basically in main.cf you must specify postgresql databases rather than the default ones. For example, on one machine where I use Postfix+PostgreSQL, I have (among other things): alias_maps = pgsql:/usr/local/etc/postfix/pgsql-localaliases.cf virtual_alias_maps = pgsql:/usr/local/etc/postfix/pgsql-aliases.cf virtual_mailbox_maps = pgsql:/usr/local/etc/postfix/pgsql-mailboxes.cf Each of the files referenced contains the information postfix needs in order to query the postgresql database. For example, pgsql-localaliases.cf contains: hosts = localhost user = mail password = YOUR_DB_PASSWORD_HERE dbname = YOUR_PG_DB_NAME_HERE table = bla query = SELECT local_alias.target FROM local_alias WHERE \ local_alias.address ILIKE '%s'; (linebreak added for readability) The 'table' option is not needed, but IIRC when testing it would bail if the keyword itself was missing, even though it was never used since I opted for the 'query' option instead (hence "bla"). Instead of specifying the query like that, one can specify individual parts using table/where statements. I found it easier to just specify the whole query so that I know what's going on. I haven't been following this thread so I don't know how much you already know or whether this helps. If this doesn't clear things up let me know and I can provide some URLs that are suitable for reading on this issue, and/or more details. At the moment I'm in a bit of a hurry. -- / Peter Schuller, InfiDyne Technologies HB PGP userID: 0xE9758B7D or 'Peter Schuller ' Key retrieval: Send an E-Mail to getpgpkey@scode.org E-Mail: peter.schuller@infidyne.com Web: http://www.scode.org