mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Also sanitize email address used for testing
This commit is contained in:
parent
da339e639d
commit
e14f96454f
@ -67,8 +67,13 @@ class TestEmail(QDialog):
|
|||||||
t.start()
|
t.start()
|
||||||
|
|
||||||
def run_test(self):
|
def run_test(self):
|
||||||
|
from email.utils import parseaddr
|
||||||
|
addr = parseaddr(self.to.text().strip())[-1]
|
||||||
|
if not addr:
|
||||||
|
tb = f'{self.to.text().strip()} is not a valid email address'
|
||||||
|
else:
|
||||||
try:
|
try:
|
||||||
tb = self.test_func(str(self.to.text())) or _('Email successfully sent')
|
tb = self.test_func(addr) or _('Email successfully sent')
|
||||||
except Exception:
|
except Exception:
|
||||||
import traceback
|
import traceback
|
||||||
tb = traceback.format_exc()
|
tb = traceback.format_exc()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user