From da35891c63f07db6b847d2ce16b26cf65472b969 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Wed, 18 May 2022 13:41:44 +0200 Subject: [PATCH] Fixing class MailConfiguration in module pp_admintools.mail_config --- lib/pp_admintools/mail_config.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/pp_admintools/mail_config.py b/lib/pp_admintools/mail_config.py index 563f5c7..3754b49 100644 --- a/lib/pp_admintools/mail_config.py +++ b/lib/pp_admintools/mail_config.py @@ -34,12 +34,13 @@ from . import MAX_PORT_NUMBER, DEFAULT_CONFIG_DIR from .xlate import XLATOR -__version__ = '0.1.9' +__version__ = '0.1.10' LOG = logging.getLogger(__name__) _ = XLATOR.gettext VALID_MAIL_METHODS = ('smtp', 'sendmail') +DEFAULT_DOMAIN = 'pixelpark.com' # ============================================================================= @@ -68,10 +69,13 @@ class MailConfiguration(BaseMultiConfig): default_mail_server = 'localhost' default_smtp_port = 25 + default_domain = socket.getfqdn() + if not default_domain: + default_domain = DEFAULT_DOMAIN 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_mail_from = MailAddress(user=current_user_name, domain=default_domain) default_mail_from_complete = '{n} <{m}>'.format(n=current_user_gecos, m=default_mail_from) valid_mail_methods = VALID_MAIL_METHODS -- 2.39.5