]> Frank Brehm's Git Trees - pixelpark/pp-admin-tools.git/commitdiff
Fixing module pp_admintools.config
authorFrank Brehm <frank.brehm@pixelpark.com>
Tue, 6 Sep 2022 07:41:13 +0000 (09:41 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Tue, 6 Sep 2022 07:41:13 +0000 (09:41 +0200)
lib/pp_admintools/config/__init__.py

index b8556b67a1152ad0034ffb9bc5071835a73fdb95..fc925ff4fd54aa1e40cf873e51ca8740c748ada0 100644 (file)
@@ -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__(