[pmg-devel] [PATCH pmg-{api, gui, docs} 0/3] fix #2437: Add TLS inbound policy for sender domains

Christoph Heiss c.heiss at proxmox.com
Thu Mar 9 11:18:43 CET 2023


TL;DR: Implements the approach as laid out by Stoiko in the Bugzilla
ticket [0].

A new API endpoint is added - /api2/json/config/tlsinboundpolicy. This
is used to configure the newly introduced postfix map at
/etc/pmg/tls_inbound_policy, specifying sender domains which get the
`reject_plaintext_session` action [1] set, thus requiring TLS-encrypted
sessions on inbound connections.

On the GUI side, a new panel is added in Configuration -> Mail Proxy ->
TLS, where the domains can be specified for this new policy.

The documentation changes are quite terse, maybe I should expand a bit
more on that topic? (Although the TLS destination policy is only lightly
documented as well, as far as I could see.)

Testing
-------
Tested this to the best of my knowledge, by adding some domains as TLS
inbound policy and using `curl` to send some simple mails:

  echo '' | curl -skv smtp://<host> -T - \
    --mail-from foo at localhost.localdomain \
    --mail-rcpt bar at localhost.localdomain

.. where `localhost.localdomain` is on the new 'TLS Inboud Policy' list.
This will now fail with:

  450 4.7.1 Session encryption is required

When additionally adding the `--ssl-reqd` option to curl (instructing it
to require a TLS-encrypted session), the above command will succeed.

(Also tested it with a domain not on the list, checking that no
regressions are introduced.)

[0] https://bugzilla.proxmox.com/show_bug.cgi?id=2437
[1] http://www.postfix.org/postconf.5.html#reject_plaintext_session

---
pmg-api:

Christoph Heiss (1):
      fix #2437: config: Add inbound TLS policy option

 src/Makefile                     |   1 +
 src/PMG/API2/Config.pm           |   7 +++
 src/PMG/API2/InboundTLSPolicy.pm | 127 +++++++++++++++++++++++++++++++++++++++
 src/PMG/Config.pm                |  56 +++++++++++++++++
 src/templates/main.cf.in         |   1 +
 5 files changed, 192 insertions(+)

pmg-gui:

Christoph Heiss (1):
      fix #2437: proxy: Add 'TLS Inbound Policy' panel

 js/MailProxyTLSInboundPolicy.js | 93 +++++++++++++++++++++++++++++++++++++++++
 js/MailProxyTLSPanel.js         |  8 +++-
 js/Makefile                     |  1 +
 3 files changed, 101 insertions(+), 1 deletion(-)

pmg-docs:

Christoph Heiss (1):
      pmgconfig: Explain new TLS inbound policy configuration

 pmgconfig.adoc | 8 ++++++++
 1 file changed, 8 insertions(+)

--
2.39.2





More information about the pmg-devel mailing list