Compare commits

...

4 Commits

Author SHA1 Message Date
Amaury
da1324332a
fix: docs 2025-04-29 12:58:16 +02:00
Amaury
c8120fb300
chore: Move docker compose to rabbitmq/ 2025-04-29 12:47:46 +02:00
Amaury
d67cd21001
chore: 0.11.5 2025-04-29 12:45:49 +02:00
Amaury
aed8d1c136
feat: Add optional timeout on proxy 2025-04-29 12:41:41 +02:00
12 changed files with 22 additions and 33 deletions

8
Cargo.lock generated
View File

@ -601,7 +601,7 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
[[package]]
name = "check-if-email-exists"
version = "0.11.4"
version = "0.11.5"
dependencies = [
"anyhow",
"async-recursion",
@ -633,7 +633,7 @@ dependencies = [
[[package]]
name = "check-if-email-exists-cli"
version = "0.11.4"
version = "0.11.5"
dependencies = [
"anyhow",
"check-if-email-exists",
@ -3062,7 +3062,7 @@ dependencies = [
[[package]]
name = "reacher_backend"
version = "0.11.4"
version = "0.11.5"
dependencies = [
"anyhow",
"async-smtp",
@ -3095,7 +3095,7 @@ dependencies = [
[[package]]
name = "reacher_sqs"
version = "0.11.4"
version = "0.11.5"
dependencies = [
"check-if-email-exists",
"lambda_runtime",

View File

@ -1,6 +1,6 @@
[package]
name = "reacher_backend"
version = "0.11.4"
version = "0.11.5"
edition = "2018"
license = "AGPL-3.0"
publish = false

View File

@ -62,12 +62,14 @@ webdriver_addr = "http://localhost:9515"
# - RCH__PROXY__PORT
# - RCH__PROXY__USERNAME
# - RCH__PROXY__PASSWORD
# - RCH__PROXY__TIMEOUT_MS
#
# [proxy]
# host = "my.proxy.com"
# port = 1080
# username = "my-username"
# password = "my-password"
# timeout_ms = 30000
[webdriver]
# Path to the Chrome binary. If not set, the default system Chrome will be used.
@ -75,28 +77,6 @@ webdriver_addr = "http://localhost:9515"
# Env variable: RCH__WEBDRIVER__BINARY
# binary = "/usr/bin/google-chrome"
# Deprecated: use the "proxies" configuration below instead.
#
# Uncomment the lines below to define a proxy called "default". If you want to
# use a proxy, you can set the `proxy` field in the `verif_method` section
# below to "default". Not setting it will NOT apply this default proxy to
# verifications though.
#
# The username and password are optional and only needed if the proxy requires
# authentication.
#
# Env variables:
# - RCH__PROXY__HOST
# - RCH__PROXY__PORT
# - RCH__PROXY__USERNAME
# - RCH__PROXY__PASSWORD
#
# [proxy]
# host = "my.proxy.com"
# port = 1080
# username = "my-username"
# password = "my-password"
# Override verification method to use for each email provider. Each email provider can
# be verified using one of the following methods:
# - Gmail: smtp

View File

@ -1,6 +1,6 @@
[package]
name = "check-if-email-exists-cli"
version = "0.11.4"
version = "0.11.5"
default-run = "check_if_email_exists"
edition = "2018"
description = "Check if an email address exists without sending any email."

View File

@ -84,6 +84,7 @@ async fn main() -> Result<(), anyhow::Error> {
port: CONF.proxy_port,
username: CONF.proxy_username.clone(),
password: CONF.proxy_password.clone(),
timeout_ms: None,
});
let verif_method = VerifMethod::new_with_same_config_for_all(
proxy,

View File

@ -1,6 +1,6 @@
[package]
name = "check-if-email-exists"
version = "0.11.4"
version = "0.11.5"
authors = ["Amaury <amaury@reacher.email>"]
categories = ["email"]
description = "Check if an email address exists without sending any email"

View File

@ -49,7 +49,8 @@
//! host: "my-proxy.io".to_string(), // Use a SOCKS5 proxy to verify the email
//! port: 1080,
//! username: None, // You can also set it non-empty
//! password: None
//! password: None,
//! timeout_ms: None,
//! });
//! let verif_method = VerifMethod {
//! proxies,

View File

@ -74,6 +74,11 @@ async fn connect_to_smtp_host(
let stream: BufStream<Box<dyn AsyncReadWrite>> = match &verif_method.proxy {
Some(proxy) => {
let mut config = Config::default();
if let Some(timeout_ms) = proxy.timeout_ms {
config.set_connect_timeout(timeout_ms / 1000);
}
let socks_stream =
if let (Some(username), Some(password)) = (&proxy.username, &proxy.password) {
Socks5Stream::connect_with_password(
@ -82,7 +87,7 @@ async fn connect_to_smtp_host(
verif_method.config.smtp_port,
username.clone(),
password.clone(),
Config::default(),
config,
)
.await?
} else {
@ -90,7 +95,7 @@ async fn connect_to_smtp_host(
(proxy.host.as_ref(), proxy.port),
clean_host.clone(),
verif_method.config.smtp_port,
Config::default(),
config,
)
.await?
};

View File

@ -102,6 +102,8 @@ pub struct CheckEmailInputProxy {
pub username: Option<String>,
/// Password to pass to proxy authentication.
pub password: Option<String>,
/// The timeout for the connection to the proxy, in ms.
pub timeout_ms: Option<u64>,
}
/// Builder pattern for the input argument into the main `email_exists`

View File

@ -1,6 +1,6 @@
[package]
name = "reacher_sqs"
version = "0.11.4"
version = "0.11.5"
edition = "2018"
license = "AGPL-3.0"
publish = false