Using postconf to manage master.cf

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Using postconf to manage master.cf

Robert Moskowitz
I am back to building a new mailserver.  I am using Centos7 which has
postfix 2.10.1

Back some 4 years ago there was a thread here to add support to postconf
to manage master.cf.  From

http://www.postfix.org/postconf.1.html

It seems that there are now options here for master.cf, but I cannot
find any guidance on using this.  My search foo is notoriously weak; my
searching this list has not found any discussion on this since 1/13.

I found one blog that uses 'postconf -P', but I see that the -P option
came out in postfix 2.11

Is there guidance to using postconf to manage master.cf?

thank you


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using postconf to manage master.cf

Postfix User-2
On Tue, 7 Mar 2017 23:54:36 -0500, Robert Moskowitz stated:

>I am back to building a new mailserver.  I am using Centos7 which has
>postfix 2.10.1
>
>Back some 4 years ago there was a thread here to add support to
>postconf to manage master.cf.  From
>
>http://www.postfix.org/postconf.1.html
>
>It seems that there are now options here for master.cf, but I cannot
>find any guidance on using this.  My search foo is notoriously weak;
>my searching this list has not found any discussion on this since 1/13.
>
>I found one blog that uses 'postconf -P', but I see that the -P option
>came out in postfix 2.11
>
>Is there guidance to using postconf to manage master.cf?
>
>thank you

According to the documentation located on
ftp://ftp.porcupine.org/mirrors/postfix-release/index.html
the 2.10.1 version is no longer supported. I know nothing about
Centos7; however, wouldn't it be possible to use a newer version of
Postfix, the latest being Postfix 3.2 I believe.

--
Jerry
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using postconf to manage master.cf

Robert Moskowitz


On 03/08/2017 05:57 AM, Postfix User wrote:

> On Tue, 7 Mar 2017 23:54:36 -0500, Robert Moskowitz stated:
>
>> I am back to building a new mailserver.  I am using Centos7 which has
>> postfix 2.10.1
>>
>> Back some 4 years ago there was a thread here to add support to
>> postconf to manage master.cf.  From
>>
>> http://www.postfix.org/postconf.1.html
>>
>> It seems that there are now options here for master.cf, but I cannot
>> find any guidance on using this.  My search foo is notoriously weak;
>> my searching this list has not found any discussion on this since 1/13.
>>
>> I found one blog that uses 'postconf -P', but I see that the -P option
>> came out in postfix 2.11
>>
>> Is there guidance to using postconf to manage master.cf?
>>
>> thank you
> According to the documentation located on
> ftp://ftp.porcupine.org/mirrors/postfix-release/index.html
> the 2.10.1 version is no longer supported. I know nothing about
> Centos7; however, wouldn't it be possible to use a newer version of
> Postfix, the latest being Postfix 3.2 I believe.

This is one of the 'joys' of working with Centos/Redhat.  You are always
'back-leveled'.  But then the work is on them to apply patches and keep
rpms 'safe'.  All I have to do, is update.  Thus the only real
justification is if there are functions/features really needed.  IMNSHO.

But this is not the point.  In fact, if there is no guidance on how to
use postconf for managing master.cf, it really does not matter which
version of postfix I use.  Just maintain master.cf as we always have.

There is a nice http://www.postfix.org/postconf.5.html write up on
maintaining main.cf, but not on master.cf.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using postconf to manage master.cf

Viktor Dukhovni

> On Mar 8, 2017, at 8:16 AM, Robert Moskowitz <[hidden email]> wrote:
>
> But this is not the point.  In fact, if there is no guidance on how to
> use postconf for managing master.cf, it really does not matter which
> version of postfix I use.  Just maintain master.cf as we always have.

All the postconf(1) command options are documented.  Just type:

        man postconf

to see what command options your version supports.  You can also
look at:

        http://www.postfix.org/postconf.1.html

