mirror of
https://github.com/caronc/apprise.git
synced 2025-01-19 12:28:43 +01:00
Improved Hotmail/Outlook email support (#638)
This commit is contained in:
parent
d88bc9e287
commit
7f7f6863c9
@ -111,7 +111,7 @@ EMAIL_TEMPLATES = (
|
|||||||
'Microsoft Hotmail',
|
'Microsoft Hotmail',
|
||||||
re.compile(
|
re.compile(
|
||||||
r'^((?P<label>[^+]+)\+)?(?P<id>[^@]+)@'
|
r'^((?P<label>[^+]+)\+)?(?P<id>[^@]+)@'
|
||||||
r'(?P<domain>(hotmail|live)\.com)$', re.I),
|
r'(?P<domain>(outlook|hotmail|live)\.com(\.au)?)$', re.I),
|
||||||
{
|
{
|
||||||
'port': 587,
|
'port': 587,
|
||||||
'smtp_host': 'smtp-mail.outlook.com',
|
'smtp_host': 'smtp-mail.outlook.com',
|
||||||
|
@ -382,7 +382,7 @@ def test_plugin_email(mock_smtp, mock_smtpssl):
|
|||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
# Handle our exception
|
# Handle our exception
|
||||||
if(instance is None):
|
if instance is None:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
if not isinstance(e, instance):
|
if not isinstance(e, instance):
|
||||||
@ -835,3 +835,31 @@ def test_plugin_email_url_parsing(mock_smtp, mock_smtp_ssl):
|
|||||||
# Test that our template over-ride worked
|
# Test that our template over-ride worked
|
||||||
assert 'mode=ssl' in obj.url()
|
assert 'mode=ssl' in obj.url()
|
||||||
assert 'smtp=override.com' in obj.url()
|
assert 'smtp=override.com' in obj.url()
|
||||||
|
|
||||||
|
mock_smtp.reset_mock()
|
||||||
|
response.reset_mock()
|
||||||
|
|
||||||
|
#
|
||||||
|
# Test outlook/hotmail lookups
|
||||||
|
#
|
||||||
|
results = plugins.NotifyEmail.parse_url(
|
||||||
|
'mailtos://user:pass123@outlook.com')
|
||||||
|
obj = Apprise.instantiate(results, suppress_exceptions=False)
|
||||||
|
assert isinstance(obj, plugins.NotifyEmail) is True
|
||||||
|
assert obj.smtp_host == 'smtp-mail.outlook.com'
|
||||||
|
|
||||||
|
results = plugins.NotifyEmail.parse_url(
|
||||||
|
'mailtos://user:pass123@outlook.com.au')
|
||||||
|
obj = Apprise.instantiate(results, suppress_exceptions=False)
|
||||||
|
assert isinstance(obj, plugins.NotifyEmail) is True
|
||||||
|
assert obj.smtp_host == 'smtp-mail.outlook.com'
|
||||||
|
|
||||||
|
results = plugins.NotifyEmail.parse_url(
|
||||||
|
'mailtos://user:pass123@live.com')
|
||||||
|
obj = Apprise.instantiate(results, suppress_exceptions=False)
|
||||||
|
assert isinstance(obj, plugins.NotifyEmail) is True
|
||||||
|
|
||||||
|
results = plugins.NotifyEmail.parse_url(
|
||||||
|
'mailtos://user:pass123@hotmail.com')
|
||||||
|
obj = Apprise.instantiate(results, suppress_exceptions=False)
|
||||||
|
assert isinstance(obj, plugins.NotifyEmail) is True
|
||||||
|
@ -109,7 +109,7 @@ def test_plugin_windows_mocked():
|
|||||||
#
|
#
|
||||||
for mod in list(sys.modules.keys()):
|
for mod in list(sys.modules.keys()):
|
||||||
if mod.startswith('apprise.'):
|
if mod.startswith('apprise.'):
|
||||||
del(sys.modules[mod])
|
del sys.modules[mod]
|
||||||
reload(apprise)
|
reload(apprise)
|
||||||
|
|
||||||
# Create our instance
|
# Create our instance
|
||||||
|
Loading…
Reference in New Issue
Block a user