details: https://code.tryton.org/tryton/commit/4b7edc0b4b00
branch: default
user: Cédric Krier <[email protected]>
date: Thu Apr 23 09:19:13 2026 +0200
description:
Add check deliverability option to validate email tool
diffstat:
trytond/CHANGELOG | 1 +
trytond/doc/ref/tools/email.rst | 4 ++--
trytond/trytond/tools/email_.py | 6 +++---
3 files changed, 6 insertions(+), 5 deletions(-)
diffs (47 lines):
diff -r 6978c46c77b9 -r 4b7edc0b4b00 trytond/CHANGELOG
--- a/trytond/CHANGELOG Sun Apr 19 13:11:06 2026 +0200
+++ b/trytond/CHANGELOG Thu Apr 23 09:19:13 2026 +0200
@@ -1,3 +1,4 @@
+* Add check deliverability option to validate email tool
* Add support for AGE to SQLite backend
* Add button to mark notification as read
diff -r 6978c46c77b9 -r 4b7edc0b4b00 trytond/doc/ref/tools/email.rst
--- a/trytond/doc/ref/tools/email.rst Sun Apr 19 13:11:06 2026 +0200
+++ b/trytond/doc/ref/tools/email.rst Thu Apr 23 09:19:13 2026 +0200
@@ -17,9 +17,9 @@
Return a string suitable for an :rfc:`2822` ``From``, ``To`` or ``Cc``
header.
-.. function:: validate_email(email)
+.. function:: validate_email(email[, check_deliverability])
- Validate the email address.
+ Validate the email address and check deliverability.
.. function:: normalize_email(email)
diff -r 6978c46c77b9 -r 4b7edc0b4b00 trytond/trytond/tools/email_.py
--- a/trytond/trytond/tools/email_.py Sun Apr 19 13:11:06 2026 +0200
+++ b/trytond/trytond/tools/email_.py Thu Apr 23 09:19:13 2026 +0200
@@ -49,9 +49,9 @@
else:
raise
- def validate_email(email):
+ def validate_email(email, check_deliverability=True):
emailinfo = _validate_email(
- email, check_deliverability=True,
+ email, check_deliverability=check_deliverability,
dns_resolver=resolver,
test_environment=Pool.test)
return emailinfo.normalized
@@ -76,7 +76,7 @@
except ImportError:
- def validate_email(email):
+ def validate_email(email, check_deliverability=True):
return email
def normalize_email(email):