mirror of
https://github.com/Mailu/Mailu.git
synced 2024-12-14 10:53:30 +02:00
Display domain SPF and DMARC example entries, fixes #15
This commit is contained in:
parent
1c132fe92e
commit
2fa8b879db
@ -17,6 +17,9 @@ default_config = {
|
||||
'SQLALCHEMY_TRACK_MODIFICATIONS': False,
|
||||
'SECRET_KEY': 'changeMe',
|
||||
'DOCKER_SOCKET': 'unix:///var/run/docker.sock',
|
||||
'HOSTNAME': 'mail.freeposte.io',
|
||||
'DOMAIN': 'freeposte.io',
|
||||
'POSTMASTER': 'postmaster',
|
||||
'DEBUG': False
|
||||
}
|
||||
|
||||
|
38
admin/freeposte/admin/templates/domain/details.html
Normal file
38
admin/freeposte/admin/templates/domain/details.html
Normal file
@ -0,0 +1,38 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}
|
||||
Domain details
|
||||
{% endblock %}
|
||||
|
||||
{% block subtitle %}
|
||||
{{ domain.name }}
|
||||
{% endblock %}
|
||||
|
||||
{% block main_action %}
|
||||
{% if current_user.global_admin %}
|
||||
<a class="btn btn-primary" href="#">Regenerate keys</a>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block box %}
|
||||
<table class="table table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Domain name</th>
|
||||
<td>{{ domain.name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>DNS MX entry</th>
|
||||
<td><pre>{{ domain.name }}. 600 IN MX 10 {{ config["HOSTNAME"] }}.</pre></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>DNS SPF entry</th>
|
||||
<td><pre>{{ domain.name }}. 600 IN TXT "v=spf1 mx a:{{ config["HOSTNAME"] }} -all"</pre></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>DNS DMARC entry</th>
|
||||
<td><pre>_dmarc.{{ domain.name }}. 600 IN TXT "v=DMARC1; p=reject; rua=mailto:{{ config["POSTMASTER"] }}@{{ config["DOMAIN"] }}; adkim=s; aspf=s"</pre></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
@ -26,8 +26,11 @@ Domain list
|
||||
{% for domain in current_user.get_managed_domains() %}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{ url_for('.domain_edit', domain_name=domain.name) }}" title="Edit"><i class="fa fa-pencil"></i></a>
|
||||
<a href="{{ url_for('.domain_details', domain_name=domain.name) }}" title="Details"><i class="fa fa-list"></i></a>
|
||||
{% if current_user.global_admin %}
|
||||
<a href="{{ url_for('.domain_edit', domain_name=domain.name) }}" title="Edit"><i class="fa fa-pencil"></i></a>
|
||||
<a href="{{ url_for('.domain_delete', domain_name=domain.name) }}" onclick="return confirm('Are you sure?')" title="Delete"><i class="fa fa-trash"></i></a>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ url_for('.user_list', domain_name=domain.name) }}" title="Users"><i class="fa fa-envelope-o"></i></a>
|
||||
|
@ -1,4 +1,5 @@
|
||||
from freeposte.admin import app, db, models, forms, utils
|
||||
from freeposte import app as flask_app
|
||||
from flask.ext import login as flask_login
|
||||
|
||||
import os
|
||||
@ -55,3 +56,10 @@ def domain_delete(domain_name):
|
||||
db.session.commit()
|
||||
flask.flash('Domain %s deleted' % domain)
|
||||
return flask.redirect(flask.url_for('.domain_list'))
|
||||
|
||||
|
||||
@app.route('/domain/details/<domain_name>', methods=['GET'])
|
||||
def domain_details(domain_name):
|
||||
domain = utils.get_domain_admin(domain_name)
|
||||
return flask.render_template('domain/details.html', domain=domain,
|
||||
config=flask_app.config)
|
||||
|
Loading…
Reference in New Issue
Block a user