From 2954d8479008e2205cf59958ae073b05051180cc Mon Sep 17 00:00:00 2001 From: TheLegend875 Date: Sun, 30 Dec 2018 20:29:41 +0100 Subject: [PATCH 1/2] added necessary ui elements --- core/admin/mailu/ui/forms.py | 1 + core/admin/mailu/ui/templates/user/create.html | 1 + core/admin/mailu/ui/templates/user/settings.html | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/core/admin/mailu/ui/forms.py b/core/admin/mailu/ui/forms.py index 40a56a82..e021cd60 100644 --- a/core/admin/mailu/ui/forms.py +++ b/core/admin/mailu/ui/forms.py @@ -81,6 +81,7 @@ class UserForm(flask_wtf.FlaskForm): quota_bytes = fields_.IntegerSliderField(_('Quota'), default=1000000000) enable_imap = fields.BooleanField(_('Allow IMAP access'), default=True) enable_pop = fields.BooleanField(_('Allow POP3 access'), default=True) + displayed_name = fields.StringField(_('Displayed name')) comment = fields.StringField(_('Comment')) enabled = fields.BooleanField(_('Enabled'), default=True) submit = fields.SubmitField(_('Save')) diff --git a/core/admin/mailu/ui/templates/user/create.html b/core/admin/mailu/ui/templates/user/create.html index 09e83155..ed7b9884 100644 --- a/core/admin/mailu/ui/templates/user/create.html +++ b/core/admin/mailu/ui/templates/user/create.html @@ -15,6 +15,7 @@ {% call macros.box(_("General")) %} {{ macros.form_field(form.localpart, append='@'+domain.name+'') }} {{ macros.form_fields((form.pw, form.pw2)) }} + {{ macros.form_field(form.displayed_name) }} {{ macros.form_field(form.comment) }} {{ macros.form_field(form.enabled) }} {% endcall %} diff --git a/core/admin/mailu/ui/templates/user/settings.html b/core/admin/mailu/ui/templates/user/settings.html index e14d2d70..b6ade695 100644 --- a/core/admin/mailu/ui/templates/user/settings.html +++ b/core/admin/mailu/ui/templates/user/settings.html @@ -11,6 +11,10 @@ {% block content %}
{{ form.hidden_tag() }} + + {% call macros.box(title=_("Displayed name")) %} + {{ macros.form_field(form.displayed_name) }} + {% endcall %} {% call macros.box(title=_("Antispam")) %} {{ macros.form_field(form.spam_enabled) }} From 999d2a9557ad2cb46cb5672ec4223dbda3945399 Mon Sep 17 00:00:00 2001 From: TheLegend875 Date: Sun, 30 Dec 2018 21:44:38 +0100 Subject: [PATCH 2/2] changed default.sieve to send displayed name --- core/admin/mailu/internal/templates/default.sieve | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/admin/mailu/internal/templates/default.sieve b/core/admin/mailu/internal/templates/default.sieve index d771ee99..5e995611 100644 --- a/core/admin/mailu/internal/templates/default.sieve +++ b/core/admin/mailu/internal/templates/default.sieve @@ -33,5 +33,5 @@ if exists "X-Virus" { } {% if user.reply_active %} -vacation :days 1 :subject "{{ user.reply_subject }}" "{{ user.reply_body }}"; +vacation :days 1 {% if user.displayed_name != "" %}:from "{{ user.displayed_name }} <{{ user.email }}>"{% endif %} :subject "{{ user.reply_subject }}" "{{ user.reply_body }}"; {% endif %}