migrate from postfix to qmail
Heiko Wundram (Beenic)
wundram at beenic.net
Sat Sep 22 10:18:59 PDT 2007
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
More information about the freebsd-questions
mailing list