diff --git a/admin/mailu/admin/forms.py b/admin/mailu/admin/forms.py
index 9e79eb13..c17128a0 100644
--- a/admin/mailu/admin/forms.py
+++ b/admin/mailu/admin/forms.py
@@ -119,3 +119,11 @@ class FetchForm(flask_wtf.FlaskForm):
username = fields.StringField(_('Username'))
password = fields.StringField(_('Password'))
submit = fields.SubmitField(_('Submit'))
+
+
+class AnnouncementForm(flask_wtf.FlaskForm):
+ announcement_subject = fields.StringField(_('Announcement subject'),
+ [validators.DataRequired()])
+ announcement_body = fields.StringField(_('Announcement body'),
+ [validators.DataRequired()], widget=widgets.TextArea())
+ submit = fields.SubmitField(_('Send'))
diff --git a/admin/mailu/admin/templates/announcement.html b/admin/mailu/admin/templates/announcement.html
new file mode 100644
index 00000000..6d080154
--- /dev/null
+++ b/admin/mailu/admin/templates/announcement.html
@@ -0,0 +1,18 @@
+{% extends "base.html" %}
+
+{% block title %}
+{% trans %}Public announcement{% endtrans %}
+{% endblock %}
+
+{% block subtitle %}
+{% trans %}from{% endtrans %} {{ from_address }}
+{% endblock %}
+
+{% block box_content %}
+
+{% endblock %}
diff --git a/admin/mailu/admin/templates/sidebar.html b/admin/mailu/admin/templates/sidebar.html
index 9b27e3cf..bd7c0439 100644
--- a/admin/mailu/admin/templates/sidebar.html
+++ b/admin/mailu/admin/templates/sidebar.html
@@ -40,6 +40,11 @@
{% trans %}Services status{% endtrans %}
+
+
+ {% trans %}Announcement{% endtrans %}
+
+
{% trans %}Administrators{% endtrans %}
diff --git a/admin/mailu/admin/views/base.py b/admin/mailu/admin/views/base.py
index 5ae87bed..eb629179 100644
--- a/admin/mailu/admin/views/base.py
+++ b/admin/mailu/admin/views/base.py
@@ -1,8 +1,11 @@
-from mailu import dockercli
+from mailu import dockercli, app as flask_app
from mailu.admin import app, db, models, forms, access
import flask
import flask_login
+import smtplib
+
+from email.mime import text
@app.route('/', methods=["GET"])
@@ -39,3 +42,25 @@ def services():
except Exception as error:
return flask.render_template('docker-error.html', error=error)
return flask.render_template('services.html', containers=containers)
+
+
+@app.route('/announcement', methods=['GET', 'POST'])
+@access.global_admin
+def announcement():
+ from_address = '{}@{}'.format(
+ flask_app.config['POSTMASTER'], flask_app.config['DOMAIN'])
+ form = forms.AnnouncementForm()
+ if form.validate_on_submit():
+ with smtplib.SMTP('smtp') as smtp:
+ for recipient in [user.email for user in models.User.query.all()]:
+ msg = text.MIMEText(form.announcement_body.data)
+ msg['Subject'] = form.announcement_subject.data
+ msg['From'] = from_address
+ msg['To'] = recipient
+ smtp.sendmail(from_address, [recipient], msg.as_string())
+ # Force-empty the form
+ form.announcement_subject.data = ''
+ form.announcement_body.data = ''
+ flask.flash('Your announcement was sent', 'success')
+ return flask.render_template('announcement.html', form=form,
+ from_address=from_address)
diff --git a/admin/mailu/translations/de/LC_MESSAGES/messages.po b/admin/mailu/translations/de/LC_MESSAGES/messages.po
index 6b45c7ea..06bbec48 100644
--- a/admin/mailu/translations/de/LC_MESSAGES/messages.po
+++ b/admin/mailu/translations/de/LC_MESSAGES/messages.po
@@ -7,17 +7,16 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: stefan.auditor@erdfisch.de\n"
-"POT-Creation-Date: 2016-11-09 19:59+0100\n"
+"POT-Creation-Date: 2016-11-10 10:47+0100\n"
"PO-Revision-Date: 2016-11-09 21:43+0100\n"
+"Last-Translator: Stefan Auditor \n"
+"Language: de\n"
"Language-Team: Mailu German Team \n"
+"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.3.4\n"
-"X-Generator: Poedit 1.8.11\n"
-"Last-Translator: Stefan Auditor \n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"Language: de\n"
#: mailu/admin/forms.py:32
msgid "Invalid email address."
@@ -173,6 +172,26 @@ msgstr "TLS aktivieren"
msgid "Username"
msgstr "Benutzername"
+#: mailu/admin/forms.py:125
+msgid "Announcement subject"
+msgstr ""
+
+#: mailu/admin/forms.py:127
+msgid "Announcement body"
+msgstr ""
+
+#: mailu/admin/forms.py:129
+msgid "Send"
+msgstr ""
+
+#: mailu/admin/templates/announcement.html:4
+msgid "Public announcement"
+msgstr ""
+
+#: mailu/admin/templates/announcement.html:8
+msgid "from"
+msgstr ""
+
#: mailu/admin/templates/confirm.html:4
msgid "Confirm action"
msgstr "Aktion bestätigen"
@@ -188,7 +207,9 @@ msgstr "Docker Fehler"
#: mailu/admin/templates/docker-error.html:12
msgid "An error occurred while talking to the Docker server."
-msgstr "Während der Kommunikation mit dem Docker Server ist ein Fehler ist aufgetreten."
+msgstr ""
+"Während der Kommunikation mit dem Docker Server ist ein Fehler ist "
+"aufgetreten."
#: mailu/admin/templates/login.html:6
msgid "Your account"
@@ -257,14 +278,18 @@ msgid "Administration"
msgstr "Administration"
#: mailu/admin/templates/sidebar.html:45
+msgid "Announcement"
+msgstr ""
+
+#: mailu/admin/templates/sidebar.html:50
msgid "Administrators"
msgstr "Administratoren"
-#: mailu/admin/templates/sidebar.html:52
+#: mailu/admin/templates/sidebar.html:57
msgid "Mail domains"
msgstr "E-Mail-Domains"
-#: mailu/admin/templates/sidebar.html:59
+#: mailu/admin/templates/sidebar.html:64
msgid "Help"
msgstr "Hilfe"
@@ -440,3 +465,4 @@ msgstr "Manager Liste"
#: mailu/admin/templates/manager/list.html:12
msgid "Add manager"
msgstr "Manager hinzufügen"
+
diff --git a/admin/mailu/translations/en/LC_MESSAGES/messages.po b/admin/mailu/translations/en/LC_MESSAGES/messages.po
index 8d635306..7aaf7e03 100644
--- a/admin/mailu/translations/en/LC_MESSAGES/messages.po
+++ b/admin/mailu/translations/en/LC_MESSAGES/messages.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2016-10-29 13:37+0200\n"
+"POT-Creation-Date: 2016-11-10 10:47+0100\n"
"PO-Revision-Date: 2016-10-02 15:02+0200\n"
"Last-Translator: FULL NAME \n"
"Language: en\n"
@@ -172,6 +172,26 @@ msgstr ""
msgid "Username"
msgstr ""
+#: mailu/admin/forms.py:125
+msgid "Announcement subject"
+msgstr ""
+
+#: mailu/admin/forms.py:127
+msgid "Announcement body"
+msgstr ""
+
+#: mailu/admin/forms.py:129
+msgid "Send"
+msgstr ""
+
+#: mailu/admin/templates/announcement.html:4
+msgid "Public announcement"
+msgstr ""
+
+#: mailu/admin/templates/announcement.html:8
+msgid "from"
+msgstr ""
+
#: mailu/admin/templates/confirm.html:4
msgid "Confirm action"
msgstr ""
@@ -256,14 +276,18 @@ msgid "Administration"
msgstr ""
#: mailu/admin/templates/sidebar.html:45
+msgid "Announcement"
+msgstr ""
+
+#: mailu/admin/templates/sidebar.html:50
msgid "Administrators"
msgstr ""
-#: mailu/admin/templates/sidebar.html:52
+#: mailu/admin/templates/sidebar.html:57
msgid "Mail domains"
msgstr ""
-#: mailu/admin/templates/sidebar.html:59
+#: mailu/admin/templates/sidebar.html:64
msgid "Help"
msgstr ""
diff --git a/admin/mailu/translations/fr/LC_MESSAGES/messages.po b/admin/mailu/translations/fr/LC_MESSAGES/messages.po
index 0f8e8f71..178fcdf9 100644
--- a/admin/mailu/translations/fr/LC_MESSAGES/messages.po
+++ b/admin/mailu/translations/fr/LC_MESSAGES/messages.po
@@ -1,11 +1,18 @@
+
msgid ""
msgstr ""
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: POEditor.com\n"
-"Project-Id-Version: Mailu\n"
+"Project-Id-Version: Mailu\n"
+"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
+"POT-Creation-Date: 2016-11-10 10:47+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME \n"
"Language: fr\n"
+"Language-Team: fr \n"
+"Plural-Forms: nplurals=2; plural=(n > 1)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 2.3.4\n"
#: mailu/admin/forms.py:32
msgid "Invalid email address."
@@ -161,11 +168,32 @@ msgstr "Activer TLS"
msgid "Username"
msgstr "Nom d'utilisateur"
+#: mailu/admin/forms.py:125
+msgid "Announcement subject"
+msgstr ""
+
+#: mailu/admin/forms.py:127
+msgid "Announcement body"
+msgstr ""
+
+#: mailu/admin/forms.py:129
+msgid "Send"
+msgstr ""
+
+#: mailu/admin/templates/announcement.html:4
+msgid "Public announcement"
+msgstr ""
+
+#: mailu/admin/templates/announcement.html:8
+msgid "from"
+msgstr ""
+
#: mailu/admin/templates/confirm.html:4
msgid "Confirm action"
msgstr "Confirmer"
#: mailu/admin/templates/confirm.html:12
+#, python-format
msgid "You are about to %(action)s. Please confirm your action."
msgstr "Vous allez %(action)s. Merci de confirmer votre action."
@@ -244,14 +272,18 @@ msgid "Administration"
msgstr "Administration"
#: mailu/admin/templates/sidebar.html:45
+msgid "Announcement"
+msgstr ""
+
+#: mailu/admin/templates/sidebar.html:50
msgid "Administrators"
msgstr "Administrateurs"
-#: mailu/admin/templates/sidebar.html:52
+#: mailu/admin/templates/sidebar.html:57
msgid "Mail domains"
msgstr "Domaines"
-#: mailu/admin/templates/sidebar.html:59
+#: mailu/admin/templates/sidebar.html:64
msgid "Help"
msgstr "Aide"