Skip to content

Commit cfd3916

Browse files
authored
Merge pull request #322 from itkovian/fix-smtp-connect
Fix smtp settings
2 parents 8abef13 + 874b2f6 commit cfd3916

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

lib/vsc/utils/mail.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,17 @@ def __init__(
8989
mail_options.read_file(mc)
9090

9191
# we can have cases where the host part is actually host:port
92-
_mail_host = mail_options.get("main", "mail_host", fallback=mail_host)
92+
_mail_host = mail_options.get("MAIN", "smtp", fallback=mail_host)
9393
try:
9494
self.mail_host, _mail_port = _mail_host.split(":")
9595
except ValueError:
9696
self.mail_host = _mail_host
97-
_mail_port = mail_options.get("main", "mail_port", fallback=mail_port)
97+
_mail_port = mail_options.get("MAIN", "mail_port", fallback=mail_port)
9898

9999
self.mail_port = int(_mail_port)
100-
self.smtp_auth_user = mail_options.get("main", "smtp_auth_user", fallback=smtp_auth_user)
101-
self.smtp_auth_password = mail_options.get("main", "smtp_auth_password", fallback=smtp_auth_password)
102-
self.smtp_use_starttls = mail_options.get("main", "smtp_use_starttls", fallback=smtp_use_starttls)
100+
self.smtp_auth_user = mail_options.get("MAIN", "smtp_auth_user", fallback=smtp_auth_user)
101+
self.smtp_auth_password = mail_options.get("MAIN", "smtp_auth_password", fallback=smtp_auth_password)
102+
self.smtp_use_starttls = mail_options.get("MAIN", "smtp_use_starttls", fallback=smtp_use_starttls)
103103

104104

105105
def _connect(self):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
]
4545

4646
PACKAGE = {
47-
'version': '3.4.1',
47+
'version': '3.4.2',
4848
'author': [sdw, jt, ag, kh],
4949
'maintainer': [sdw, jt, ag, kh],
5050
# as long as 1.0.0 is not out, vsc-base should still provide vsc.fancylogger

test/data/mailconfig.ini

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
[main]
2-
mail_host = config_host
3-
mail_port = 789
1+
[MAIN]
2+
smtp = config_host:789
43
smtp_auth_user = config_user
54
smtp_auth_password = config_passwd
65
smtp_use_starttls = 1

0 commit comments

Comments
 (0)