Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Sep 2007 19:18:53 +0200
From:      "Heiko Wundram (Beenic)" <wundram@beenic.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: migrate from postfix to qmail
Message-ID:  <200709221918.53961.wundram@beenic.net>
In-Reply-To: <fd36g7$2bo0$5@nermal.rz1.convenimus.net>
References:  <48ce8d530709211747s615bc16by5766441066f19237@mail.gmail.com> <7CDF3AD1-DE13-46F6-A84F-B26FA3F97032@dragffy.com> <fd36g7$2bo0$5@nermal.rz1.convenimus.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Am Samstag 22 September 2007 15:48:55 schrieb Christian Baer:
> <snip>
> 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:

<varname> = <value>

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 $<itemname> (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 <whitespace>+ VALUE <newline>

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200709221918.53961.wundram>