mirror of https://github.com/caronc/apprise
comcast.net email template added (#1059)
parent
30ebc30236
commit
010be0bfda
|
@ -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
|
# Catch All
|
||||||
(
|
(
|
||||||
'Custom',
|
'Custom',
|
||||||
|
|
|
@ -1143,6 +1143,34 @@ def test_plugin_email_url_parsing(mock_smtp, mock_smtp_ssl):
|
||||||
mock_smtp_ssl.reset_mock()
|
mock_smtp_ssl.reset_mock()
|
||||||
response.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(
|
results = NotifyEmail.parse_url(
|
||||||
'mailtos://user:pass123@live.com')
|
'mailtos://user:pass123@live.com')
|
||||||
obj = Apprise.instantiate(results, suppress_exceptions=False)
|
obj = Apprise.instantiate(results, suppress_exceptions=False)
|
||||||
|
|
Loading…
Reference in New Issue