projects
/
stakingWatchdog.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove two useless comments
[stakingWatchdog.git]
/
src
/
main.rs
diff --git
a/src/main.rs
b/src/main.rs
index
43ecb4a
..
08039fb
100644
(file)
--- a/
src/main.rs
+++ b/
src/main.rs
@@
-62,6
+62,7
@@
fn main() -> Result<()> {
match send_email(
"Watchdog: Staking error",
&format!("Error: {}", error),
match send_email(
"Watchdog: Staking error",
&format!("Error: {}", error),
+ &config.smtp_relay_address,
&config.smtp_login,
&config.smtp_password,
) {
&config.smtp_login,
&config.smtp_password,
) {
@@
-245,7
+246,13
@@
fn check_validators(pub_keys: &[String]) -> std::result::Result<(), CheckError>
Ok(())
}
Ok(())
}
-fn send_email(title: &str, body: &str, login: &str, pass: &str) -> Result<()> {
+fn send_email(
+ title: &str,
+ body: &str,
+ smtp_relay_address: &str,
+ login: &str,
+ pass: &str,
+) -> Result<()> {
let email = Message::builder()
.message_id(None)
.from("Staking Watchdog <redmine@d-lan.net>".parse()?)
let email = Message::builder()
.message_id(None)
.from("Staking Watchdog <redmine@d-lan.net>".parse()?)
@@
-256,12
+263,10
@@
fn send_email(title: &str, body: &str, login: &str, pass: &str) -> Result<()> {
let creds = Credentials::new(login.to_string(), pass.to_string());
let creds = Credentials::new(login.to_string(), pass.to_string());
- // Open a remote connection to gmail
- let mailer = SmtpTransport::relay("mail.infomaniak.com")?
+ let mailer = SmtpTransport::relay(smtp_relay_address)?
.credentials(creds)
.build();
.credentials(creds)
.build();
- // Send the email
let response = mailer.send(&email)?;
println!("{:?}", response);
let response = mailer.send(&email)?;
println!("{:?}", response);