BREAKING CHANGE:
- The `hello_name`, `from_email`, `smtp_timeout`, `retries` and `proxy` settings have been moved to inside the new `verif_method` field, which is now the centralized place to configure how each email is verified (categorized by email provider).
BREAKING CHANGE:
- In `/v0/check_email` endpoint, the `hotmail_verif_method` field has been replaced two fields: `hotmailb2b_verif_method` and `hotmailb2c_verif_method`
- All serializations of `"Smtp","Api","Headless"` have been converted to lowercase `"smtp","api","headless"`
BREAKING CHANGE:
We switched to a more commonly-used builder pattern to create an input:
```diff
- let mut input = CheckEmailInput::new("someone@gmail.com");
- input.set_from_email("me@mycompany.com");
+ let input = CheckEmailInputBuilder::default()
+ .to_email("someone@gmail.com")
+ .from_email("me@mycompany.com")
+ .build()
+ .unwrap();
let res = check_email(input, &config).await;
```
BREAKING CHANGE:
The main function, `check_email()`, now takes a second argument called `ReacherConfig`. This struct contains configuration such as the webdriver address to listen to for headless email verifications, or an optional Sentry configuration to send error reports to. Previously, these configurations were passed through poorly-documented environment variables; now we make them explicit. When migration, you can pass `ReacherConfig::default()` which returns sensible default values.
BREAKING CHANGE: For Hotmail, Gmail and Yahoo addresses, the `*_use_api` and `*_use_headless` parameters have been removed and replaced with a `*VerifyMethod`, an enum which can take value Api, Headless or Smtp. If using headless, pass a webdriver address to env variable RCH_WEBDRIVER_ADDR.
BREAKING CHANGE: `input.hotmail_use_headless` is now a bool instead of a string. Pass the webdriver address as an environment variable `RCH_WEBDRIVER_ADDR` now.
* feat: add Outlook HTTP API validation
- check the validity of Outlook/Office 365 email addresses via the
method outlined
[here](https://www.trustedsec.com/blog/achieving-passive-user-enumeration-with-onedrive/).
- run only via the `--outlook-use-api` flags (defaulting to `false`.)
relates #937
* fix: restrict Office 365 domain
use `.mail.protection.outlook.com.` for domains backed by Outlook/Office
365.
* fix: continue for non-definitive responses from Outlook API
if using `--outlook-use-api`, only return immediately in the event of a
positive response: negative responses are ambiguous and the process
should fall back to subsequent checks.
* fix: amend Outlook references
update references to "Microsoft 365" to make is more explicit that this
pertains to the underlying services, not Outlook addresses.
* fix: continue in the event of a ReqwestError
allow both failures in the HTTP request and 404 responses to continue.
Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
* feat: additional Gmail validation
- check the validity of `gmail.com`/`googlemail.com` email addresses via
the method outlined
[here](https://blog.0day.rocks/abusing-gmail-to-get-previously-unlisted-e-mail-addresses-41544b62b2).
- run only via the `--gmail-use-api`/`gmail_use_api` flags (defaulting
to `false`.)
relates #937
* refactor: split out HTTP client
move the `create_client` method to a separate file; have the `yahoo` and
`gmail` modules reference this.
* test: add test for Gmail HTTP API
verify Gmail HTTP API behaviour with `someone@gmail.com`, failure
indicating that the API is no longer reliable.
* fix: correct host checks for Gmail HTTP API
should check as per the MX host:
- for gmail.com or googlemail.com, this will look like
`*.gmail-smtp-in.l.google.com.`.
- for Google Apps/Workspace domains, this will look like
`*.aspmx.l.google.com.`.
Co-authored-by: PsypherPunk <psypherpunk+github@gmail.com>
BREAKING CHANGE:
The library's main function `check_email`'s argument `CheckEmailInput` nows takes a single `to_email` field, instead of a `to_emails: Vec<String>`
```diff
pub struct CheckEmailInput {
- pub to_emails: Vec<String>,
+ pub to_email: String,
// --snip--
}
```
This effectively makes the public API more similar to the v0.7.* series. I'm still thinking about how to best verify multiple emails in one SMTP connection, but it most likely will be a new function with a different API. Follow [issue #65](https://github.com/reacherhq/check-if-email-exists/issues/65) for more info.