mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
email_server: Drop some unused code
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
747a5f120f
commit
9a2d66c62f
@ -53,7 +53,6 @@ default_smtps_options = {
|
||||
'smtpd_relay_restrictions': 'permit_sasl_authenticated,reject'
|
||||
}
|
||||
|
||||
MAILSRV_DIR = '/var/lib/plinth/mailsrv'
|
||||
SQLITE_ALIASES = 'sqlite:/etc/postfix/freedombox-aliases.cf'
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@ -144,16 +143,3 @@ def action_set_ulookup():
|
||||
"""Handles email_server -i ldap set_ulookup"""
|
||||
with postconf.mutex.lock_all():
|
||||
fix_alias_maps(check_alias_maps())
|
||||
|
||||
|
||||
def list_find(lst, element, start=None, end=None):
|
||||
if start is None:
|
||||
start = 0
|
||||
if end is None:
|
||||
end = len(lst)
|
||||
if start < 0 or end < 0:
|
||||
return -1
|
||||
try:
|
||||
return lst.index(element, start, end)
|
||||
except ValueError:
|
||||
return -1
|
||||
|
||||
@ -6,26 +6,12 @@ import re
|
||||
|
||||
from django import forms
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.core.validators import RegexValidator
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from plinth.modules.names.components import DomainName
|
||||
|
||||
from . import aliases as aliases_module
|
||||
|
||||
domain_validator = RegexValidator(r'^[A-Za-z0-9-\.]+$',
|
||||
_('Enter a valid domain'))
|
||||
destination_validator = RegexValidator(
|
||||
r'^[ -~]+$', # ASCII chars from 32 to 126
|
||||
_('Enter a valid destination'))
|
||||
|
||||
|
||||
class EmailServerForm(forms.Form):
|
||||
domain = forms.CharField(label=_('domain'), max_length=256)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
|
||||
def _get_domain_choices():
|
||||
"""Double domain entries for inclusion in the choice field."""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user