From 9720f0fee986a9ee719e7c6e09db61f0b46c93de Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Tue, 6 Sep 2022 09:41:13 +0200 Subject: [PATCH] Fixing module pp_admintools.config --- lib/pp_admintools/config/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/pp_admintools/config/__init__.py b/lib/pp_admintools/config/__init__.py index b8556b6..fc925ff 100644 --- a/lib/pp_admintools/config/__init__.py +++ b/lib/pp_admintools/config/__init__.py @@ -29,7 +29,7 @@ from ..errors import PpError from ..xlate import XLATOR CONFIG_DIR = 'pixelpark' -__version__ = '0.1.3' +__version__ = '0.1.4' LOG = logging.getLogger(__name__) VALID_MAIL_METHODS = ('smtp', 'sendmail') @@ -62,7 +62,11 @@ class PpBaseConfiguration(BaseMultiConfig): current_user_name = pwd.getpwuid(os.getuid()).pw_name current_user_gecos = pwd.getpwuid(os.getuid()).pw_gecos - default_mail_from = MailAddress(user=current_user_name, domain=socket.getfqdn()) + default_domain = socket.getfqdn() + if not MailAddress.re_valid_domain.search(default_domain): + default_domain = 'pixelpark.com' + + default_mail_from = MailAddress(user=current_user_name, domain=default_domain) # ------------------------------------------------------------------------- def __init__( -- 2.39.5