Display domain SPF and DMARC example entries, fixes #15

master
Pierre Jaury 9 years ago
parent 1c132fe92e
commit 2fa8b879db

@ -17,6 +17,9 @@ default_config = {
'SQLALCHEMY_TRACK_MODIFICATIONS': False, 'SQLALCHEMY_TRACK_MODIFICATIONS': False,
'SECRET_KEY': 'changeMe', 'SECRET_KEY': 'changeMe',
'DOCKER_SOCKET': 'unix:///var/run/docker.sock', 'DOCKER_SOCKET': 'unix:///var/run/docker.sock',
'HOSTNAME': 'mail.freeposte.io',
'DOMAIN': 'freeposte.io',
'POSTMASTER': 'postmaster',
'DEBUG': False 'DEBUG': False
} }

@ -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() %} {% for domain in current_user.get_managed_domains() %}
<tr> <tr>
<td> <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>&nbsp;
{% if current_user.global_admin %}
<a href="{{ url_for('.domain_edit', domain_name=domain.name) }}" title="Edit"><i class="fa fa-pencil"></i></a>&nbsp;
<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>&nbsp; <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>&nbsp;
{% endif %}
</td> </td>
<td> <td>
<a href="{{ url_for('.user_list', domain_name=domain.name) }}" title="Users"><i class="fa fa-envelope-o"></i></a>&nbsp; <a href="{{ url_for('.user_list', domain_name=domain.name) }}" title="Users"><i class="fa fa-envelope-o"></i></a>&nbsp;

@ -1,4 +1,5 @@
from freeposte.admin import app, db, models, forms, utils from freeposte.admin import app, db, models, forms, utils
from freeposte import app as flask_app
from flask.ext import login as flask_login from flask.ext import login as flask_login
import os import os
@ -55,3 +56,10 @@ def domain_delete(domain_name):
db.session.commit() db.session.commit()
flask.flash('Domain %s deleted' % domain) flask.flash('Domain %s deleted' % domain)
return flask.redirect(flask.url_for('.domain_list')) 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…
Cancel
Save