public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: Christoph Heiss <c.heiss@proxmox.com>
Cc: pmg-devel@lists.proxmox.com
Subject: Re: [pmg-devel] [PATCH pmg-{api, gui, docs} 0/3] fix #2437: Add TLS inbound policy for sender domains
Date: Thu, 16 Mar 2023 13:28:42 +0100	[thread overview]
Message-ID: <20230316132842.283a5276@rosa.proxmox.com> (raw)
In-Reply-To: <20230309101846.192177-1-c.heiss@proxmox.com>

Thanks for tackling this!!

Works as advertised in general - so I think the approach is fine

One thing that seems odd to me (and sadly I don't have a good and short
answer) is that it's not a policy we're setting - it's a list of domains,
for which the singular policy (in this context) is that we accept mails
from them only via tls...

Inbound TLS Domains ? (at least mentions TLS, and explicitly mentioning
domains might be hint enough that you cannot enter an IP (or network)
there)
Reject Plaintext Domains? (probably only appeals to users who know
`postconf(5)` by heart)

some comments inline (some as reply to the individual patches):
On Thu,  9 Mar 2023 11:18:43 +0100
Christoph Heiss <c.heiss@proxmox.com> wrote:

> 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.)
I personally am fine with terse documentation - however I always try to
refer to the authoritative source - in this case the relevant postfix
config parameter ([1]) - that way users who want to get more details
actually see what's going on under the hood).
You could rephrase the docs to mention that it sets
reject_plaintext_session for those domains during MAIL FROM)


> 
> 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@localhost.localdomain \
>     --mail-rcpt bar@localhost.localdomain
> 
> .. where `localhost.localdomain` is on the new 'TLS Inboud Policy' list.
> This will now fail with:
I use swaks (apt installable) quite extensively for such things - short of
smtputf8 support it should cover most use-cases - but thanks for the tip
with curl being able to speak smtp as well :)

> 
>   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
> 
> 
> 
> _______________________________________________
> pmg-devel mailing list
> pmg-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel
> 
> 





  parent reply	other threads:[~2023-03-16 12:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09 10:18 Christoph Heiss
2023-03-09 10:18 ` [pmg-devel] [PATCH pmg-api 1/3] fix #2437: config: Add inbound TLS policy option Christoph Heiss
2023-03-16 12:50   ` Stoiko Ivanov
2023-03-20  8:21     ` Christoph Heiss
2023-03-09 10:18 ` [pmg-devel] [PATCH pmg-gui 2/3] fix #2437: proxy: Add 'TLS Inbound Policy' panel Christoph Heiss
2023-03-16 12:32   ` Stoiko Ivanov
2023-03-20  8:36     ` Christoph Heiss
2023-03-20  8:42       ` Stoiko Ivanov
2023-03-09 10:18 ` [pmg-devel] [PATCH pmg-docs 3/3] pmgconfig: Explain new TLS inbound policy configuration Christoph Heiss
2023-03-16 12:28 ` Stoiko Ivanov [this message]
2023-03-20  8:14   ` [pmg-devel] [PATCH pmg-{api, gui, docs} 0/3] fix #2437: Add TLS inbound policy for sender domains Christoph Heiss
2023-03-20  8:36     ` Stoiko Ivanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230316132842.283a5276@rosa.proxmox.com \
    --to=s.ivanov@proxmox.com \
    --cc=c.heiss@proxmox.com \
    --cc=pmg-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal