comcast.net email template added (#1059)

This commit is contained in:
Chris Caron 2024-02-20 20:41:47 -05:00 committed by GitHub
parent 30ebc30236
commit 010be0bfda
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 43 additions and 0 deletions

View File

@ -295,6 +295,21 @@ EMAIL_TEMPLATES = (
},
),
# Comcast.net
(
'Comcast.net',
re.compile(
r'^((?P<label>[^+]+)\+)?(?P<id>[^@]+)@'
r'(?P<domain>(comcast)\.net)$', re.I),
{
'port': 465,
'smtp_host': 'smtp.comcast.net',
'secure': True,
'secure_mode': SecureMailMode.SSL,
'login_type': (WebBaseLogin.EMAIL, )
},
),
# Catch All
(
'Custom',

View File

@ -1143,6 +1143,34 @@ def test_plugin_email_url_parsing(mock_smtp, mock_smtp_ssl):
mock_smtp_ssl.reset_mock()
response.reset_mock()
results = NotifyEmail.parse_url(
'mailto://user:pass@comcast.net')
obj = Apprise.instantiate(results, suppress_exceptions=False)
assert isinstance(obj, NotifyEmail) is True
assert obj.smtp_host == 'smtp.comcast.net'
assert obj.user == 'user@comcast.net'
assert obj.password == 'pass'
assert obj.secure_mode == 'ssl'
assert obj.port == 465
assert mock_smtp.call_count == 0
assert mock_smtp_ssl.call_count == 0
assert response.starttls.call_count == 0
assert obj.notify("test") is True
assert mock_smtp.call_count == 0
assert mock_smtp_ssl.call_count == 1
assert response.starttls.call_count == 0
assert response.login.call_count == 1
assert response.sendmail.call_count == 1
user, pw = response.login.call_args[0]
assert pw == 'pass'
assert user == 'user@comcast.net'
mock_smtp.reset_mock()
mock_smtp_ssl.reset_mock()
response.reset_mock()
results = NotifyEmail.parse_url(
'mailtos://user:pass123@live.com')
obj = Apprise.instantiate(results, suppress_exceptions=False)