Commit Graph

93 Commits

Author SHA1 Message Date
László Károlyi 69be4f4b9c
Release 1.0.7, fixes #95 2022-06-30 00:40:10 +02:00
László Károlyi e8646ffe6c
Prepare a new release with new options 2022-06-28 19:13:04 +02:00
László Károlyi 667760f723
Don't use a lockfile when the blacklist update is disabled 2021-12-07 12:19:54 +01:00
László Károlyi 91fb131abf
Fixes #85, optional skipping of the autoupdate 2021-12-06 17:59:55 +01:00
László Károlyi a248d9ad19
Migrating to gitea part 1 2021-11-16 23:38:37 +01:00
László Károlyi 85ecd1a600
Fix isort 2021-09-15 18:35:51 +02:00
László Károlyi 2067a54984
Closes #79, handle recovery from an `SSLError`, make use of `SSLContext` 2021-09-15 18:12:19 +02:00
László Károlyi b9ab3b9d39
Update the renamed disposable-email-domains repo address 2021-08-23 16:53:25 +02:00
Alessio Parma b6bc0ca47d ambigious --> ambiguous
Also added a missing "is" into a log message.
2021-07-24 11:07:38 +02:00
Reinhard Müller dbd0c1285d Small formatting and doc tweaks 2021-03-14 13:24:24 +01:00
Reinhard Müller da540d8db2 Clean up parameter list, update docs
See also discussion at
https://github.com/karolyi/py3-validate-email/discussions/57
2021-03-12 01:06:13 +01:00
Reinhard Müller 1b9b0682cd Improve emulation of true SMTP process
* Check the SMTP servers in order of priority instead of random order.
* Handle SMTPServerDisconnected like a 451 status as recommended by RFC
  5321.
* Exit early by directly raising CommunicationError on the first 5xx
  SMTPResponseException.

See also the discussion at
https://github.com/karolyi/py3-validate-email/discussions/61
2021-03-11 16:09:09 +01:00
Reinhard Müller bcbadbab65 Split mx_check into dns_check and smtp_check
This will allow us to cleanly and consistently keep the four
verification steps separate: format (regex) - blacklist - dns - smtp.
2021-03-02 18:30:13 +01:00
Reinhard Müller a0f1cd1b04 Improve logging options
Issue our own log messages independently of the "debug" parameter, so a
user can activate our log messages through Python's standard logger
config features, while still having dsabled smtplib's debug messages,
which are very verbose and always go to stderr.

Change the log output for failed and ambiguous verifications from
"warning" to "info" as this is a normal function of the library and not
something that would require attention. Also this makes sure that no log
output is generated if logging is not configured at all (default is to
only display warning and above).
2021-03-02 17:43:03 +01:00
László Károlyi 5e84348d9b
Fix tests 2021-03-01 17:43:52 +01:00
László Károlyi 1999e1d433
Simplifying code 2021-03-01 17:15:58 +01:00
László Károlyi 5a27711397
Overhauling response handling 2021-03-01 11:37:48 +01:00
László Károlyi 903925afc9
Code cleanup, tests follow 2021-02-28 15:02:16 +01:00
Reinhard Müller ef15fa994a Restructure SMTP check code 2021-02-23 21:28:13 +01:00
Reinhard Müller 59172783ce Fix indentation 2021-02-22 15:18:49 +01:00
Reinhard Müller 9d662a2f23 Improve SMTP check error handling
* Improve exception class hierarchy
* Raise exception on malformatted "from_address" parameter instead of
  yielding a negative verification result
* Add option to raise exceptions on ambiguous results
* Improve exception parameters to allow for a more structured analysis
  of the negative response
* Yield a negative verification result upon the first permanent error on
  RCPT TO, just like a mail server would also bounce after the first
  permanent error
