From: Frank Brehm Date: Wed, 18 May 2022 11:41:44 +0000 (+0200) Subject: Fixing class MailConfiguration in module pp_admintools.mail_config X-Git-Tag: 0.4.2^2~5^2~7 X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=da35891c63f07db6b847d2ce16b26cf65472b969;p=pixelpark%2Fpp-admin-tools.git Fixing class MailConfiguration in module pp_admintools.mail_config --- 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