From 1bc576387e328705965e2d14743968b8d08ff9b1 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Mon, 14 Feb 2022 20:09:05 -0800 Subject: [PATCH] email: Minor indentation and docstring changes Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/email/__init__.py | 4 +++- plinth/modules/email/audit/domain.py | 4 ++-- plinth/modules/email/audit/ldap.py | 6 ++++-- .../email/data/etc/dovecot/conf.d/05-freedombox-auth.conf | 3 +-- .../email/data/etc/dovecot/conf.d/05-freedombox-mail.conf | 3 +-- .../email/data/etc/dovecot/conf.d/15-freedombox-mail.conf | 3 +-- .../email/data/etc/dovecot/conf.d/90-freedombox-lmtp.conf | 3 +-- .../data/etc/dovecot/conf.d/90-freedombox-mailboxes.conf | 3 +-- .../email/data/etc/dovecot/conf.d/90-freedombox-master.conf | 3 +-- .../email/data/etc/dovecot/conf.d/90-freedombox-tls.conf | 3 +-- .../email/data/etc/dovecot/conf.d/95-freedombox-sieve.conf | 3 +-- .../data/etc/dovecot/freedombox-sieve-after/sort-spam.sieve | 2 ++ plinth/modules/email/data/etc/postfix/freedombox-aliases.cf | 3 +-- .../data/etc/rspamd/local.d/freedombox-milter-headers.conf | 2 +- .../email/data/etc/rspamd/local.d/freedombox-redis.conf | 2 +- plinth/modules/email/manifest.py | 1 + 16 files changed, 23 insertions(+), 25 deletions(-) diff --git a/plinth/modules/email/__init__.py b/plinth/modules/email/__init__.py index edff5b891..9627cbc3e 100644 --- a/plinth/modules/email/__init__.py +++ b/plinth/modules/email/__init__.py @@ -1,5 +1,7 @@ -"""FreedomBox email server app""" # SPDX-License-Identifier: AGPL-3.0-or-later +""" +FreedomBox app to manage an email server. +""" import logging diff --git a/plinth/modules/email/audit/domain.py b/plinth/modules/email/audit/domain.py index a6fd767f3..94ae99bb1 100644 --- a/plinth/modules/email/audit/domain.py +++ b/plinth/modules/email/audit/domain.py @@ -23,7 +23,7 @@ def get_domains(): def set_domains(primary_domain=None): - """Set the primary domain and all the domains for postfix. """ + """Set the primary domain and all the domains for postfix.""" all_domains = DomainName.list_names() if not primary_domain: primary_domain = get_domains()['primary_domain'] @@ -36,7 +36,7 @@ def set_domains(primary_domain=None): def action_set_domains(primary_domain, all_domains): - """Set the primary domain and all the domains for postfix. """ + """Set the primary domain and all the domains for postfix.""" all_domains = [_clean_domain(domain) for domain in all_domains.split(',')] primary_domain = _clean_domain(primary_domain) diff --git a/plinth/modules/email/audit/ldap.py b/plinth/modules/email/audit/ldap.py index e86ed2b82..c8cec360d 100644 --- a/plinth/modules/email/audit/ldap.py +++ b/plinth/modules/email/audit/ldap.py @@ -1,6 +1,8 @@ -"""Provides the diagnosis of SASL, mail submission, and user database lookup -configurations""" # SPDX-License-Identifier: AGPL-3.0-or-later +""" +Configure postfix to use auth and local delivery with dovecot. Start smtps and +submission services. Setup aliases database. +""" import plinth.modules.email.aliases as aliases import plinth.modules.email.postconf as postconf diff --git a/plinth/modules/email/data/etc/dovecot/conf.d/05-freedombox-auth.conf b/plinth/modules/email/data/etc/dovecot/conf.d/05-freedombox-auth.conf index bd33cde76..6b5c9f746 100644 --- a/plinth/modules/email/data/etc/dovecot/conf.d/05-freedombox-auth.conf +++ b/plinth/modules/email/data/etc/dovecot/conf.d/05-freedombox-auth.conf @@ -1,5 +1,4 @@ -# Direct edits to this file will be lost! -# Manage your settings on FreedomBox +# Do not edit this file. Manage your settings on FreedomBox. # Outlook and Windows Mail works only with LOGIN mechanism, not the standard # PLAIN: diff --git a/plinth/modules/email/data/etc/dovecot/conf.d/05-freedombox-mail.conf b/plinth/modules/email/data/etc/dovecot/conf.d/05-freedombox-mail.conf index 743b69318..4a7326415 100644 --- a/plinth/modules/email/data/etc/dovecot/conf.d/05-freedombox-mail.conf +++ b/plinth/modules/email/data/etc/dovecot/conf.d/05-freedombox-mail.conf @@ -1,5 +1,4 @@ -# Direct edits to this file will be lost! -# Manage your settings on FreedomBox +# Do not edit this file. Manage your settings on FreedomBox. # Users in FreedomBox are not expected to access mail by logging into the # system. Storing the mail in single location instead of home directories and diff --git a/plinth/modules/email/data/etc/dovecot/conf.d/15-freedombox-mail.conf b/plinth/modules/email/data/etc/dovecot/conf.d/15-freedombox-mail.conf index 44bad2b93..d318d4e9f 100644 --- a/plinth/modules/email/data/etc/dovecot/conf.d/15-freedombox-mail.conf +++ b/plinth/modules/email/data/etc/dovecot/conf.d/15-freedombox-mail.conf @@ -1,5 +1,4 @@ -# Direct edits to this file will be lost! -# Manage your settings on FreedomBox +# Do not edit this file. Manage your settings on FreedomBox. # Use sdbox, a format specific to dovecot, for storing mails. The format allows # better performance with some IMAP queries. When this is combined with Full diff --git a/plinth/modules/email/data/etc/dovecot/conf.d/90-freedombox-lmtp.conf b/plinth/modules/email/data/etc/dovecot/conf.d/90-freedombox-lmtp.conf index 33979e116..87985dfd3 100644 --- a/plinth/modules/email/data/etc/dovecot/conf.d/90-freedombox-lmtp.conf +++ b/plinth/modules/email/data/etc/dovecot/conf.d/90-freedombox-lmtp.conf @@ -1,5 +1,4 @@ -# Direct edits to this file will be lost! -# Manage your settings on FreedomBox +# Do not edit this file. Manage your settings on FreedomBox. protocol lmtp { mail_plugins = $mail_plugins sieve diff --git a/plinth/modules/email/data/etc/dovecot/conf.d/90-freedombox-mailboxes.conf b/plinth/modules/email/data/etc/dovecot/conf.d/90-freedombox-mailboxes.conf index 209d932b5..0d7635162 100644 --- a/plinth/modules/email/data/etc/dovecot/conf.d/90-freedombox-mailboxes.conf +++ b/plinth/modules/email/data/etc/dovecot/conf.d/90-freedombox-mailboxes.conf @@ -1,5 +1,4 @@ -# Direct edits to this file will be lost! -# Manage your settings on FreedomBox +# Do not edit this file. Manage your settings on FreedomBox. # Mark various mailboxes with special use flags (RFC 6154). Various names used # in mail clients for mailboxes: https://www.imapwiki.org/SpecialUse diff --git a/plinth/modules/email/data/etc/dovecot/conf.d/90-freedombox-master.conf b/plinth/modules/email/data/etc/dovecot/conf.d/90-freedombox-master.conf index 162ee0f68..0318bd281 100644 --- a/plinth/modules/email/data/etc/dovecot/conf.d/90-freedombox-master.conf +++ b/plinth/modules/email/data/etc/dovecot/conf.d/90-freedombox-master.conf @@ -1,5 +1,4 @@ -# Direct edits to this file will be lost! -# Manage your settings on FreedomBox +# Do not edit this file. Manage your settings on FreedomBox. service auth { unix_listener /var/spool/postfix/private/auth { diff --git a/plinth/modules/email/data/etc/dovecot/conf.d/90-freedombox-tls.conf b/plinth/modules/email/data/etc/dovecot/conf.d/90-freedombox-tls.conf index 8734fe4a2..1688123c0 100644 --- a/plinth/modules/email/data/etc/dovecot/conf.d/90-freedombox-tls.conf +++ b/plinth/modules/email/data/etc/dovecot/conf.d/90-freedombox-tls.conf @@ -1,5 +1,4 @@ -# Direct edits to this file will be lost! -# Manage your settings on FreedomBox +# Do not edit this file. Manage your settings on FreedomBox. # Mozilla Guideline v5.6, Dovecot 2.3.9, OpenSSL 1.1.1d, intermediate # Generated 2021-08 diff --git a/plinth/modules/email/data/etc/dovecot/conf.d/95-freedombox-sieve.conf b/plinth/modules/email/data/etc/dovecot/conf.d/95-freedombox-sieve.conf index 352475064..a16a18857 100644 --- a/plinth/modules/email/data/etc/dovecot/conf.d/95-freedombox-sieve.conf +++ b/plinth/modules/email/data/etc/dovecot/conf.d/95-freedombox-sieve.conf @@ -1,5 +1,4 @@ -# Direct edits to this file will be lost! -# Manage your settings on FreedomBox +# Do not edit this file. Manage your settings on FreedomBox. plugin { sieve_after = /etc/dovecot/freedombox-sieve-after diff --git a/plinth/modules/email/data/etc/dovecot/freedombox-sieve-after/sort-spam.sieve b/plinth/modules/email/data/etc/dovecot/freedombox-sieve-after/sort-spam.sieve index a20a0f326..7a07f1c61 100644 --- a/plinth/modules/email/data/etc/dovecot/freedombox-sieve-after/sort-spam.sieve +++ b/plinth/modules/email/data/etc/dovecot/freedombox-sieve-after/sort-spam.sieve @@ -1,3 +1,5 @@ +# Do not edit this file. Manage your settings on FreedomBox. + require ["fileinto", "mailbox"]; if header :is "X-Spam" "Yes" { diff --git a/plinth/modules/email/data/etc/postfix/freedombox-aliases.cf b/plinth/modules/email/data/etc/postfix/freedombox-aliases.cf index c6de827e5..a9102cf90 100644 --- a/plinth/modules/email/data/etc/postfix/freedombox-aliases.cf +++ b/plinth/modules/email/data/etc/postfix/freedombox-aliases.cf @@ -1,5 +1,4 @@ -# SPDX-License-Identifier: AGPL-3.0-or-later +# Do not edit this file. Manage your settings on FreedomBox. -# Maintained by FreedomBox, do not edit. dbpath = /var/lib/postfix/freedombox-aliases/aliases.sqlite3 query = SELECT value FROM alias WHERE name='%s' AND status=1 diff --git a/plinth/modules/email/data/etc/rspamd/local.d/freedombox-milter-headers.conf b/plinth/modules/email/data/etc/rspamd/local.d/freedombox-milter-headers.conf index 371e68824..00110abaf 100644 --- a/plinth/modules/email/data/etc/rspamd/local.d/freedombox-milter-headers.conf +++ b/plinth/modules/email/data/etc/rspamd/local.d/freedombox-milter-headers.conf @@ -1,4 +1,4 @@ -# The file is managed by FreedomBox. Do not to edit. +# Do not edit this file. Manage your settings on FreedomBox. use = ["authentication-results", "x-spam-level", "x-spam-status", "x-spamd-bar", "x-spamd-result"]; diff --git a/plinth/modules/email/data/etc/rspamd/local.d/freedombox-redis.conf b/plinth/modules/email/data/etc/rspamd/local.d/freedombox-redis.conf index b8c0d6168..cf59cfc22 100644 --- a/plinth/modules/email/data/etc/rspamd/local.d/freedombox-redis.conf +++ b/plinth/modules/email/data/etc/rspamd/local.d/freedombox-redis.conf @@ -1,4 +1,4 @@ -# The file is managed by FreedomBox. Do not to edit. +# Do not edit this file. Manage your settings on FreedomBox. servers = "127.0.0.1"; db = "7"; # Use database number 8 not to clash with other clients diff --git a/plinth/modules/email/manifest.py b/plinth/modules/email/manifest.py index 59c38edd4..676a4c2e6 100644 --- a/plinth/modules/email/manifest.py +++ b/plinth/modules/email/manifest.py @@ -1,4 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later + from django.utils.translation import gettext_lazy as _ from plinth.clients import store_url