Skip to content

Commit

Permalink
Update CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
amaury1093 committed Oct 25, 2023
1 parent 97182aa commit 5595083
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 33 deletions.
42 changes: 25 additions & 17 deletions backend/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,25 @@
"enum": ["invalid", "unknown", "safe", "risky"],
"description": "An enum to describe how confident we are that the recipient address is real: `safe`, `risky`, `invalid` and `unknown`. Check our FAQ to know the meanings of the 4 possibilities: https://help.reacher.email/email-attributes-inside-json."
},
"YahooVerifyMethod": {
"type": "string",
"title": "YahooVerifyMethod",
"enum": ["Api", "Headless", "Smtp"],
"description": "An enum to describe how we verify Yahoo emails."
},
"HotmailVerifyMethod": {
"type": "string",
"title": "HotmailVerifyMethod",
"enum": ["Api", "Headless", "Smtp"],
"description": "An enum to describe how we verify Hotmail emails."
},
"GmailVerifyMethod": {
"type": "string",
"title": "GmailVerifyMethod",
"enum": ["Api", "Smtp"],
"description": "An enum to describe how we verify Gmail emails.",
"x-internal": false
},
"CheckEmailInput": {
"title": "CheckEmailInput",
"type": "object",
Expand All @@ -330,30 +349,19 @@
"type": "number",
"description": "SMTP port to use for email validation. Generally, ports 25, 465, 587 and 2525 are used."
},
"yahoo_use_api": {
"type": "boolean",
"description": "For Yahoo email addresses, use Yahoo's API instead of connecting directly to their SMTP servers."
"yahoo_verify_method": {
"$ref": "#/components/schemas/YahooVerifyMethod"
},
"yahoo_use_headless": {
"type": "boolean",
"description": "For Yahoo email addresses, use Yahoo's account recovery page instead of connecting directly to their SMTP servers."
},
"gmail_use_api": {
"type": "boolean",
"description": "For Gmail email addresses, use Gmail's API instead of connecting directly to their SMTP servers."
"gmail_verify_method": {
"$ref": "#/components/schemas/GmailVerifyMethod"
},
"microsoft365_use_api": {
"type": "boolean",
"description": "For Microsoft 365 email addresses, use OneDrive's API instead of connecting directly to their SMTP servers."
"hotmail_verify_method": {
"$ref": "#/components/schemas/HotmailVerifyMethod"
},
"check_gravatar": {
"type": "boolean",
"description": "Whether to check if a gravatar image is existing for the given email."
},
"hotmail_use_headless": {
"type": "boolean",
"description": "For Hotmail/Outlook email addresses, use a headless navigator connecting to the password recovery page instead of the SMTP server. This assumes you have a WebDriver compatible process running at the address provided by the environment variable `RCH_WEBDRIVER_ADDR`, usually http://localhost:9515. We recommend running chromedriver (and not geckodriver) as it allows parallel requests."
},
"retries": {
"type": "number",
"default": 2,
Expand Down
28 changes: 18 additions & 10 deletions cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,29 @@ ARGS:

OPTIONS:
--check-gravatar <CHECK_GRAVATAR>
Whether to check for an existing gravatar image [env: CHECK_GRAVATAR=] [default: false]
Whether to check if a gravatar image is existing for the given email [env:
CHECK_GRAVATAR=] [default: false]

--from-email <FROM_EMAIL>
The email to use in the `MAIL FROM:` SMTP command [env: FROM_EMAIL=] [default:
user@example.org]
reacher.email@gmail.com]

--gmail-verify-method <GMAIL_VERIFY_METHOD>
Select how to verify Gmail email addresses: Api or Smtp [env: GMAIL_VERIFY_METHOD=]
[default: Smtp]

-h, --help
Print help information

--haveibeenpwned-api-key <HAVEIBEENPWNED_API_KEY>
HaveIBeenPnwed API key, ignore if not provided [env: HAVEIBEENPWNED_API_KEY=]

--hello-name <HELLO_NAME>
The name to use in the `EHLO:` SMTP command [env: HELLO_NAME=] [default: localhost]
The name to use in the `EHLO:` SMTP command [env: HELLO_NAME=] [default: gmail.com]

--hotmail-verify-method <HOTMAIL_VERIFY_METHOD>
Select how to verify Hotmail email addresses: Api, Headless or Smtp [env:
HOTMAIL_VERIFY_METHOD=] [default: Headless]

--proxy-host <PROXY_HOST>
Use the specified SOCKS5 proxy host to perform email verification [env: PROXY_HOST=]
Expand All @@ -59,13 +71,9 @@ OPTIONS:
-V, --version
Print version information

--yahoo-use-api <YAHOO_USE_API>
For Yahoo email addresses, use Yahoo's API instead of connecting directly to their SMTP
servers [env: YAHOO_USE_API=] [default: true]
--gmail-use-api <GMAIL_USE_API>
For Gmail email addresses, use Gmail's API instead of connecting directly to their SMTP
servers [env: GMAIL_USE_API=] [default: false]
--yahoo-verify-method <YAHOO_VERIFY_METHOD>
Select how to verify Yahoo email addresses: Api, Headless or Smtp [env:
YAHOO_VERIFY_METHOD=] [default: Headless]
```
**💡 PRO TIP:** To show debug logs when running the binary, run:
Expand Down
9 changes: 3 additions & 6 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,15 @@ pub struct Cli {
#[clap(long, env, default_value = "25")]
pub smtp_port: u16,

/// Select how to verify Yahoo email addresses: using Yahoo's API, a
/// headless navigator, or connecting directly to their SMTP servers.
/// Select how to verify Yahoo email addresses: Api, Headless or Smtp.
#[clap(long, env, default_value = "Headless", parse(try_from_str))]
pub yahoo_verify_method: YahooVerifyMethod,

/// Select how to verify Gmail email addresses: using Yahoo's API, or
/// connecting directly to their SMTP servers.
/// Select how to verify Gmail email addresses: Api or Smtp.
#[clap(long, env, default_value = "Smtp", parse(try_from_str))]
pub gmail_verify_method: GmailVerifyMethod,

/// Select how to verify Hotmail email addresses: using Yahoo's API, a
/// headless navigator, or connecting directly to their SMTP servers.
/// Select how to verify Hotmail email addresses: Api, Headless or Smtp.
#[clap(long, env, default_value = "Headless", parse(try_from_str))]
pub hotmail_verify_method: HotmailVerifyMethod,

Expand Down

0 comments on commit 5595083

Please sign in to comment.