From 010be0bfda731dcf1449ed4814242d5de94ccb9f Mon Sep 17 00:00:00 2001
From: Chris Caron <lead2gold@gmail.com>
Date: Tue, 20 Feb 2024 20:41:47 -0500
Subject: [PATCH] comcast.net email template added (#1059)

---
 apprise/plugins/NotifyEmail.py | 15 +++++++++++++++
 test/test_plugin_email.py      | 28 ++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)

diff --git a/apprise/plugins/NotifyEmail.py b/apprise/plugins/NotifyEmail.py
index 5ca42200..3883d236 100644
--- a/apprise/plugins/NotifyEmail.py
+++ b/apprise/plugins/NotifyEmail.py
@@ -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',
diff --git a/test/test_plugin_email.py b/test/test_plugin_email.py
index e7185141..99ec8fe3 100644
--- a/test/test_plugin_email.py
+++ b/test/test_plugin_email.py
@@ -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)