Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning Message #45

Closed
Whommbat opened this issue Apr 25, 2024 · 2 comments
Closed

Warning Message #45

Whommbat opened this issue Apr 25, 2024 · 2 comments

Comments

@Whommbat
Copy link

Whommbat commented Apr 25, 2024

I tried fixing the code on my side, but wasn't able to resolve it.

"message_warning"
The Warning email is getting sent FROM the proper address, but it's being sent to the same address instead of the TO.

The final "message" is being sent correctly.

@storopoli
Copy link
Owner

That is what the warning is supposed to do right?

You have two participants:

  • Dest: the one who will get the message if you do not check-in.
  • You: the one who will send the message.

The workflow is like this:

graph LR;
A[Did not checked-in] --> B[Emits a Warning to You] --> C[Sends the message if not checked-in];

This is further explained in the README.md:

Dead Man's Switch comprises of two timers:

  1. Warning Timer: This timer is set to the timer_warning (seconds) value
    in the config.toml file.
    If the user do not check-in before timer reaches 0,
    it will send a warning email to the users' own specified email address,
    the from in the config.toml.
  2. Dead Man's Timer: After the warning timer expires, the timer will change
    to a Dead Man's timer, and the timer will be set to the timer_dead_man (seconds).
    If the user do not check-in before timer reaches 0,
    it will send the final email to the specified email address in the config.toml,
    i.e. the to in the config.toml.

The idea of the warning is to have a last chance to stop the dead man switch activation.

If you somehow want to have the the Warning message sent to the Dest participant and not to You,
then you can change this line here:

Email::Warning => Address::from_str(&self.from)?,

to

            Email::Warning => Address::from_str(&self.to)?,

Closing this issue, but feel free to reopen.

@storopoli storopoli closed this as not planned Won't fix, can't repro, duplicate, stale Apr 25, 2024
@Whommbat
Copy link
Author

Understood, thank you for that explanation. I just have to change my workflow as I have an SMTP server running so in case anything happens I don't have to rely on 3rd party smtp. So, I rarely check that email. It's only used for me to send the mail out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants