-
Notifications
You must be signed in to change notification settings - Fork 1
Refactor teamsNotifier, emailNotifier #22
Comments
I threw some effort at this the last day or so, but I ended up throwing away the progress (didn't even create a branch for it). I believe at this point I'll need to research a bit more before I make further attempts at refactoring the code. I have some paper notes to look back at the next time I take a stab at this, but in short, many of the notifier functions that take a fairly large number of arguments should probably be converted to struct types with methods. When values are created from those types, the associated constructor could embed application config details within to drastically cut down on separate values being passed down to later calls. From the review effort I did apply, I saw at least 3 major places this could be done, but I expect there are others. |
SUMMARY This commit adds support for sending email notifications using the same behavioral feature set as Microsoft Teams notifications: - configurable retries and retry delay - configurable rate limit - a separate notification per event - e.g., request received, username disabled, sessions terminated The following settings are configurable: - destination email address(es) - sender address - SMTP server IP/FQDN - SMTP server port - client identity - hostname provided to the SMTP server - as noted elsewhere, some SMTP servers will perform forward/reverse 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 - as of this commit, the template using Textile formatting is enabled - future efforts are intended to move hard-coded templates out of source code constants to on-disk files for easier customization by the sysadmin(s) supporting this application - unauthenticated connections to target SMTP used - the initial use-case is a local relay which restricts connections based on source IP Address - future efforts are intended to provide support for authentication Behavior worth noting: - automatic client identity value generated from available DNS information if not specified by the sysadmin - the `Showmax/go-fqdn` package is used to retrieve the FQDN of the sending system, with a fallback to - email address verification applied using the provided W3C regex - using a guide from golangcode.com 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 - this was needed to make room for email-specific notification 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 for generation of a format-specific branding string - e.g., Textile-formatted repo link or Markdown-formatted repo link - Update config Stringer interface - it is growing quite large at this point, might be time to rethink how it is handled - TOML configuration file - extended with new settings - rename some settings in an effort to better communicate intent REFERENCES - refs GH-3 - https://golangcode.com/validate-an-email-address/ - https://www.w3.org/TR/2016/REC-html51-20161101/sec-forms.html - https://github.com/Showmax/go-fqdn
SUMMARY This commit adds support for sending email notifications using the same behavioral feature set as Microsoft Teams notifications: - configurable retries and retry delay - configurable rate limit - a separate notification per event - e.g., request received, username disabled, sessions terminated The following settings are configurable: - destination email address(es) - sender address - SMTP server IP/FQDN - SMTP server port - client identity - hostname provided to the SMTP server - as noted elsewhere, some SMTP servers will perform forward/reverse 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 - as of this commit, the template using Textile formatting is enabled - future efforts are intended to move hard-coded templates out of source code constants to on-disk files for easier customization by the sysadmin(s) supporting this application - unauthenticated connections to target SMTP used - the initial use-case is a local relay which restricts connections based on source IP Address - future efforts are intended to provide support for authentication Behavior worth noting: - automatic client identity value generated from available DNS information if not specified by the sysadmin - the `Showmax/go-fqdn` package is used to retrieve the FQDN of the sending system, with a fallback to - email address verification applied using the provided W3C regex - using a guide from golangcode.com 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 - this was needed to make room for email-specific notification 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 for generation of a format-specific branding string - e.g., Textile-formatted repo link or Markdown-formatted repo link - Update config Stringer interface - it is growing quite large at this point, might be time to rethink how it is handled - TOML configuration file - extended with new settings - rename some settings in an effort to better communicate intent REFERENCES - refs GH-3 - https://golangcode.com/validate-an-email-address/ - https://www.w3.org/TR/2016/REC-html51-20161101/sec-forms.html - https://github.com/Showmax/go-fqdn
SUMMARY This commit adds support for sending email notifications using the same behavioral feature set as Microsoft Teams notifications: - configurable retries and retry delay - configurable rate limit - a separate notification per event - e.g., request received, username disabled, sessions terminated The following settings are configurable: - destination email address(es) - sender address - SMTP server IP/FQDN - SMTP server port - client identity - hostname provided to the SMTP server - as noted elsewhere, some SMTP servers will perform forward/reverse 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 - as of this commit, the template using Textile formatting is enabled - future efforts are intended to move hard-coded templates out of source code constants to on-disk files for easier customization by the sysadmin(s) supporting this application - unauthenticated connections to target SMTP used - the initial use-case is a local relay which restricts connections based on source IP Address - future efforts are intended to provide support for authentication Behavior worth noting: - automatic client identity value generated from available DNS information if not specified by the sysadmin - the `Showmax/go-fqdn` package is used to retrieve the FQDN of the sending system, with a fallback to - email address verification applied using the provided W3C regex - using a guide from golangcode.com 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 - this was needed to make room for email-specific notification 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 for generation of a format-specific branding string - e.g., Textile-formatted repo link or Markdown-formatted repo link - Update config Stringer interface - it is growing quite large at this point, might be time to rethink how it is handled - TOML configuration file - extended with new settings - rename some settings in an effort to better communicate intent REFERENCES - refs GH-3 - https://golangcode.com/validate-an-email-address/ - https://www.w3.org/TR/2016/REC-html51-20161101/sec-forms.html - https://github.com/Showmax/go-fqdn
SUMMARY This commit adds support for sending email notifications using the same behavioral feature set as Microsoft Teams notifications: - configurable retries and retry delay - configurable rate limit - a separate notification per event - e.g., request received, username disabled, sessions terminated The following settings are configurable: - destination email address(es) - sender address - SMTP server IP/FQDN - SMTP server port - client identity - hostname provided to the SMTP server - as noted elsewhere, some SMTP servers will perform forward/reverse 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 - as of this commit, the template using Textile formatting is enabled - future efforts are intended to move hard-coded templates out of source code constants to on-disk files for easier customization by the sysadmin(s) supporting this application - unauthenticated connections to target SMTP used - the initial use-case is a local relay which restricts connections based on source IP Address - future efforts are intended to provide support for authentication Behavior worth noting: - automatic client identity value generated from available DNS information if not specified by the sysadmin - the `Showmax/go-fqdn` package is used to retrieve the FQDN of the sending system, with a fallback to - email address verification applied using the provided W3C regex - using a guide from golangcode.com 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 - this was needed to make room for email-specific notification 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 for generation of a format-specific branding string - e.g., Textile-formatted repo link or Markdown-formatted repo link - Update config Stringer interface - it is growing quite large at this point, might be time to rethink how it is handled - TOML configuration file - extended with new settings - rename some settings in an effort to better communicate intent REFERENCES - refs GH-3 - https://golangcode.com/validate-an-email-address/ - https://www.w3.org/TR/2016/REC-html51-20161101/sec-forms.html - https://github.com/Showmax/go-fqdn
SUMMARY This commit adds support for sending email notifications using the same behavioral feature set as Microsoft Teams notifications: - configurable retries and retry delay - configurable rate limit - a separate notification per event - e.g., request received, username disabled, sessions terminated The following settings are configurable: - destination email address(es) - sender address - SMTP server IP/FQDN - SMTP server port - client identity - hostname provided to the SMTP server - as noted elsewhere, some SMTP servers will perform forward/reverse 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 - as of this commit, the template using Textile formatting is enabled - future efforts are intended to move hard-coded templates out of source code constants to on-disk files for easier customization by the sysadmin(s) supporting this application - unauthenticated connections to target SMTP used - the initial use-case is a local relay which restricts connections based on source IP Address - future efforts are intended to provide support for authentication Behavior worth noting: - automatic client identity value generated from available DNS information if not specified by the sysadmin - the `Showmax/go-fqdn` package is used to retrieve the FQDN of the sending system, with a fallback to - email address verification applied using the provided W3C regex - using a guide from golangcode.com 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 - this was needed to make room for email-specific notification 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 for generation of a format-specific branding string - e.g., Textile-formatted repo link or Markdown-formatted repo link - Update config Stringer interface - it is growing quite large at this point, might be time to rethink how it is handled - TOML configuration file - extended with new settings - rename some settings in an effort to better communicate intent REFERENCES - refs GH-3 - https://golangcode.com/validate-an-email-address/ - https://www.w3.org/TR/2016/REC-html51-20161101/sec-forms.html - https://github.com/Showmax/go-fqdn
SUMMARY This commit adds support for sending email notifications using the same behavioral feature set as Microsoft Teams notifications: - configurable retries and retry delay - configurable rate limit - a separate notification per event - e.g., request received, username disabled, sessions terminated The following settings are configurable: - destination email address(es) - sender address - SMTP server IP/FQDN - SMTP server port - client identity - hostname provided to the SMTP server - as noted elsewhere, some SMTP servers will perform forward/reverse 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 - as of this commit, the template using Textile formatting is enabled - future efforts are intended to move hard-coded templates out of source code constants to on-disk files for easier customization by the sysadmin(s) supporting this application - unauthenticated connections to target SMTP used - the initial use-case is a local relay which restricts connections based on source IP Address - future efforts are intended to provide support for authentication Behavior worth noting: - automatic client identity value generated from available DNS information if not specified by the sysadmin - the `Showmax/go-fqdn` package is used to retrieve the FQDN of the sending system, with a fallback to - email address verification applied using the provided W3C regex - using a guide from golangcode.com 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 - this was needed to make room for email-specific notification 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 for generation of a format-specific branding string - e.g., Textile-formatted repo link or Markdown-formatted repo link - Update config Stringer interface - it is growing quite large at this point, might be time to rethink how it is handled - TOML configuration file - extended with new settings - rename some settings in an effort to better communicate intent REFERENCES - refs GH-3 - https://golangcode.com/validate-an-email-address/ - https://www.w3.org/TR/2016/REC-html51-20161101/sec-forms.html - https://github.com/Showmax/go-fqdn
SUMMARY This commit adds support for sending email notifications using the same behavioral feature set as Microsoft Teams notifications: - configurable retries and retry delay - configurable rate limit - a separate notification per event - e.g., request received, username disabled, sessions terminated The following settings are configurable: - destination email address(es) - sender address - SMTP server IP/FQDN - SMTP server port - client identity - hostname provided to the SMTP server - as noted elsewhere, some SMTP servers will perform forward/reverse 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 - as of this commit, the template using Textile formatting is enabled - future efforts are intended to move hard-coded templates out of source code constants to on-disk files for easier customization by the sysadmin(s) supporting this application - unauthenticated connections to target SMTP used - the initial use-case is a local relay which restricts connections based on source IP Address - future efforts are intended to provide support for authentication Behavior worth noting: - automatic client identity value generated from available DNS information if not specified by the sysadmin - the `Showmax/go-fqdn` package is used to retrieve the FQDN of the sending system, with a fallback to - email address verification applied using the provided W3C regex - using a guide from golangcode.com 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 - this was needed to make room for email-specific notification 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 for generation of a format-specific branding string - e.g., Textile-formatted repo link or Markdown-formatted repo link - Update config Stringer interface - it is growing quite large at this point, might be time to rethink how it is handled - TOML configuration file - extended with new settings - rename some settings in an effort to better communicate intent REFERENCES - refs GH-3 - https://golangcode.com/validate-an-email-address/ - https://www.w3.org/TR/2016/REC-html51-20161101/sec-forms.html - https://github.com/Showmax/go-fqdn
SUMMARY This commit adds support for sending email notifications using the same behavioral feature set as Microsoft Teams notifications: - configurable retries and retry delay - configurable rate limit - a separate notification per event - e.g., request received, username disabled, sessions terminated The following settings are configurable: - destination email address(es) - sender address - SMTP server IP/FQDN - SMTP server port - client identity - hostname provided to the SMTP server - as noted elsewhere, some SMTP servers will perform forward/reverse 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 - as of this commit, the template using Textile formatting is enabled - future efforts are intended to move hard-coded templates out of source code constants to on-disk files for easier customization by the sysadmin(s) supporting this application - unauthenticated connections to target SMTP used - the initial use-case is a local relay which restricts connections based on source IP Address - future efforts are intended to provide support for authentication Behavior worth noting: - automatic client identity value generated from available DNS information if not specified by the sysadmin - the `Showmax/go-fqdn` package is used to retrieve the FQDN of the sending system, with a fallback to - email address verification applied using the provided W3C regex - using a guide from golangcode.com 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 - this was needed to make room for email-specific notification 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 for generation of a format-specific branding string - e.g., Textile-formatted repo link or Markdown-formatted repo link - Update config Stringer interface - it is growing quite large at this point, might be time to rethink how it is handled - TOML configuration file - extended with new settings - rename some settings in an effort to better communicate intent REFERENCES - refs GH-3 - https://golangcode.com/validate-an-email-address/ - https://www.w3.org/TR/2016/REC-html51-20161101/sec-forms.html - https://github.com/Showmax/go-fqdn
SUMMARY This commit adds support for sending email notifications using the same behavioral feature set as Microsoft Teams notifications: - configurable retries and retry delay - configurable rate limit - a separate notification per event - e.g., request received, username disabled, sessions terminated The following settings are configurable: - destination email address(es) - sender address - SMTP server IP/FQDN - SMTP server port - client identity - hostname provided to the SMTP server - as noted elsewhere, some SMTP servers will perform forward/reverse 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 - as of this commit, the template using Textile formatting is enabled - future efforts are intended to move hard-coded templates out of source code constants to on-disk files for easier customization by the sysadmin(s) supporting this application - unauthenticated connections to target SMTP used - the initial use-case is a local relay which restricts connections based on source IP Address - future efforts are intended to provide support for authentication Behavior worth noting: - automatic client identity value generated from available DNS information if not specified by the sysadmin - the `Showmax/go-fqdn` package is used to retrieve the FQDN of the sending system, with a fallback to - email address verification applied using the provided W3C regex - using a guide from golangcode.com 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 - this was needed to make room for email-specific notification 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 for generation of a format-specific branding string - e.g., Textile-formatted repo link or Markdown-formatted repo link - Update config Stringer interface - it is growing quite large at this point, might be time to rethink how it is handled - TOML configuration file - extended with new settings - rename some settings in an effort to better communicate intent REFERENCES - refs GH-3 - https://golangcode.com/validate-an-email-address/ - https://www.w3.org/TR/2016/REC-html51-20161101/sec-forms.html - https://github.com/Showmax/go-fqdn
SUMMARY This commit adds support for sending email notifications using the same behavioral feature set as Microsoft Teams notifications: - configurable retries and retry delay - configurable rate limit - a separate notification per event - e.g., request received, username disabled, sessions terminated The following settings are configurable: - destination email address(es) - sender address - SMTP server IP/FQDN - SMTP server port - client identity - hostname provided to the SMTP server - as noted elsewhere, some SMTP servers will perform forward/reverse 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 - as of this commit, the template using Textile formatting is enabled - future efforts are intended to move hard-coded templates out of source code constants to on-disk files for easier customization by the sysadmin(s) supporting this application - unauthenticated connections to target SMTP used - the initial use-case is a local relay which restricts connections based on source IP Address - future efforts are intended to provide support for authentication Behavior worth noting: - automatic client identity value generated from available DNS information if not specified by the sysadmin - the `Showmax/go-fqdn` package is used to retrieve the FQDN of the sending system, with a fallback to - email address verification applied using the provided W3C regex - using a guide from golangcode.com 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 - this was needed to make room for email-specific notification 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 for generation of a format-specific branding string - e.g., Textile-formatted repo link or Markdown-formatted repo link - Update config Stringer interface - it is growing quite large at this point, might be time to rethink how it is handled - TOML configuration file - extended with new settings - rename some settings in an effort to better communicate intent REFERENCES - refs GH-3 - https://golangcode.com/validate-an-email-address/ - https://www.w3.org/TR/2016/REC-html51-20161101/sec-forms.html - https://github.com/Showmax/go-fqdn
SUMMARY This commit adds support for sending email notifications using the same behavioral feature set as Microsoft Teams notifications: - configurable retries and retry delay - configurable rate limit - a separate notification per event - e.g., request received, username disabled, sessions terminated The following settings are configurable: - destination email address(es) - sender address - SMTP server IP/FQDN - SMTP server port - client identity - hostname provided to the SMTP server - as noted elsewhere, some SMTP servers will perform forward/reverse 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 - as of this commit, the template using Textile formatting is enabled - future efforts are intended to move hard-coded templates out of source code constants to on-disk files for easier customization by the sysadmin(s) supporting this application - unauthenticated connections to SMTP server - the initial use-case is a local relay which restricts connections based on source IP Address - future efforts are intended to provide support for authentication Behavior worth noting: - automatic client identity value generated from available DNS information if not specified by the sysadmin - the `Showmax/go-fqdn` package is used to retrieve the FQDN of the sending system, with a fallback to - email address verification applied using the provided W3C regex - using a guide from golangcode.com 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 - this was needed to make room for email-specific notification 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 for generation of a format-specific branding string - e.g., Textile-formatted repo link or Markdown-formatted repo link - Update config Stringer interface - it is growing quite large at this point, might be time to rethink how it is handled - TOML configuration file - extended with new settings - rename some settings in an effort to better communicate intent REFERENCES - refs GH-3 - https://golangcode.com/validate-an-email-address/ - https://www.w3.org/TR/2016/REC-html51-20161101/sec-forms.html - https://github.com/Showmax/go-fqdn
SUMMARY This commit adds support for sending email notifications using the same behavioral feature set as Microsoft Teams notifications: - configurable retries and retry delay - configurable rate limit - a separate notification per event - e.g., request received, username disabled, sessions terminated The following settings are configurable: - destination email address(es) - sender address - SMTP server IP/FQDN - SMTP server port - client identity - hostname provided to the SMTP server - as noted elsewhere, some SMTP servers will perform forward/reverse 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 - as of this commit, the template using Textile formatting is enabled - future efforts are intended to move hard-coded templates out of source code constants to on-disk files for easier customization by the sysadmin(s) supporting this application - unauthenticated connections to SMTP server - the initial use-case is a local relay which restricts connections based on source IP Address - future efforts are intended to provide support for authentication Behavior worth noting: - automatic client identity value generated from available DNS information if not specified by the sysadmin - the `Showmax/go-fqdn` package is used to retrieve the FQDN of the sending system, with a fallback to - email address verification applied using the provided W3C regex - using a guide from golangcode.com 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 - this was needed to make room for email-specific notification 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 for generation of a format-specific branding string - e.g., Textile-formatted repo link or Markdown-formatted repo link - Update config Stringer interface - it is growing quite large at this point, might be time to rethink how it is handled - TOML configuration file - extended with new settings - rename some settings in an effort to better communicate intent - Documentation - Cover new flags, environment variables and config file settings - Misc fixes for existing rate limit, number of retries and retry delay - Refresh existing setup/deploy steps to briefly cover email configuration REFERENCES - refs GH-3 - https://golangcode.com/validate-an-email-address/ - https://www.w3.org/TR/2016/REC-html51-20161101/sec-forms.html - https://github.com/Showmax/go-fqdn
See atc0005/bounce#37 for more info.
The text was updated successfully, but these errors were encountered: