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

added SMTP monitor #5489

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

added SMTP monitor #5489

wants to merge 7 commits into from

Conversation

koehn
Copy link

@koehn koehn commented Jan 1, 2025

Tick the checkbox if you understand [x]:

  • I have read and understand the pull request rules.

Description

Add SMTP monitor

This allows users to monitor SMTP/SMTPS servers. They can optionally verify STARTTLS settings, or for SMTPS, they can just verify the TLS.

Type of change

Please delete any options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Checklist

  • My code follows the style guidelines of this project
  • I ran ESLint and other linters for modified files
  • I have performed a self-review of my own code and tested it
  • I have commented my code, particularly in hard-to-understand areas (including JSDoc for methods)
  • My changes generates no new warnings
  • My code needed automated testing. I have added them (this is optional task)

Screenshots (if any)

Screenshot 2025-01-01 at 3 02 00 PM

@ShadowGaming100

This comment was marked as spam.

Copy link
Collaborator

@CommanderStorm CommanderStorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a reasonable start.
I have left two comments, but mostly this needs better hinting in the frontend what this monior does and what it does not monitor.

Comment on lines 8 to 30
/**
* @param {*} smtpSecurity the user's SMTP security setting
* @returns {boolean} True if this should test SMTPS
*/
isSMTPS(smtpSecurity) {
return smtpSecurity === "secure";
}

/**
* @param {*} smtpSecurity the user's SMTP security setting
* @returns {boolean} True if this should not attempt STARTTLS, even if it is available
*/
isIgnoreTLS(smtpSecurity) {
return smtpSecurity === "nostarttls";
}

/**
* @param {*} smtpSecurity the user's SMTP security setting
* @returns {boolean} True if this should always test STARTTLS
*/
isRequireTLS(smtpSecurity) {
return smtpSecurity === "starttls";
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please inline all of these. Pulling a function from this is harder to read than nessesary

@@ -329,6 +332,15 @@
</select>
</div>

<div v-if="monitor.type === 'smtp'" class="my-3">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a helptext what this monitor actually does.
People will infer that this is sending mails otherwise..

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ve pushed the changes based upon what I saw elsewhere in the file; let me know if they weren’t correct.

Copy link
Collaborator

@CommanderStorm CommanderStorm Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is not what I meant.
I meant specifying as a helptext what kind of check the selected option does.

What does Ignore STARTTLS actually check?
It does not send a mail as I would expect => please specify in the helptext that it just tries to connect.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Thanks for clarifying.

I’ll describe them here, and also add them to the codebase:

  • Ignore STARTTLS simply connects, says HELO and looks for a correct response
  • Use STARTTLS connects, saysHELO, looks for STARTTLS in the response, issues the command, and verifies the certificate
  • SMTPS connects over TLS, verifies the certificate, says HELO and looks for a correct response

Details are here. Update to the code coming shortly.

@CommanderStorm CommanderStorm added the pr:please address review comments this PR needs a bit more work to be mergable label Jan 24, 2025
@koehn koehn requested a review from CommanderStorm January 24, 2025 18:14
@CommanderStorm CommanderStorm added the area:monitor Everything related to monitors label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:monitor Everything related to monitors pr:please address review comments this PR needs a bit more work to be mergable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants