]> Frank Brehm's Git Trees - pixelpark/pp-admin-tools.git/commitdiff
Fixing class MailConfiguration in module pp_admintools.config.mail
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 8 Feb 2023 06:42:30 +0000 (07:42 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 8 Feb 2023 06:42:30 +0000 (07:42 +0100)
lib/pp_admintools/config/mail.py

index b44161a7ac793ab8ebb3f33440a60be32b25a434..a373de93ffa5a44303a85f28404cdc460dee2db7 100644 (file)
@@ -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):