Loading ...
Sorry, an error occurred while loading the content.

Does an option "include" exist?

Expand Messages
  • Christian Rößner
    Hi, I have a trivial question: I have several smtpd blocks in my master.cf. Most of the time with similar options, but maybe just single options change. Is
    Message 1 of 6 , Nov 1, 2012
    • 0 Attachment
      Hi,

      I have a trivial question: I have several smtpd blocks in my master.cf. Most of the time with similar options, but maybe just single options change. Is there some "include" option that I could cut these options and paste them in a separate file and include it where needed?

      Just a sample with explanation from my server:

      # SOGo
      88.198.80.230:10025
      inet n - - - - smtpd
      -o milter_macro_daemon_name=ORIGINATING
      -o mynetworks=88.198.80.229/32
      -o smtpd_banner=${smtpd_submission_banner}
      -o myhostname=mail.roessner-net.de
      -o always_add_missing_headers=yes
      -o smtpd_recipient_restrictions=permit_mynetworks,reject
      -o smtpd_reject_footer=

      [2A01:4F8:131:1081:88:198:80:230]:10025
      inet n - - - - smtpd
      -o milter_macro_daemon_name=ORIGINATING
      -o mynetworks=[2a01:4f8:131:1081:88:198:80:229]/128
      -o smtpd_banner=${smtpd_submission_banner}
      -o myhostname=mail.roessner-net.de
      -o always_add_missing_headers=yes
      -o smtpd_recipient_restrictions=permit_mynetworks,reject
      -o smtpd_reject_footer=



      Both blocks are identical, just ipv4 and ipv6.



      # Default
      88.198.80.230:submission
      inet n - - - - smtpd
      -o milter_macro_daemon_name=ORIGINATING
      -o smtpd_banner=${smtpd_submission_banner}
      -o myhostname=mail.roessner-net.de
      -o smtpd_sasl_auth_enable=yes
      -o smtpd_tls_cert_file=/etc/ssl/certs/mail.roessner-net.de.pem
      -o smtpd_tls_key_file=/etc/ssl/private/mail.roessner-net.de.key.pem
      -o smtpd_tls_CAfile=/etc/ssl/certs/SSL123_CA_Bundle.pem
      -o smtpd_tls_security_level=encrypt
      -o always_add_missing_headers=yes
      -o smtpd_recipient_restrictions=${authenticated_smtpd_recipient_restrictions}
      -o smtpd_reject_footer=

      88.198.80.230:smtps
      inet n - - - - smtpd
      -o milter_macro_daemon_name=ORIGINATING
      -o myhostname=mail.roessner-net.de
      -o smtpd_sasl_auth_enable=yes
      -o smtpd_tls_cert_file=/etc/ssl/certs/mail.roessner-net.de.pem
      -o smtpd_tls_key_file=/etc/ssl/private/mail.roessner-net.de.key.pem
      -o smtpd_tls_CAfile=/etc/ssl/certs/SSL123_CA_Bundle.pem
      -o smtpd_tls_wrappermode=yes
      -o smtpd_tls_security_level=encrypt
      -o always_add_missing_headers=yes
      -o smtpd_recipient_restrictions=${authenticated_smtpd_recipient_restrictions}
      -o smtpd_reject_footer=

      [2A01:4F8:131:1081:88:198:80:230]:submission
      inet n - - - - smtpd
      -o milter_macro_daemon_name=ORIGINATING
      -o smtpd_banner=${smtpd_submission_banner}
      -o myhostname=mail.roessner-net.de
      -o smtpd_sasl_auth_enable=yes
      -o smtpd_tls_cert_file=/etc/ssl/certs/mail.roessner-net.de.pem
      -o smtpd_tls_key_file=/etc/ssl/private/mail.roessner-net.de.key.pem
      -o smtpd_tls_CAfile=/etc/ssl/certs/SSL123_CA_Bundle.pem
      -o smtpd_tls_security_level=encrypt
      -o always_add_missing_headers=yes
      -o smtpd_recipient_restrictions=${authenticated_smtpd_recipient_restrictions}
      -o smtpd_reject_footer=

      [2A01:4F8:131:1081:88:198:80:230]:smtps
      inet n - - - - smtpd
      -o milter_macro_daemon_name=ORIGINATING
      -o myhostname=mail.roessner-net.de
      -o smtpd_sasl_auth_enable=yes
      -o smtpd_tls_cert_file=/etc/ssl/certs/mail.roessner-net.de.pem
      -o smtpd_tls_key_file=/etc/ssl/private/mail.roessner-net.de.key.pem
      -o smtpd_tls_CAfile=/etc/ssl/certs/SSL123_CA_Bundle.pem
      -o smtpd_tls_wrappermode=yes
      -o smtpd_tls_security_level=encrypt
      -o always_add_missing_headers=yes
      -o smtpd_recipient_restrictions=${authenticated_smtpd_recipient_restrictions}
      -o smtpd_reject_footer=


      smtps and subission. ipv4 and ipv6. It would be nice to have something like:

      submission.cf:
      ---------------------------------------------------------
      myhostname=mail.roessner-net.de
      smtpd_sasl_auth_enable=yes
      smtpd_tls_cert_file=/etc/ssl/certs/mail.roessner-net.de.pem
      smtpd_tls_key_file=/etc/ssl/private/mail.roessner-net.de.key.pem
      smtpd_tls_CAfile=/etc/ssl/certs/SSL123_CA_Bundle.pem
      smtpd_tls_wrappermode=yes
      smtpd_tls_security_level=encrypt
      always_add_missing_headers=yes
      smtpd_recipient_restrictions=${authenticated_smtpd_recipient_restrictions}
      smtpd_reject_footer=
      ---------------------------------------------------------

      And then saying for example:

      ---------------------------------------------------------
      [2A01:4F8:131:1081:88:198:80:230]:smtps
      inet n - - - - smtpd
      -o milter_macro_daemon_name=ORIGINATING
      -o include_config=${config_directory}/submission.cf
      ---------------------------------------------------------

      Does such on option exist or some similar mechanism? I hope that question is not too silly.

      Thanks in advance

      Kind regards

      -Christian Rößner

      --
      [*] sys4 AG

      http://sys4.de, +49 (89) 30 90 46 64
      Franziskanerstraße 15, 81669 München

      Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
      Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer
      Aufsichtsratsvorsitzender: Joerg Heidrich
    • /dev/rob0
      ... Since it is not documented in master(5), it s safe to assume it does not exist. I doubt Wietse is interested in implementing such a feature, but he can of
      Message 2 of 6 , Nov 1, 2012
      • 0 Attachment
        On Thu, Nov 01, 2012 at 04:46:21PM +0100, Christian Rößner wrote:
        > I have a trivial question: I have several smtpd blocks in my
        > master.cf. Most of the time with similar options, but maybe just
        > single options change. Is there some "include" option that I could
        > cut these options and paste them in a separate file and include it
        > where needed?

        Since it is not documented in master(5), it's safe to assume it does
        not exist. I doubt Wietse is interested in implementing such a
        feature, but he can of course answer for himself.

        A workaround which can accomplish the same thing is to create a
        Makefile and use make(1).
        --
        http://rob0.nodns4.us/ -- system administration and consulting
        Offlist GMX mail is seen only if "/dev/rob0" is in the Subject:
      • Christian Rößner
        Hi, ... I wasn t sure if my idea was good or bad. I simply thought about reducing redundancy and therefor lowering the risk of doing mistakes, if changes in
        Message 3 of 6 , Nov 1, 2012
        • 0 Attachment
          Hi,

          >> I have a trivial question: I have several smtpd blocks in my
          >> master.cf. Most of the time with similar options, but maybe just
          >> single options change. Is there some "include" option that I could
          >> cut these options and paste them in a separate file and include it
          >> where needed?
          >
          > Since it is not documented in master(5), it's safe to assume it does
          > not exist. I doubt Wietse is interested in implementing such a
          > feature, but he can of course answer for himself.

          I wasn't sure if "my" idea was good or bad. I simply thought about reducing redundancy and therefor lowering the risk of doing mistakes, if changes in config are required.

          > A workaround which can accomplish the same thing is to create a
          > Makefile and use make(1).

          Yes, that seems a good idea for now. So this would lead in something like a template system, where "make" builds the final master.cf.

          Thanks

          -Christian Rößner

          --
          [*] sys4 AG

          http://sys4.de, +49 (89) 30 90 46 64
          Franziskanerstraße 15, 81669 München

          Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
          Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer
          Aufsichtsratsvorsitzender: Joerg Heidrich
        • /dev/rob0
          ... I m not saying it is a bad idea. It might even be something for Wietse to consider if/when work begins on a non-compatible Postfix 3.0 . I think it
          Message 4 of 6 , Nov 2, 2012
          • 0 Attachment
            On Thu, Nov 01, 2012 at 05:56:46PM +0100, Christian Rößner wrote:
            > rob0:
            > >Christian:
            > >> I have a trivial question: I have several smtpd blocks in my
            > >> master.cf. Most of the time with similar options, but maybe just
            > >> single options change. Is there some "include" option that I
            > >> could cut these options and paste them in a separate file and
            > >> include it where needed?
            > >
            > > Since it is not documented in master(5), it's safe to assume it
            > > it does not exist. I doubt Wietse is interested in implementing
            > > such a feature, but he can of course answer for himself.
            >
            > I wasn't sure if "my" idea was good or bad. I simply thought
            > about reducing redundancy and therefor lowering the risk of
            > doing mistakes, if changes in config are required.

            I'm not saying it is a "bad" idea. It might even be something for
            Wietse to consider if/when work begins on a non-compatible Postfix
            "3.0". I think it would be difficult to ensure downgradability with
            such a feature.

            > > A workaround which can accomplish the same thing is to create
            > > a Makefile and use make(1).
            >
            > Yes, that seems a good idea for now. So this would lead in
            > something like a template system, where "make" builds the
            > final master.cf.

            And this fits in with the general Unix philosophy of small tools
            which do one job well and can work together to do big jobs. It's
            upgrade- and downgrade-resistant, also.
            --
            http://rob0.nodns4.us/ -- system administration and consulting
            Offlist GMX mail is seen only if "/dev/rob0" is in the Subject:
          • Ralf Hildebrandt
            ... I sure is a way of making the config LESS redundant and thus making thing either work every- or nowhere. ... Pne could argue that the same thing could
            Message 5 of 6 , Nov 2, 2012
            • 0 Attachment
              * /dev/rob0 <postfix-users@...>:

              > I'm not saying it is a "bad" idea. It might even be something for
              > Wietse to consider if/when work begins on a non-compatible Postfix
              > "3.0". I think it would be difficult to ensure downgradability with
              > such a feature.

              I sure is a way of making the config LESS redundant and thus making
              thing either work every- or nowhere.

              > And this fits in with the general Unix philosophy of small tools
              > which do one job well and can work together to do big jobs. It's
              > upgrade- and downgrade-resistant, also.

              Pne could argue that the same thing could somehow be done by using m4.

              --
              [*] sys4 AG

              http://sys4.de, +49 (89) 30 90 46 64
              Franziskanerstraße 15, 81669 München

              Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
              Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer
              Aufsichtsratsvorsitzender: Joerg Heidrich
            • Wietse Venema
              ... And include totally screws up the possibility to mechanically updating (adding/replacing) entries. Don t make the mistake to think that these files are
              Message 6 of 6 , Nov 2, 2012
              • 0 Attachment
                Ralf Hildebrandt:
                > * /dev/rob0 <postfix-users@...>:
                >
                > > I'm not saying it is a "bad" idea. It might even be something for
                > > Wietse to consider if/when work begins on a non-compatible Postfix
                > > "3.0". I think it would be difficult to ensure downgradability with
                > > such a feature.
                >
                > I sure is a way of making the config LESS redundant and thus making
                > thing either work every- or nowhere.

                And "include" totally screws up the possibility to mechanically
                updating (adding/replacing) entries.

                Don't make the mistake to think that these files are meant to be
                maintained by hand.

                Wietse
              Your message has been successfully submitted and would be delivered to recipients shortly.