This note discusses some user-interface issues with upcoming
postconf(1) features that will be used to manage the content of
master.cf files.

User-interface consistency is important, especially for people who
work a lot with Postfix: fewer things to remember means fewer
mistakes to make (it's also important for implementors, because it
leads to similar code for similar operations and opportunities to
use code that already exists, meaning fewer mistakes to make).

In particular, it would be desirable that postconf(1) uses similar
command syntax for similar operations on main.cf and master.cf.

First I will review a few commands that already exist, and then
I'll introduce some commands that are likely to be implemented.

The first two examples are already implemented:

    postconf -M inet
        Show all TCP services in master.cf

    postconf -M inet.submission
        Show the submission-over-TCP service in master.cf

Next, a few examples that are likely to be implemented:

    postconf -M# service-type ...
    postconf -M# service-type.service-name ...

    postconf -MX service-type ...
    postconf -MX service-type.service-name ...

        Delete (or comment) out the specified services.

These commands are analogous to "postconf -# parameter(s)" (comment
out main.cf parameter settings) and "postconf -X parameter(s)"
(remove main.cf parameter settings). Therefore they should have
similar syntax. I don't expect that these commands will be used
much, but they will make the postconf command more consistent.

I am contemplating a new class of master.cf operations that operate  
column-wise.  These currently have no main.cf equivalent.

    postconf -Mu chroot=n inet unix fifo pass

        Update the "chroot" column to "n" for all services.

    postconf -Mu type=unix fifo

        Update all "fifo" services so that they use UNIX-domain 
        sockets. This is more laptop-friendly as it avoids MTIME
        updates.

Obviously, this command is powerful but it can also inflict a great
deal of damage.

And finally, a more complicated example:

    postconf -Me 'text of complete master.cf entry'

        Replace the specified master.cf service or add a new service.
        Each postconf(1) command-line argument contains the text
        of a complete master.cf entry. The new entry is line-wrapped
        as with "postconf -Mf".

This command syntax is consistent with existing "postconf -e"
commands, where each postconf(1) command-line argument contains the
text of a complete main.cf entry.

However, the syntax differs from "postconf -M" commands that can
target multiple services, such as "postconf -M inet" or "postconf
-Mu chroot=n inet".  There, a service is better specified as
service-type or service-type.service-name.

Considering the difference between specifying the complete content
of a master.cf entry versus a patterm that can select multiple
master.cf entries, it makes sense to have this difference in command
syntax.

        Wietse

Reply via email to