Gentoo Archives: gentoo-user

From: Grant Taylor <gtaylor@×××××××××××××××××××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] tips on running a mail server in a cheap vps provider run but not-so-trusty admins?
Date: Fri, 21 Aug 2020 19:37:33
Message-Id: 39654cc6-8554-0b34-4416-ccea5e5c2455@gentoo.tnetconsulting.net
In Reply to: Re: [gentoo-user] tips on running a mail server in a cheap vps provider run but not-so-trusty admins? by Rich Freeman
1 On 8/21/20 6:37 AM, Rich Freeman wrote:
2 > This stuff can be interesting to discuss, but email is SO entrenched
3 > that I don't see any of this changing because of all the legacy issues.
4 > You would need to offer something that is both easier and better to
5 > use to such a degree that people are willing to change.
6
7 "something that is /both/ *easier* and *better*".
8
9 That's a VERY tall bar to clear.
10
11 > 1. Modernizing the actual data exchange using http/etc.
12 >
13 > I don't think you'll get much argument that SMTP isn't the way
14 > somebody would do things if they were designing everything from
15 > scratch.
16
17 SMTP may not be the best, but I do think that it has some merits.
18 Merits that the previously mentioned HTTP/2 alternative misses.
19
20 Remember, SMTP is a protocol, or a set of rules, for how two email
21 servers are supposed to exchange email. These rules include the following:
22
23 1) Proper server greeting, used to identify the features that can be
24 used. (HELO for SMTP and EHLO for ESMTP.)
25 2) Identifying the sender.
26 3) Identifying the recipient(s).
27 4) Sending the message payload.
28
29 Each of these discrete steps is a bi-directional communication.
30 Communication that can alter all subsequent aspects of a given SMTP
31 exchange.
32
33 The server could be an older server that only speaks SMTP and as such
34 doesn't support STARTTLS. Thus causing the client to /not/ try to use
35 STARTTLS in accordance with current best practices. Other ESMTP
36 features come into play here like message size, 8-bit, notification
37 features, etc.
38
39 The receiving server has the ability to assess the sending server's
40 behavior at each point to use that as an indication to know if the
41 sender is a legitimate email server or something more nefarious and
42 undesirable. -- There is a surprising amount of email hygiene based on
43 sending server's behavior.
44
45 The receiving server may carte blanch reject messages from specific
46 senders / sending domains and / or specific recipients, particularly
47 non-existent recipients.
48
49 SMTP has low overhead in that the message body is not transferred from
50 the sending server to the receiving server if any part of steps 1-3
51 aren't satisfactory to the receiving server.
52
53 > I'm not an API expert but I imagine that just about any of the modern
54 > alternatives would be an improvement.
55
56 Maybe. Maybe not.
57
58 What is the actual problem with SMTP as it is?
59
60 What /need/ to be improved? What could benefit from improvement even if
61 it's not /needed/?
62
63 > http would be a pretty likely protocol to handle the transportation,
64
65 Why HTTP?
66
67 Did you mean to imply HTTPS?
68
69 Why add an additional protocol to the stack?
70
71 TCP / SMTP is two layers.
72
73 TCP / HTTP / $Email-protocol-de-jure is three layers.
74
75 UDP / HTTP / $Email-protocol-de-jusre is three layers.
76
77 Why introduce an additional layer?
78
79 Why introduce an additional dependency in the application stack?
80
81 Why co-mingle email with other non-email traffic? -- Or are you
82 wanting to run HTTP(S) on TCP port 25?
83
84 > likely with something like JSON/xml/etc carrying the payload.
85
86 Why add an additional encapsulation on top of the additional layer?
87
88 What does JSON / XML / etc. on top of HTTP(S) provide that SMTP doesn't
89 provide?
90
91 What is the gain?
92
93 Is the gain worth the cost of doing so?
94
95 > You might want to tweak things slightly so that recipient validity can
96 > be tested prior to transferring data.
97
98 Definitely. (See above for more details as to why.)
99
100 But now you are doing multiple exchanges.
101
102 If we extrapolate this out to also include sender validation, and
103 probably hello messages, you are back to four or more exchanges.
104
105 How is this better than SMTP on TCP port 25? What is the benefit? What
106 does it cost to get this benefit?
107
108 > A mail server doesn't want to accept a 20MB encrypted payload if it can
109 > bounce the whole message based on the recipient or a non-authenticated
110 > sender or whatever.
111
112 Which is one of the many reasons why there are multiple exchanges back
113 and forth.
114
115 > However, in principle there are plenty of modern ways to build a
116 > transport protocol that would be an improvement on SMTP ...
117
118 Please elaborate.
119
120 Please include what network layer (3) protocol(s) you want to use and why.
121
122 Please include what application layer (7) protocol(s) you want to use
123 and why.
124
125 Please include any encoding / encapsulation you want to use and why.
126
127 > ... use more standard libraries/etc.
128
129 There are many libraries to interface with SMTP.
130
131 Also, handing a message off to an SMTP server alleviates the application
132 from having to deal with failed deliveries, queuing, and retrying.
133
134 Why add that complexity into each and every application? Especially if
135 you don't have to?
136
137 Note: Pulling it in via a library is still indirectly adding it to each
138 and every application.
139
140 How is SMTP /not/ standard?
141
142 Also: https://xkcd.com/927/ -- Standards
143
144 > I think this is actually the part of your proposal that might be
145 > more likely to take off. You could have a new type of MX field in
146 > DNS ...
147
148 So yet more complexity in addition to the extra layers of the stack.
149
150 > ... if it is set then it defines servers that will use the new protocol,
151
152 It defines servers that are purportedly /capable/ of using the new protocol.
153
154 Advertising a capability is entirely different than using an advertised
155 capability.
156
157 > and you could have backup SMTP servers for legacy transition.
158
159 We've been transitioning from SMTP to ESMTP for about 28 years. How
160 long do you think it will be before we finish transitioning away from
161 stock SMTP?
162
163 Further, how long do you think it will be before we finish transitioning
164 to your new proposed standard? I'm guessing at least another 30 years
165 to finish it.
166
167 So how long will we have three email protocols; SMTP, ESMTP, and
168 $Email-protocol-de-jure?
169
170 > You could change the transport side of things without redefining how
171 > email works, so the same messages are interoperable with both systems.
172
173 So now you are proposing putting the SMTP protocol on top of a new
174 transport instead of TCP.
175
176 Old: TCP / SMTP is two layers
177
178 New: TCP / HTTP(S) / SMTP is three layers
179 New: UDP / HTTP(S) / SMTP is three layers
180
181 What exactly does moving SMTP from TCP to HTTP(S) provide? What is the
182 benefit for the added complexity and dependencies?
183
184 > On the flip side, while I think this is an easier change to make,
185 > I don't think it necessarily offers huge improvements.
186
187 So why bother doing it at all?
188
189 > SMTP still gets the job done,
190
191 Yes. SMTP does it's job sufficiently well. Is it the best method?
192 Doubtful. Is it well supported and widely used? Yes on both accounts.
193
194 Note: The same can be said about Ethernet too. Yet here we are 30
195 years later still using it and enhancing it to be 40,000 times faster
196 than it originally was. (400,000,000,000 bps vs 10,000,000 bps)
197
198 > and the new system wouldn't really be a major improvement from a
199 > sysadmin standpoint, so I don't see everybody running out to change.
200
201 If there's not a significant* change, why should we bother changing?
202
203 Where significant is enough to overcome the work effort and pain to make
204 the change.
205
206 > Just changing the transport protocols doesn't provide any anti-spam/etc
207 > benefits.
208
209 Nope. So no benefit and additional complexity / overhead. Sounds like
210 a net loss to me.
211
212 > SMTP already supports TLS so it isn't any more secure.
213
214 Just because (START)TLS is provided doesn't mean that it's used.
215
216 There may be some benefit to using a transport that has implicit
217 (START)TLS encryption.
218
219 We could easily revisit SMTPS, which does have implicit TLS encryption
220 on TCP port 465.
221
222 SMTPS is a well establish, but seldom used, way for clients to send
223 email to their outgoing mail server. Perhaps we could re-use this as a
224 new server-to-server SMTP transport. Slightly modifying and re-using
225 prior art is almost always better received than something completely new.
226
227 There is also the possibility of working on augmenting SMTP, or more
228 likely the metadata around it, to make existing SMTP servers to
229 /require/ STARTTLS when it is known that both the sending and receiving
230 servers support it.
231
232 This latter idea is already somewhat being done by many email
233 administrators. Admittedly it's sub-optimal and likely manual. But
234 that sounds like a simpler change. Perhaps publishing a flag in DNS
235 could indicate that email from my servers should be STARTTLS encrypted
236 and you should require it on the receiving server (presuming you support
237 it).
238
239 > No doubt ...
240
241 I have serious doubt.
242
243 > ... if we were starting from scratch this is how it would be done, but
244 > it isn't enough of a reason to change.
245
246 DING DING DING!!!
247
248 > That said, if there were even modest benefits for large mail providers
249 > I could see it taking off simply because it could leverage a lot of
250 > existing libraries and standards, and could have legacy compatibility.
251
252 But we already have MANY libraries and MANY standards. What good does
253 yet another one provide?
254
255 Stop focusing on HTTP(S) <any version thereof> for a few minutes.
256
257 If you were to create a new protocol from the ground up, why would you
258 introduce additional layers into the application stack — which represent
259 additional dependencies and complications — if you didn't have to?
260
261 Not everything is a web server. Not everything can benefit from being
262 forced through a web server.
263
264 > 2. Changing the model around email moving to something more
265 > PKI-based/etc and redefining what an email address is.
266 >
267 > This is where you could have revolutionary improvements for
268 > privacy/spam/etc.
269
270 What does changing email addresses (user part and / or domain part)
271 provide functionality that can't be done — as in is not at all possible
272 to do — with current email addresses?
273
274 > However, it completely breaks everything that exists with email today,
275 > so it is a hard change.
276
277 Changing email addresses doesn't break email as it exists today. /SMTP/
278 /doesn't/ /care/ what the addresses are.
279
280 /Humans/ /using/ /email/ (thus indirectly SMTP) /do/ /care/ what the
281 addresses are.
282
283 > Most of the benefits only accrue if you adopt PKI as well, which is
284 > a problem that is hard to scale out to the masses.
285
286 PKI is relatively easy to scale. (For a given value.) Hence the
287 thriving CA industry.
288
289 Doing so in a trust worthy manner is the problem. Especially if you
290 want to avoid a single point of control / failure / GEO political / etc.
291
292 > If somebody comes up with a way to make PKI take off in a real way,
293 > then I could see something like this taking off eventually. Otherwise,
294 > this stuff is only going to be of interest to the sorts who use gpg
295 > to sign their email, and nobody else.
296
297 The biggest issue I see with PKI is /bootstraping/ trust.
298
299 If we throw all the trusted CAs out the window, how do you /bootstrap/
300 encrypted communications? - My personal opinion is DNS.
301
302 We already have a very well understood, globally distributed, highly
303 redundant database with unique keys.
304
305 We have methods to authenticate it; DNSSEC.
306
307 We have ways to hid it's use; DNSCrypt, DNS-over-TLS (DoT),
308 DNS-over-HTTPS (DoH), DNS-over-53-over-IPsec (transport mode), and VPNs
309 (IPsec (tunnel mode), OpenVPN, WireGuard, et al.
310
311 So, why not put recipient's public keys in this phenomenal
312 infrastructure that we already have in place?
313
314 Oh, we did. There are already ways to publish S/MIME keys in DNS. I'm
315 fairly certain that there are ways to publish PGP keys in DNS too.
316 Non-conflicting ways at that.
317
318 We also have ways to publish the public key of a host's public / private
319 key pair.
320
321 The sad thing is that most people don't know that these well defined
322 methodologies exist and of those that do, few use them.
323
324 The long and short is that there are some relatively simple things that
325 we can do to augment the existing SMTP infrastructure to make it better.
326 We do not /need/ to do a wholesale replacement and incur all the
327 complications ~> technical debt that goes along with such a replacement.
328
329
330
331
332 --
333 Grant. . . .
334 unix || die

Replies