From owner-freebsd-questions@FreeBSD.ORG Sat Sep 22 17:18:59 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86A2D16A41A for ; Sat, 22 Sep 2007 17:18:59 +0000 (UTC) (envelope-from wundram@beenic.net) Received: from mail.beenic.net (mail.beenic.net [83.246.72.40]) by mx1.freebsd.org (Postfix) with ESMTP id 47DFB13C469 for ; Sat, 22 Sep 2007 17:18:58 +0000 (UTC) (envelope-from wundram@beenic.net) Received: from phoenix (hnvr-4db2ee64.pool.einsundeins.de [77.178.238.100]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.beenic.net (Postfix) with ESMTP id EA48BA44529 for ; Sat, 22 Sep 2007 19:14:52 +0200 (CEST) From: "Heiko Wundram (Beenic)" Organization: Beenic Networks GmbH To: freebsd-questions@freebsd.org Date: Sat, 22 Sep 2007 19:18:53 +0200 User-Agent: KMail/1.9.7 References: <48ce8d530709211747s615bc16by5766441066f19237@mail.gmail.com> <7CDF3AD1-DE13-46F6-A84F-B26FA3F97032@dragffy.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200709221918.53961.wundram@beenic.net> Subject: Re: migrate from postfix to qmail X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2007 17:18:59 -0000 Am Samstag 22 September 2007 15:48:55 schrieb Christian Baer: > > The qmail-configuration can be read an evaluated *without* a parcer. Sorry, but that's BS (IMHO). Any program interpreting some form of input is called a parser, and the only distinction is the algorithm you need, i.e. whether you need a "full-blown" stack-machine to interpret the input (think of recursive declarations), or not. The Postfix configuration (/usr/local/etc/postfix/main.cf) simply consists of directives of the form: = where the value can have continuations by indenting the following line with whitespace, but that's about the only thing that's different to the INI-format (besides not having the concept of "sections" in a Postfix config file). Thus, the Postfix configuration should easily be parseable by about 20-30 lines of C code (with error checking), if you're not willing to use (f)lex to implement the simplistic parser for you. The only thing that makes life a little harder is the ability to reference other items in main.cf by using $ (which are basically pure string replacements); these have to be implemented in a semantic phase anyway, which doesn't have anything to do with the parser itself. Last, but not least, Postfix implements most of the actual "logic" of delivery (including virtual delivery) in so-called maps, which come as KEY + VALUE files. I wouldn't know how much easier parsing could get for any form of control panel (if it doesn't use Postfix's ability to store a map in a RDBMS anyway). -- Heiko Wundram Product & Application Development