From: Frank Brehm Date: Wed, 8 Feb 2023 06:42:30 +0000 (+0100) Subject: Fixing class MailConfiguration in module pp_admintools.config.mail X-Git-Tag: 0.8.7^2~1 X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=60c90e9a5d1d8cd2b1b84e4516f861ad97ce20c9;p=pixelpark%2Fpp-admin-tools.git Fixing class MailConfiguration in module pp_admintools.config.mail --- diff --git a/lib/pp_admintools/config/mail.py b/lib/pp_admintools/config/mail.py index b44161a..a373de9 100644 --- a/lib/pp_admintools/config/mail.py +++ b/lib/pp_admintools/config/mail.py @@ -32,7 +32,7 @@ from . import PpConfigurationError, PpBaseConfiguration from ..xlate import XLATOR -__version__ = '0.2.3' +__version__ = '0.2.4' LOG = logging.getLogger(__name__) _ = XLATOR.gettext @@ -122,9 +122,6 @@ class MailConfiguration(PpBaseConfiguration): # ------------------------------------------------------------------------- def eval(self): - self.mail_recipients = [] - self.mail_cc = [] - super(MailConfiguration, self).eval() if not self.mail_recipients: @@ -198,6 +195,8 @@ class MailConfiguration(PpBaseConfiguration): # ------------------------------------------------------------------------- def _eval_mail_rcpt(self, section_name, section): + self.mail_recipients = [] + re_rcpt = re.compile(r'^\s*(mail[_-]?)?(recipients?|rcpt)\s*$', re.IGNORECASE) for key in section.keys(): @@ -215,11 +214,13 @@ class MailConfiguration(PpBaseConfiguration): else: result = self._split_mailaddress_tokens(val, _("recipient mail address")) if result: - self.mail_recipients.expand += result + self.mail_recipients += result # ------------------------------------------------------------------------- def _eval_mail_cc(self, section_name, section): + self.mail_cc = [] + re_cc = re.compile(r'^\s*(mail[_-]?)?cc\s*$', re.IGNORECASE) for key in section.keys(): @@ -235,11 +236,11 @@ class MailConfiguration(PpBaseConfiguration): for v in val: result = self._split_mailaddress_tokens(v, _("cc mail address")) if result: - self.mail_cc.expand += result + self.mail_cc += result else: result = self._split_mailaddress_tokens(val, _("cc mail address")) if result: - self.mail_cc.expand += result + self.mail_cc += result # ------------------------------------------------------------------------- def _eval_mail_reply_to(self, section_name, section):