Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 587496 - mail-mta/postfix-3.1 USE="ssl" modifies user-generated config on install
Summary: mail-mta/postfix-3.1 USE="ssl" modifies user-generated config on install
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Net-Mail Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-29 09:38 UTC by Patrick Lauer
Modified: 2016-07-12 07:50 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Lauer gentoo-dev 2016-06-29 09:38:59 UTC
Postfix-3.1+ ebuilds do this:

pkg_postinst() {
        [ "${EROOT}" == "/" ] && pkg_config
...
}

pkg_config() {
        # configure tls
        if use ssl ; then
                if "${EROOT}"usr/sbin/postfix tls all-default-client ; then
                        elog "Configuring client side TLS settings"
                        "${EROOT}"usr/sbin/postfix tls enable-client
                fi
                if "${EROOT}"usr/sbin/postfix tls all-default-server ; then
                        elog "Configuring server side TLS settings"
                        "${EROOT}"usr/sbin/postfix tls enable-server
                fi
        fi
}

This actively changes the config and may cause random breakage.

Tying opportunistic-TLS to USE="ssl" is very unfortunate since one may wish to use SSL without opportunistic-TLS.

I would strongly recommend only printing a message how to enable opportunistic-TLS and not actively interfering with user config.
Comment 1 Eray Aslan gentoo-dev 2016-06-30 05:51:30 UTC
(In reply to Patrick Lauer from comment #0)
> This actively changes the config and may cause random breakage.

How so?  What's the breakage?

> Tying opportunistic-TLS to USE="ssl" is very unfortunate since one may wish
> to use SSL without opportunistic-TLS.

I do not understand this statement.  We only do opportunistic TLS if the TLS is not configured.  Care to elaborate?
Comment 2 Patrick Lauer gentoo-dev 2016-07-01 11:41:36 UTC
(In reply to Eray Aslan from comment #1)
> (In reply to Patrick Lauer from comment #0)
> > This actively changes the config and may cause random breakage.
> 
> How so?  What's the breakage?

Our outgoing mail partially failed because some receiving servers didn't appreciate the change. It's not as harmless as a change as it looks like

> 
> > Tying opportunistic-TLS to USE="ssl" is very unfortunate since one may wish
> > to use SSL without opportunistic-TLS.
> 
> I do not understand this statement.  We only do opportunistic TLS if the TLS
> is not configured.  Care to elaborate?

Yes, that's a bad idea. Only enable it when I ask for it to be enabled, otherwise there can be unexpected side-effects. And pkg_postinst actively changing the config (bypassing etc-update/dispatch-conf/...) is very naughty and shouldn't happen at all.

So I'm not opposed to having it enabled in the default config (portage won't overwrite my locally modified config with it) or just printing a nice einfo "You may want to run these commands to enable features", but silently overwriting my handcrafted config is unexpected badness.
Comment 3 Patrick Lauer gentoo-dev 2016-07-04 15:00:50 UTC
Jul  4 14:56:36 qa postfix/master[36617]: daemon started -- version 3.1.0, configuration /etc/postfix
Jul  4 14:56:39 qa postfix/smtpd[36705]: connect from localhost[::1]
Jul  4 14:56:39 qa postfix/smtpd[36705]: Anonymous TLS connection established from localhost[::1]: TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)
Jul  4 14:56:39 qa postfix/smtpd[36705]: lost connection after STARTTLS from localhost[::1]
Jul  4 14:56:39 qa postfix/smtpd[36705]: disconnect from localhost[::1] ehlo=1 starttls=1 commands=2


iow: it breaks all local stuff in the most awesome way possible
Comment 4 Patrick Lauer gentoo-dev 2016-07-04 15:22:14 UTC
fd192b99315b9901124b1e26e34b87dc2f3b48eb disables this misfeature
Comment 5 Eray Aslan gentoo-dev 2016-07-12 07:50:34 UTC
(In reply to Patrick Lauer from comment #3)
> Jul  4 14:56:39 qa postfix/smtpd[36705]: lost connection after STARTTLS from
> localhost[::1]

All that tells us that remote end dropped the connection which can be any number of gazillion reasons.  Check the other end.

Just step back and think about it.  You are suggesting opportunistic tls in postfix is causing breakage.  That's an extraordinary claim requiring extraordinary proof.  Your argument is bogus and more drama than proof really.

However, the other argument -don't change stuff in pkg_postinst- has merit and I will implement that in the next bump.

(In reply to Patrick Lauer from comment #4)
> fd192b99315b9901124b1e26e34b87dc2f3b48eb disables this misfeature

Don't do that again before checking with me.

In either case, consider working with people instead of against them.