2021-02-22 14:32:56 +01:00
Reinhard Müller 41a14e17b9 Work around a bug in smtp lib
Fixes #50
2021-02-15 15:26:38 +01:00
László Károlyi 8439d94742
Fix tests, prepare a new release 2021-02-11 17:49:29 +01:00
László Károlyi 81f5769ac8
Merge pull request #49 from gearheartio/feature/add-no_smtp_argument
Add no_smtp argument that allows us to validate only mx records witho…
2021-02-11 16:54:08 +01:00
László Károlyi a691f359bb
Simplify code on DNS name resolving 2021-02-11 15:10:31 +01:00
Sergey Shevchenko 607ae44ce8
Move no_smtp argumeent to the end of arguments list 2021-02-11 17:48:41 +04:00
Sergey Shevchenko fea879a809
Add no_smtp argument that allows us to validate only mx records without SMTP request 2021-02-11 17:41:21 +04:00
László Károlyi c92bd0c5c0
Fix flake8 chimping out 2021-02-11 12:41:06 +01:00
László Károlyi e3653934a5
Prepare a new release, closes #46 2021-02-11 11:55:09 +01:00
Reinhard Müller 4ca02d4072 Fix typo 2021-02-10 17:52:10 +01:00
Reinhard Müller b2cef9c8c2 Remove unused variable 2021-02-10 17:09:12 +01:00
Reinhard Müller 294c4e7174 Improve error reporting
* Unify error message format, always include SMTP status code
* Use "with SMTP" to properly close connection even in case of error
* Establish connection after setting debug level so this is debugged as
  well
* Properly handle SMTP error status codes on connection
* Don't return ambigious SMTP status codes, as they are not used anyway
2021-02-09 23:37:07 +01:00
László Károlyi 0b2b1ba738
Fix #45, bump version 2021-02-08 14:19:59 +01:00
László Károlyi f6f46f90b6
Fixing yahoo errors, TLS hostnames must be without terminating dot 2020-11-26 16:22:18 +01:00
László Károlyi 43a3a08499
Fix tests 2020-11-19 15:20:39 +01:00
László Károlyi d3ec33f878
Make logging less intrusive 2020-11-19 14:26:52 +01:00
László Károlyi 35efbb7cd9
Updating to 0.2.10, see CHANGELOG.txt 2020-10-11 13:54:32 +02:00
László Károlyi 31b4dff3b8
Adding debug parameter + preparing release 2020-06-09 12:34:51 +02:00
László Károlyi 8e0bb18cd0
Fixes a windows error mentioned in #16 2020-04-17 15:54:50 +02:00
László Károlyi 20bf35ead8
Releasing 0.2.7 2020-04-14 12:27:50 +02:00
László Károlyi 0dd9910eb2
Merge pull request #15 from reinhard-mueller/master
Increase consistency at handling domain literals
2020-04-14 12:25:01 +02:00
Reinhard Müller 182f793def Clean up initial blacklist download on install
Two essential changes were made to the process of initially downloading
the blacklist at install time, allowing the removal of a number of hacks
and workarounds:

1. Download the files *after* populating the build directory instead of
*before*. Thus, the files don't have to be included in MANIFEST.in, and
following from that, `setup.py sdist` needn't be tricked into not
including them in the source distribution.

2. Only import the updater module instead of the full validate_email
package, so `setup.py install` and friends don't depend on all the
requirements of the library.
2020-04-14 12:16:36 +02:00
Reinhard Müller a18b9690e6 Increase consistency at handling domain literals 2020-04-14 10:45:30 +02:00
László Károlyi 96a6939b6c
Add test for testing datadir not in sdist 2020-04-13 21:58:24 +02:00
Reinhard Müller d7666bd6ad Introduce EmailAddress class
This unifies the tasks of splitting an email address into user and
domain parts as well as converting an international domain name into the
ASCII-compatible encoding (ACE).
2020-04-13 09:44:50 +02:00
László Károlyi 3c035aac9c
Remove LIB_PATH_DEFAULT creation, closes #13 2020-04-12 14:33:13 +02:00
László Károlyi 3c39f5e114
Use userid in the temp path 2020-04-11 23:40:39 +02:00
László Károlyi e1bcdb92e7
Fix installation + travis 2020-04-11 23:32:02 +02:00
László Károlyi 6790ded356
Locking blacklist while reading, make it consistent amongst multiprocesses 2020-04-11 21:59:49 +02:00
László Károlyi dfd1d68c40
Replace MethodType to Callable 2020-04-11 17:54:34 +02:00