Skip to content

Commit

Permalink
feat: Add proxy field in SmtpDebug
Browse files Browse the repository at this point in the history
  • Loading branch information
amaury1093 committed Sep 16, 2024
1 parent 49f3939 commit 2f60a03
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions core/src/smtp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ pub struct SmtpConnection {
pub host: String,
/// The port we connected to via SMTP.
pub port: u16,
/// Whether we used a proxy for the SMTP connection.
pub used_proxy: bool,
}

#[derive(Debug, Default, Deserialize, PartialEq, Serialize)]
Expand Down Expand Up @@ -193,7 +195,11 @@ pub async fn check_smtp(
(
check_smtp_with_retry(to_email, &host, port, domain, input, input.retries).await,
SmtpDebug {
verif_method: VerifMethod::Smtp(SmtpConnection { host, port }),
verif_method: VerifMethod::Smtp(SmtpConnection {
host,
port,
used_proxy: input.proxy.is_some(),
}),
},
)
}
Expand Down Expand Up @@ -222,7 +228,8 @@ mod tests {
smtp_debug.verif_method,
super::VerifMethod::Smtp(SmtpConnection {
host: host.to_string(),
port: 25
port: 25,
used_proxy: input.proxy.is_some(),
})
);
match res {
Expand Down

0 comments on commit 2f60a03

Please sign in to comment.