which documents the latest version, and does its best to list
the first release in which various features appeared.  To see
the document for older releases, say 2.10, you can leverage github:

        http://htmlpreview.github.io/?https://github.com/vdukhovni/postfix/blob/postfix-2.10/postfix/html/postconf.1.html

> There is a nice http://www.postfix.org/postconf.5.html write up on maintaining main.cf, but not on master.cf.

The documentation in postconf(1) should be sufficient.  For 2.10 you have:

        Managing master.cf:

        postconf [-fMovx] [-c config_dir] [service ...]

        ...

       -f     Fold  long lines when printing main.cf or master.cf
              configuration file entries, for human  readability.

              This  feature  is  available  with  Postfix 2.9 and
              later.

       -M     Show  master.cf  file  contents  instead of main.cf

              file contents.  Specify -Mf  to fold long lines  for
              human readability.

              If service ...  is specified, only the matching ser-
              vices will be output. For  example,  "postconf  -Mf
              inet"  will  output all services that listen on the
              network.

              Specify zero or more arguments, each  with  a  ser-
              vice-type  name (inet, unix, fifo, or pass) or with
              a service-name.service-type  pair,  where  service-
              name is the first field of a master.cf  entry.

              This  feature  is  available  with  Postfix 2.9 and
              later.

       -o name=value
              Override main.cf parameter settings.

              This  feature  is  available  with Postfix 2.10 and
              later.      

       -v     Enable verbose logging for debugging purposes. Mul-
              tiple -v options  make  the software increasingly
              verbose.

       -x     Expand $name in main.cf or master.cf parameter val-
              ues. The expansion is recursive.

              This  feature  is  available  with Postfix 2.10 and
              later.

So, in Postfix 2.10, you can display [selected] master.cf entries
or update overrides (-o parameters) for a given service.

The master.cf modification features are much more extensive in
later releases.

--
        Viktor.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using postconf to manage master.cf

Wietse Venema
In reply to this post by Robert Moskowitz
Robert Moskowitz:
> But this is not the point.  In fact, if there is no guidance on how to
> use postconf for managing master.cf, it really does not matter which
> version of postfix I use.  Just maintain master.cf as we always have.
>
> There is a nice http://www.postfix.org/postconf.5.html write up on
> maintaining main.cf, but not on master.cf.

There is (obviously) no such guidance with Postfix releases that
pre-date the support to edit master.cf. Only Postfix versions that
support master.cf editing document these features (in the postconf(1)
manpage).

In short, you can list master.cf as a sequence of name=value pairs,
and you can specify name=value pairs to change master.cf.

These features were added to facilitate automated configuration
management (Puppet, Chef, etc.). When every setting looks like a
name=value pair, it can be managed by programs that don't need to
understand Postfix configuration syntax.

It's probably overkill for a small site, but it's one of the attempts
to bring Postfix into the 21st century (along with JSON queue listings).

        Wietse
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using postconf to manage master.cf

Robert Moskowitz
In reply to this post by Viktor Dukhovni
Viktor,

thanks for your reply.  More below.

On 03/08/2017 10:34 AM, Viktor Dukhovni wrote:

>> On Mar 8, 2017, at 8:16 AM, Robert Moskowitz <[hidden email]> wrote:
>>
>> But this is not the point.  In fact, if there is no guidance on how to
>> use postconf for managing master.cf, it really does not matter which
>> version of postfix I use.  Just maintain master.cf as we always have.
> All the postconf(1) command options are documented.  Just type:
>
> man postconf
>
> to see what command options your version supports.  You can also
> look at:
>
> http://www.postfix.org/postconf.1.html

And that is what I did.  I saw what the options were, but no practical
examples of them in use.  That is what I meant by 'guidance'.  The
Postfix online manual has a lot of guidance on how to actually do things
to Postfix to get it to do many valuable things.

