1
0
mirror of https://github.com/Mailu/Mailu.git synced 2024-12-12 10:45:38 +02:00

Do explicit TLS where possible

This commit is contained in:
Florent Daigniere 2022-03-10 11:49:30 +01:00
parent c817eaf608
commit 2b62a6327a
2 changed files with 15 additions and 4 deletions

View File

@ -255,16 +255,27 @@ class Domain(Base):
""" return list of auto configuration records (RFC6186) """ """ return list of auto configuration records (RFC6186) """
hostname = app.config['HOSTNAME'] hostname = app.config['HOSTNAME']
protocols = [ protocols = [
('submission', 587),
('imap', 143),
('pop3', 110),
('autodiscover', 443), ('autodiscover', 443),
] ]
if app.config['TLS_FLAVOR'] != 'notls': if app.config['TLS_FLAVOR'] != 'notls':
protocols.extend([ protocols.extend([
('submission', 0),
('submissions', 465),
('imap', 0),
('pop3', 0),
('imaps', 993), ('imaps', 993),
('pop3s', 995), ('pop3s', 995),
]) ])
else:
protocols.extend([
('submission', 587),
('submissions', 0),
('imap', 143),
('pop3', 110),
('imaps', 0),
('pop3s', 0),
])
return list([ return list([
f'_{proto}._tcp.{self.name}. 600 IN SRV 1 1 {port} {hostname}.' f'_{proto}._tcp.{self.name}. 600 IN SRV 1 1 {port} {hostname}.'
for proto, port for proto, port

View File

@ -60,7 +60,7 @@
</tr> </tr>
{%- endif %} {%- endif %}
<tr> <tr>
<th>{% trans %}DNS client auto-configuration (RFC6186) entries{% endtrans %}</th> <th>{% trans %}DNS client auto-configuration entries{% endtrans %}</th>
<td>{{ macros.clip("dns_autoconfig") }}<pre id="dns_autoconfig" class="pre-config border bg-light"> <td>{{ macros.clip("dns_autoconfig") }}<pre id="dns_autoconfig" class="pre-config border bg-light">
{%- for line in domain.dns_autoconfig %} {%- for line in domain.dns_autoconfig %}
{{ line }} {{ line }}