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

email-list stores emails as string instead of appending array #5228

Open
synack-security opened this issue Jan 13, 2020 · 2 comments
Open

email-list stores emails as string instead of appending array #5228

synack-security opened this issue Jan 13, 2020 · 2 comments

Comments

@synack-security
Copy link

Using "account_emails" in c7n-mailer mailer.yml config file doesn't work because the get_valid_emails_from_list function is expecting an array, but is getting a string.

Line 134 of email_delivery.py stores email as string in "email_list" instead of appending the email to the array "email_list".

Change from:
email_list = account_email_mapping.get(account_id, [])
Change To:
email_list.append(account_email_mapping.get(account_id, []))

@kapilt
Copy link
Collaborator

kapilt commented Jan 15, 2020

hmm.. this attribute looks under specified in the config schema, we probably should be more specific that its an array in schema, and potentially support both string or array.

simply changing this from array to a string, would break existing configurations?

@synack-security
Copy link
Author

hmm.. this attribute looks under specified in the config schema, we probably should be more specific that its an array in schema, and potentially support both string or array.

simply changing this from array to a string, would break existing configurations?

Agreed. I was able to modify my mailer.yml and make my config compatible as an array. The documentation should reflect that an array is required currently, but enhancement would be to allow a single value/string (ie 123455666: email@thing.com).

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

No branches or pull requests

2 participants