Skip to content

Commit ea25f3f

Browse files
slusarzcmouse
authored andcommitted
submission: Add additional high-level design information from Stephan
1 parent 23df070 commit ea25f3f

File tree

2 files changed

+51
-19
lines changed

2 files changed

+51
-19
lines changed

docs/core/admin/login_proxy.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
layout: doc
33
title: Login Proxying
4+
dovecotlinks:
5+
login_proxy: Login Proxying
46
---
57

68
# Login Process Proxying

docs/core/config/submission.md

Lines changed: 49 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,21 @@ dovecotlinks:
1111
Dovecot provides an SMTP submission service, also known as a Mail
1212
Submission Agent (MSA) ([[rfc,6409]]).
1313

14-
It is currently implemented as a proxy that acts as a front-end for any
15-
[[link,mta]], adding the necessary functionality required for a submission
16-
service: it adds the required AUTH ([[rfc,4954]]) support, avoiding
17-
the need to configure the MTA for [[link,sasl]].
18-
1914
::: danger NOTE
2015
Dovecot's submission server is NOT a full-featured SMTP server. It REQUIRES
2116
proxying to an external relay SMTP submission server to deliver non-local
2217
messages.
2318
:::
2419

20+
It is currently implemented as a [[link,login_proxy,proxy]] that acts as a
21+
front-end for any [[link,mta]], adding the necessary functionality required
22+
for a submission service: it adds the required AUTH ([[rfc,4954]]) support,
23+
avoiding the need to configure the MTA for [[link,sasl]]. Additionally, the
24+
client TLS layer is terminated at Dovecot (either with or without STARTTLS),
25+
so that all mail protocol certificates are handled solely by Dovecot and do
26+
not need to be configured in the MTA (although inter-server TLS encryption
27+
can be enabled if needed.)
28+
2529
More SMTP capabilities like CHUNKING ([[rfc,3030]]) and SIZE ([[rfc,1870]])
2630
are supported, without requiring the backend MTA supporting these extensions.
2731

@@ -40,17 +44,6 @@ capability, but once it becomes available on the server side, client
4044
developers will at least have some incentive to provide support for
4145
this feature.
4246

43-
::: warning NOTE
44-
Currently, the submission proxy is still pretty basic. However, it will
45-
provide a basis for adding all kinds of functionality in the (not so distant)
46-
future. For the first time, it will be possible to act upon message
47-
submission, rather than only message retrieval; e.g. plugins can be devised
48-
that process outgoing messages somehow. Examples of the things that could be
49-
implemented are adding Sieve filtering support for outgoing messages, or
50-
implicitly storing submitted messages to the Sent folder. Once a plugin API
51-
is devised, you can create your own plugins.
52-
:::
53-
5447
The submission service, when protocol submission is enabled, will listen to
5548
587/tcp (STARTTLS) by default.
5649

@@ -103,9 +96,8 @@ the SMTP relay.
10396

10497
### Login Proxy
10598

106-
Like IMAP and POP3, the Submission login service supports proxying to multiple
107-
backend Dovecot servers. The proxy configuration wiki page for POP3 and IMAP
108-
applies automatically to Submission as well.
99+
Like IMAP and POP3, the Submission login service supports
100+
[[link,authentication_proxies,proxying]] to multiple backend Dovecot servers.
109101

110102
::: warning IMPORTANT
111103
Please note that the login proxy described here is configured between two
@@ -129,3 +121,41 @@ service submission-login {
129121
}
130122
}
131123
```
124+
125+
## Design
126+
127+
The Dovecot submission service is structured very much like the imap and
128+
pop3 services, meaning that it has separate pre-login and post-login
129+
services called submission-login and submission respectively.
130+
131+
The pre-login service can be chrooted and can be devoid of most privileges
132+
and only serves to operate the TLS layer and perform authentication.
133+
This serves to isolate the sensitive SMTP functionality from unauthorized
134+
access, also when the frontend were compromised. Once authenticated, the
135+
connection is handed over to the post-login service.
136+
137+
The post-login service checks the validity of the SMTP transactions and
138+
forwards them on the fly to the backend MTA, while also translating or
139+
handling capabilities such as BURL and CHUNKING; e.g., when the backend MTA
140+
provides no support for these features. For the BURL capability, the
141+
post-login service has direct access to the user's mail storage.
142+
143+
Proxying for the submission service works identical to the imap and pop3
144+
services. This means that the submission-login service proxies to another
145+
Dovecot backend instance that handles the subsequent relay to the MTA
146+
infrastructure. In this case there is proxying between two Dovecot instances
147+
and a relay from the Dovecot backend instance to a non-Dovecot backend MTA.
148+
149+
::: danger IMPORTANT
150+
It is explicitly not supported to use submission-login to proxy directly to
151+
a backend MTA.
152+
153+
This would mean that after authentication the connection is proxied directly
154+
to the external non-Dovecot MTA, which will then completely handle the SMTP
155+
protocol exchange. Although authentication and TLS can still operate this
156+
way, the other features and additional protocol verification that Dovecot
157+
submission adds will be broken. Additionally, the submission-login service
158+
is likely to lie to the client about which SMTP capabilities are supported
159+
by the service, since the announced capabilities and those provided by the
160+
MTA will likely differ.
161+
:::

0 commit comments

Comments
 (0)