cisagov / cyhy-core

Core code for Cyber Hygiene (CyHy)
Other
8 stars 10 forks source link

Check that email addresses look valid in `cyhy-simple` and `cyhy-import` #94

Closed jsf9k closed 6 months ago

jsf9k commented 6 months ago

💡 Summary

We should verify email addresses in cyhy-simple and cyhy-import, or possible just when the request document is saved in the database.

Motivation and context

I got this error for an organization when sending out the CyHy reports this week:

cyhy-mailer-mailer-1  | botocore.exceptions.ClientError: An error occurred (InvalidParameterValue) when calling the SendRawEmail operation: Domain contains illegal character

The issue turned out to be a duplicated at sign (@) in the distribution email address. A simple regex would prevent errors like this from happening in the future.