> which documents the latest version, and does its best to list
> the first release in which various features appeared.  To see
> the document for older releases, say 2.10, you can leverage github:
>
> http://htmlpreview.github.io/?https://github.com/vdukhovni/postfix/blob/postfix-2.10/postfix/html/postconf.1.html
>
>> There is a nice http://www.postfix.org/postconf.5.html write up on maintaining main.cf, but not on master.cf.
> The documentation in postconf(1) should be sufficient.  For 2.10 you have:
>
> Managing master.cf:
>
> postconf [-fMovx] [-c config_dir] [service ...]
>
> ...
>
>         -f     Fold  long lines when printing main.cf or master.cf
>                configuration file entries, for human  readability.
>
>                This  feature  is  available  with  Postfix 2.9 and
>                later.
>
>         -M     Show  master.cf  file  contents  instead of main.cf
>
>                file contents.  Specify -Mf  to fold long lines  for
>                human readability.
>
>                If service ...  is specified, only the matching ser-
>                vices will be output. For  example,  "postconf  -Mf
>                inet"  will  output all services that listen on the
>                network.
>
>                Specify zero or more arguments, each  with  a  ser-
>                vice-type  name (inet, unix, fifo, or pass) or with
>                a service-name.service-type  pair,  where  service-
>                name is the first field of a master.cf  entry.
>
>                This  feature  is  available  with  Postfix 2.9 and
>                later.
>
>         -o name=value
>                Override main.cf parameter settings.
>
>                This  feature  is  available  with Postfix 2.10 and
>                later.
>
>         -v     Enable verbose logging for debugging purposes. Mul-
>                tiple -v options  make  the software increasingly
>                verbose.
>
>         -x     Expand $name in main.cf or master.cf parameter val-
>                ues. The expansion is recursive.
>
>                This  feature  is  available  with Postfix 2.10 and
>                later.
>
> So, in Postfix 2.10, you can display [selected] master.cf entries
> or update overrides (-o parameters) for a given service.

But -o does not actually update master.cf.  That seems to be what -P
does in Postfix 2.11.

> The master.cf modification features are much more extensive in
> later releases.

And that is what I was looking for.  I would have thought that somewhere
there would be use examples of say, adding submission support into
master.cf using postconf.  I actually did find one such blog:

https://www.mind-it.info/2014/02/20/change-postfix-master-cf-postconf/

But the blogger does not state what version he used.  Obviously it was
at least 2.11.

Again thank you.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using postconf to manage master.cf

Robert Moskowitz
In reply to this post by Wietse Venema
Wietse,

thank you for your response.

On 03/08/2017 10:44 AM, Wietse Venema wrote:

> Robert Moskowitz:
>> But this is not the point.  In fact, if there is no guidance on how to
>> use postconf for managing master.cf, it really does not matter which
>> version of postfix I use.  Just maintain master.cf as we always have.
>>
>> There is a nice http://www.postfix.org/postconf.5.html write up on
>> maintaining main.cf, but not on master.cf.
> There is (obviously) no such guidance with Postfix releases that
> pre-date the support to edit master.cf. Only Postfix versions that
> support master.cf editing document these features (in the postconf(1)
> manpage).
>
> In short, you can list master.cf as a sequence of name=value pairs,
> and you can specify name=value pairs to change master.cf.

When I look at man postconf, -o only updates main.cf.  -M is only for
reporting what is in master.cf.

> These features were added to facilitate automated configuration
> management (Puppet, Chef, etc.). When every setting looks like a
> name=value pair, it can be managed by programs that don't need to
> understand Postfix configuration syntax.
>
> It's probably overkill for a small site, but it's one of the attempts
> to bring Postfix into the 21st century (along with JSON queue listings).

And so I stay with the old way of using 'cat >> master.cf' and sed to
update.  That still works and is 'good enough' for my goals. Just wanted
to stay current with what is available in the release provided by the
Centos/Redhat maintainers.

Again, thank you for responding and thank you for this great product.

BTW, I am working in the IETF I2NSF workgroup where we are defining
architecture and protocols to maintain Network Security Functions. Some
of those will end up in remotely managed updates to Postfix. So on that
level, I get what you are doing.

take care.

Loading...