• [gentoo-user] Postfix config and update

    From Wols Lists@21:1/5 to All on Sun Nov 27 11:40:01 2022
    I've just had emerge telling me it wants to trash my postfix config :-)

    I'm not sure whether my setup is actually using it, I use dovecot to
    deliver my mail, but is there any way I can stop random updates trying
    to trash my local changes? I'm rubbish at merging updates, and last time
    I tried I think the result was a complete mess.

    And I said I use dovecot to deliver mail - that takes a leaf out of the
    systemd book and has a master config file pointing to a local config
    file. Any updates to dovecot don't touch the local file, and don't touch
    my local settings.

    Can I do anything similar for postfix?

    Cheers,
    Wol

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John Blinka@21:1/5 to antlists@youngman.org.uk on Sun Nov 27 14:30:01 2022
    On Sun, Nov 27, 2022 at 5:36 AM Wols Lists <antlists@youngman.org.uk> wrote:

    I've just had emerge telling me it wants to trash my postfix config :-)

    I'm not sure whether my setup is actually using it, I use dovecot to
    deliver my mail, but is there any way I can stop random updates trying
    to trash my local changes? I'm rubbish at merging updates, and last time
    I tried I think the result was a complete mess.

    And I said I use dovecot to deliver mail - that takes a leaf out of the systemd book and has a master config file pointing to a local config
    file. Any updates to dovecot don't touch the local file, and don't touch
    my local settings.

    Can I do anything similar for postfix?

    Cheers,
    Wol

    I’m not a systemd user, so I don’t know precisely what systemd does. But
    my /etc/postfix/main.cf is a soft link to “main.cf.works”, which was an unoriginal name for an experimental config file that worked (as opposed to
    a series of trial configs that didn’t). The original main.cf is renamed main.cf.orig to keep it around as an unadulterated reference. Works for me
    and doesn’t get clobbered in updates.

    If I change any config file I usually rename it with a .orig suffix, alter
    a copy of the original, and point to the altered copy with a soft link. The soft link has the standard config file name. The altered copy has a name different from anything expected by the installation. The soft link allows
    me to try a bunch of different configs as I’m tuning the application.

    Haven’t lost any custom configurations doing this, it makes my own modifications abundantly clear, and it keeps an original around for when I
    make a mess of my customizations. A quick diff between the .orig file and
    any ._cfg files after an update shows me what’s changed in the update.

    There are portage file merging tools for config updates, but I don’t use
    them often enough to use them properly. So I’ve reverted to this simple minded system. And backups!

    HTH

    John

    <div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Nov 27, 2022 at 5:36 AM Wols Lists &lt;<a href="mailto:antlists@youngman.org.uk">antlists@youngman.org.uk</a>&gt; wrote:<br></div><blockquote class="gmail_quote"
    style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">I&#39;ve just had emerge telling me it wants to trash my postfix config :-)<br>

    I&#39;m not sure whether my setup is actually using it, I use dovecot to <br> deliver my mail, but is there any way I can stop random updates trying <br>
    to trash my local changes? I&#39;m rubbish at merging updates, and last time <br>
    I tried I think the result was a complete mess.<br>

    And I said I use dovecot to deliver mail - that takes a leaf out of the <br> systemd book and has a master config file pointing to a local config <br>
    file. Any updates to dovecot don&#39;t touch the local file, and don&#39;t touch <br>
    my local settings.<br>

    Can I do anything similar for postfix?<br>

    Cheers,<br>
    Wol<br>

    </blockquote></div></div>I’m not a systemd user, so I don’t know precisely what systemd does. But my /etc/postfix/<a href="http://main.cf">main.cf</a> is a soft link to “main.cf.works”, which was an unoriginal name for an experimental config file
    that worked (as opposed to a series of trial configs that didn’t). The original <a href="http://main.cf">main.cf</a> is renamed main.cf.orig to keep it around as an unadulterated reference. Works for me and doesn’t get clobbered in updates.<div dir="
    auto"><br></div><div dir="auto">If I change any config file I usually rename it with a .orig suffix, alter a copy of the original, and point to the altered copy with a soft link. The soft link has the standard config file name. The altered copy has a
    name different from anything expected by the installation. The soft link allows me to try a bunch of different configs as I’m tuning the application.</div><div dir="auto"><br></div><div dir="auto">Haven’t lost any custom configurations doing this, it
    makes my own modifications abundantly clear, and it keeps an original around for when I make a mess of my customizations. A quick diff between the .orig file and any ._cfg files after an update shows me what’s changed in the update.</div><div dir="auto"
    <br></div><div dir="auto">There are portage file merging tools for config updates, but I don’t use them often enough to use them properly. So I’ve reverted to this simple minded system. And backups!</div><div dir="auto"><br></div><div dir="auto">HTH<
    /div><div dir="auto"><br></div><div dir="auto">John</div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wol@21:1/5 to John Blinka on Sun Nov 27 15:50:01 2022
    On 27/11/2022 13:21, John Blinka wrote:
    I’m not a systemd user, so I don’t know precisely what systemd does. But my /etc/postfix/main.cf <http://main.cf> is a soft link to “main.cf.works”, which was an unoriginal name for an experimental config file that worked (as opposed to a series of trial configs that didn’t).
    The original main.cf <http://main.cf> is renamed main.cf.orig to keep it around as an unadulterated reference. Works for me and doesn’t get clobbered in updates.

    Systemd stores its *distro*supplied* config files in /usr.

    It stores its user-supplied config files in /etc.

    So when your distro updates systemd, it doesn't go anywhere near your
    local changes.

    Dovecot doesn't do it quite the same way, the default distro config
    loads a "config.local" file if it exists. So when your distro updates
    the master config, your local config is untouched.

    Postfix afaik just has one humungous config file, so when your distro
    updates the config, all your local changes are trashed :-(

    I don't want to faff about with special copies, backups, origs etc.
    Everything should "just work (tm)".

    Cheers,
    Wol

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mike Civil@21:1/5 to Wol on Sun Nov 27 17:00:03 2022
    On 27/11/2022 14:50, Wol wrote:
    Postfix afaik just has one humungous config file, so when your distro
    updates the config, all your local changes are trashed :-(

    I don't want to faff about with special copies, backups, origs etc. Everything should "just work (tm)".

    Except that portage doesn't overwrite stuff under /etc by default. It
    saves the new config file and then tells you there's an update so you
    can use etc-update or dispatch-conf to check/merge/abort the changes.
    After all the new version of software may need a change to the old
    config file.

    If you've files that you want protected that aren't under /etc then add
    the path to the CONFIG_PROTECT variable:-

    https://wiki.gentoo.org/wiki/CONFIG_PROTECT/en

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John Blinka@21:1/5 to antlists@youngman.org.uk on Sun Nov 27 23:30:02 2022
    On Sun, Nov 27, 2022 at 9:42 AM Wol <antlists@youngman.org.uk> wrote:

    On 27/11/2022 13:21, John Blinka wrote:

    Systemd stores its *distro*supplied* config files in /usr.

    It stores its user-supplied config files in /etc.

    So when your distro updates systemd, it doesn't go anywhere near your
    local changes.

    Dovecot doesn't do it quite the same way, the default distro config
    loads a "config.local" file if it exists. So when your distro updates
    the master config, your local config is untouched.

    Postfix afaik just has one humungous config file, so when your distro
    updates the config, all your local changes are trashed :-(


    If your goal is to update postfix without clobbering your artfully crafted config file, then that’s what portage has been doing for me quite reliably for the past 20-30 years. No effort required to protect anything in /etc
    from updates. A new humongous postfix config file gets installed in /etc/postfix/._cfg<whatever> and your custom config file remains untouched.
    It just works (tm). But you know that. I’m thinking I don’t at all understand your issue.



    I don't want to faff about with special copies, backups, origs etc. Everything should "just work (tm)".


    Fair enough! Not expecting that my faffing about would appeal to anyone but
    me. ;)

    John

    <div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Nov 27, 2022 at 9:42 AM Wol &lt;<a href="mailto:antlists@youngman.org.uk">antlists@youngman.org.uk</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="
    margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" dir="auto">On 27/11/2022 13:21, John Blinka wrote:<br>

    Systemd stores its *distro*supplied* config files in /usr.<br>

    It stores its user-supplied config files in /etc.<br>

    So when your distro updates systemd, it doesn&#39;t go anywhere near your <br> local changes.<br>

    Dovecot doesn&#39;t do it quite the same way, the default distro config <br> loads a &quot;config.local&quot; file if it exists. So when your distro updates <br>
    the master config, your local config is untouched.<br>

    Postfix afaik just has one humungous config file, so when your distro <br> updates the config, all your local changes are trashed :-(</blockquote><div dir="auto"><br></div><div dir="auto">If your goal is to update postfix without clobbering your artfully crafted config file, then that’s what portage has been doing for me
    quite reliably for the past 20-30 years. No effort required to protect anything in /etc from updates. A new humongous postfix config file gets installed in /etc/postfix/._cfg&lt;whatever&gt; and your custom config file remains untouched. It just works (
    tm). But you know that. I’m thinking I don’t at all understand your issue.</div><div dir="auto"><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" dir="auto"><br>

    I don&#39;t want to faff about with special copies, backups, origs etc. <br> Everything should &quot;just work (tm)&quot;.</blockquote><div dir="auto"><br></div><div dir="auto">Fair enough! Not expecting that my faffing about would appeal to anyone but me. ;)</div><div dir="auto"><br></div><div dir="auto">John</div></div></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wol@21:1/5 to Mike Civil on Sun Nov 27 23:20:01 2022
    On 27/11/2022 15:49, Mike Civil wrote:
    On 27/11/2022 14:50, Wol wrote:
    Postfix afaik just has one humungous config file, so when your distro
    updates the config, all your local changes are trashed :-(

    I don't want to faff about with special copies, backups, origs etc.
    Everything should "just work (tm)".

    Except that portage doesn't overwrite stuff under /etc by default. It
    saves the new config file and then tells you there's an update so you
    can use etc-update or dispatch-conf to check/merge/abort the changes.
    After all the new version of software may need a change to the old
    config file.

    It's not portage I'm worried about, it's me!

    Systemd DOES NOT PUT YOUR LOCAL CONFIG IN DANGER.

    Dovecot DOES NOT PUT YOUR LOCAL CONFIG IN DANGER (if you do it properly).

    EVERY SINGLE POSTFIX UPDATE PUTS YOUR CONFIG IN DANGER.

    Of course, if you're Mr Perfect you won't have a problem. Why can't
    postfix *protect* me, like systemd or dovecot do?

    NB - The Linux Filesystem Hierarchy (such as it is now) says that the
    distro should not be writing to /etc ! Default system state belongs in
    /usr, live system state belongs in /etc, and if the distro updates /etc
    it is basically corrupting system state. Which may or may not be
    acceptable - and here it isn't.

    Cheers,
    Wol

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Neil Bothwick@21:1/5 to Wol on Tue Nov 29 00:20:01 2022
    On Sun, 27 Nov 2022 22:12:21 +0000, Wol wrote:

    Postfix afaik just has one humungous config file, so when your
    distro updates the config, all your local changes are trashed :-(

    I don't want to faff about with special copies, backups, origs etc.
    Everything should "just work (tm)".

    Except that portage doesn't overwrite stuff under /etc by default. It saves the new config file and then tells you there's an update so you
    can use etc-update or dispatch-conf to check/merge/abort the changes. After all the new version of software may need a change to the old
    config file.

    It's not portage I'm worried about, it's me!

    Systemd DOES NOT PUT YOUR LOCAL CONFIG IN DANGER.

    Dovecot DOES NOT PUT YOUR LOCAL CONFIG IN DANGER (if you do it
    properly).

    EVERY SINGLE POSTFIX UPDATE PUTS YOUR CONFIG IN DANGER.

    Only if you run your chosen config manager without paying attention, but
    Gentoo is particularly good at punishing those who do not pay attention.

    Of course, if you're Mr Perfect you won't have a problem. Why can't
    postfix *protect* me, like systemd or dovecot do?

    Many, many programs have and option to include a local config file:
    dnsmasq, Xorg, motion and rkhunter are the first to spring to mind right
    now. Your problem is not with Gentoo, it does a good job of mitigating
    the risk, it is with Postfix. Why not file a bug with them asking for an "include otherfile.cf" option. Or, even better, and includedir option.


    --
    Neil Bothwick

    Multitasking: Reading in the bathroom.

    -----BEGIN PGP SIGNATURE-----

    iQIzBAEBCAAdFiEE8k9T/rX16EJxEKG692eFu0QSMJgFAmOFQYsACgkQ92eFu0QS MJgDWw/+PsSzsVOMbhBVgJS9abwjfYxFL5pIndlDZhf5FzKk7q0m5UIRiPa7+DHn 9oP/vs5q4ud5XDGgvqrH9d3efci5iBrZqgWLN/8JmwOwz4cpR+KQG0JSTav03g7a swB36ggb9Wbt6J+PfL+c9po/5dbed5ECkRO26F17GwWrLqCQAdZEK+7MaIb7Z4UQ 4W0z54xkGdr4ZqexC+r19AdK5cAxCKHOyOEbsDQdFDKnvoUWue1DxkawxYjNkyOM Yvi4nEQ2FOacGFHFEP+w/4PiDXbZz9gLBxxbZWfiLwgrISCo2suQy9+wD1hzEaxP 9r64VxfECl5+pjNTsRG/fcAMDdfDR4Ewyuc+IMq1e29Q5R3nQBqvfAZPjWWKgNQ7 Z6qRM93QVZRht3oPW9Uk9yQ04qGyeB/lIljJJZGfwWq8fDNl82RZhMiJukaGmj1o fo2pTx9U3aXIPdDvg26JkDDe9yuatuKCQ5YsDCmBsn7rkJrjI72mtvbgC2ScGlQY Wpqh8gkiV5/AdikAeNpD8Ilxua4548Gu4Zj3uc8lrvX6DQ2TdZ1NLBWiM8xQvHcl k7M8arleW3dKqpOeG1ENIROJnEiKDTtP5RylvHbsrSIg3AbCYsRD6lcRwO5y0IWa a5s7Iwksi/CCBCDokE44L++4tcUg9/fLvsu8aA4nbsAyZRwGYKQ=
    =tm1L
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)