diff --git a/apprise/plugins/NotifyMailgun.py b/apprise/plugins/NotifyMailgun.py index ad0d5f91..b53982f6 100644 --- a/apprise/plugins/NotifyMailgun.py +++ b/apprise/plugins/NotifyMailgun.py @@ -51,7 +51,6 @@ # the email will be transmitted from. If no email address is specified # then it will also become the 'to' address as well. # -import re import requests from .NotifyBase import NotifyBase @@ -60,9 +59,6 @@ from ..utils import parse_list from ..utils import is_email from ..AppriseLocale import gettext_lazy as _ -# Used to validate your personal access apikey -VALIDATE_API_KEY = re.compile(r'^[a-z0-9]{32}-[a-z0-9]{8}-[a-z0-9]{8}$', re.I) - # Provide some known codes Mailgun uses and what they translate to: # Based on https://documentation.mailgun.com/en/latest/api-intro.html#errors MAILGUN_HTTP_ERROR_MAP = { @@ -138,7 +134,6 @@ class NotifyMailgun(NotifyBase): 'apikey': { 'name': _('API Key'), 'type': 'string', - 'regex': (r'[a-z0-9]{32}-[a-z0-9]{8}-[a-z0-9]{8}', 'i'), 'private': True, 'required': True, }, @@ -184,12 +179,6 @@ class NotifyMailgun(NotifyBase): self.logger.warning(msg) raise TypeError(msg) - if not VALIDATE_API_KEY.match(self.apikey): - msg = 'The API Key specified ({}) is invalid.' \ - .format(apikey) - self.logger.warning(msg) - raise TypeError(msg) - # Validate our username if not self.user: msg = 'No username was specified.' diff --git a/test/test_rest_plugins.py b/test/test_rest_plugins.py index 0a99b08c..ff6380a9 100644 --- a/test/test_rest_plugins.py +++ b/test/test_rest_plugins.py @@ -787,10 +787,6 @@ TEST_URLS = ( ('mailgun://user@host', { 'instance': TypeError, }), - # Token specified but it's invalid - ('mailgun://user@host/{}'.format('a' * 12), { - 'instance': TypeError, - }), # Token is valid, but no user name specified ('mailgun://host/{}-{}-{}'.format('a' * 32, 'b' * 8, 'c' * 8), { 'instance': TypeError,