mirror of
https://github.com/outbackdingo/Mailu.git
synced 2026-01-28 02:19:34 +00:00
added functionality that DNS DMARC entry for report is only shown when needed
This commit is contained in:
@@ -247,6 +247,15 @@ class Domain(Base):
|
||||
ruf = f' ruf=mailto:{ruf}@{domain};' if ruf else ''
|
||||
return f'_dmarc.{self.name}. 600 IN TXT "v=DMARC1; p=reject;{rua}{ruf} adkim=s; aspf=s"'
|
||||
|
||||
@cached_property
|
||||
def dns_dmarc_report_needed(self):
|
||||
""" return true if DMARC report record is needed """
|
||||
domain = app.config['DOMAIN']
|
||||
if self.name != domain:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
@cached_property
|
||||
def dns_dmarc_report(self):
|
||||
""" return DMARC report record for mailu server """
|
||||
@@ -373,6 +382,15 @@ class Alternative(Base):
|
||||
ruf = f' ruf=mailto:{ruf}@{domain};' if ruf else ''
|
||||
return f'_dmarc.{self.name}. 600 IN TXT "v=DMARC1; p=reject;{rua}{ruf} adkim=s; aspf=s"'
|
||||
|
||||
@cached_property
|
||||
def dns_dmarc_report_needed(self):
|
||||
""" return true if DMARC report record is needed """
|
||||
domain = app.config['DOMAIN']
|
||||
if self.name != domain:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
@cached_property
|
||||
def dns_dmarc_report(self):
|
||||
""" return DMARC report record for mailu server """
|
||||
|
||||
@@ -44,7 +44,9 @@
|
||||
<th>{% trans %}DNS DMARC entry{% endtrans %}</th>
|
||||
<td>
|
||||
{{ macros.clip("dns_dmarc") }}<pre id="dns_dmarc" class="pre-config border bg-light">{{ domain.dns_dmarc }}</pre>
|
||||
{%- if domain.dns_dmarc_report_needed %}
|
||||
{{ macros.clip("dns_dmarc_report") }}<pre id="dns_dmarc_report" class="pre-config border bg-light">{{ domain.dns_dmarc_report }}</pre>
|
||||
{%- endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{%- endif %}
|
||||
@@ -89,7 +91,9 @@
|
||||
<th>{% trans %}DNS DMARC entry{% endtrans %}</th>
|
||||
<td>
|
||||
{{ macros.clip("dns_dmarc") }}<pre id="dns_dmarc" class="pre-config border bg-light">{{ alternative.dns_dmarc }}</pre>
|
||||
{%- if alternative.dns_dmarc_report_needed %}
|
||||
{{ macros.clip("dns_dmarc_report") }}<pre id="dns_dmarc_report" class="pre-config border bg-light">{{ alternative.dns_dmarc_report }}</pre>
|
||||
{%- endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{%- endif %}
|
||||
|
||||
Reference in New Issue
Block a user