This repository has been archived by the owner on Feb 15, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
This commit adds support for sending email notifications using the
same behavioral feature set as Microsoft Teams notifications:
The following settings are configurable:
DNS lookups to confirm that this provided value matches what DNS
has recorded for the sending IP Address
Some known weaknesses/lack of support:
hard-coded email template
enabled
source code constants to on-disk files for easier customization
by the sysadmin(s) supporting this application
unauthenticated connections to SMTP server
based on source IP Address
Behavior worth noting:
information if not specified by the sysadmin
Showmax/go-fqdn
package is used to retrieve the FQDN of thesending system, with a fallback to
CHANGES
The following items note (non-exhaustive) changes since the last
point release. Many of these changes will see further refactoring
as part of GH-22.
Duplicate client/alert request headers so that in-place formatting
modifications performed on values in the slice do not spill over to
the values used for email notifications (where a different
formatting is used)
Replace placeholder "getter" methods with full-featured equivalents
to existing MS Teams methods
Add new "getter" methods to cover new functionality
Add flags, environment variables to cover new functionality
Rename existing generically named functions used for Teams
notification handling to explicitly mention relation to Teams
notifications
functionality
Rework some existing Teams-specific functions to allow use with
Teams and email notifications (DRY)
Add email-specific functions, methods, types to mirror existing
Microsoft Teams notifications support
Replace placeholder email notification template with a "default",
mostly text-only friendly format and a Textile formatted template to
be used with older Redmine systems (prior to Markdown support being
introduced)
MessageTrailer
func updated to take a template string forgeneration of a format-specific branding string
Update config Stringer interface
rethink how it is handled
TOML configuration file
Documentation
delay
configuration
REFERENCES
fixes Feature: Add support for email notifications when disabling user #3
https://golangcode.com/validate-an-email-address/
https://github.com/Showmax/go-fqdn