|
|
|
@ -24,7 +24,12 @@ class MailService:
|
|
|
|
|
raise Exception('Invalid SMTP URL: %s' % smtp_url) |
|
|
|
|
self.smtps = match.group('scheme') == 'smtps' |
|
|
|
|
self.host = match.group('host') |
|
|
|
|
self.port = int(match.group('port') or 25) |
|
|
|
|
if match.group('port') is not None: |
|
|
|
|
self.port = int(match.group('port')) |
|
|
|
|
elif self.smtps: |
|
|
|
|
self.port = 465 |
|
|
|
|
else: |
|
|
|
|
self.port = 25 |
|
|
|
|
self.starttls = cfg.get('mail_smtp_starttls') |
|
|
|
|
assert not (self.smtps and self.starttls) |
|
|
|
|
self.base_domain = cfg.get('base_domain') |
|
|
|
|