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

Handle user email values with multiple addresses #1492

Merged
merged 2 commits into from Oct 20, 2015
Merged

Handle user email values with multiple addresses #1492

merged 2 commits into from Oct 20, 2015

Conversation

@bernd
Copy link
Member

@bernd bernd commented Oct 19, 2015

LDAP users can have multiple addresses in the email field. Split the email field on the "," character and add all addresses as recipient.

Convert recipients to a Set to avoid sending duplicate emails.

Fixes #1439

LDAP users can have multiple addresses in the email field. Split the
email field on the "," character and add all addresses as recipient.

Convert recipients to a Set to avoid sending duplicate emails.

Fixes #1439
@bernd bernd added this to the 1.2.2 milestone Oct 19, 2015
recipients.add(user.getEmail());
// LDAP users might have multiple email addresses defined.
// See: https://github.com/Graylog2/graylog2-server/issues/1439
final List<String> addresses = Splitter.on(",").omitEmptyStrings().trimResults().splitToList(user.getEmail());

This comment has been minimized.

@joschi

joschi Oct 19, 2015
Contributor

Using Splitter#split() here would safe some intermediate object instances.

recipients = new HashSet<>(Splitter.on(",").omitEmptyStrings().trimResults().split(user.getEmail()));
@joschi joschi self-assigned this Oct 19, 2015
@joschi joschi added bug users labels Oct 19, 2015
@joschi
Copy link
Contributor

@joschi joschi commented Oct 20, 2015

LGTM. 👍

joschi added a commit that referenced this pull request Oct 20, 2015
Handle user email values with multiple addresses
@joschi joschi merged commit ba1e464 into 1.2 Oct 20, 2015
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/travis-ci/push The Travis CI build is in progress
Details
ci Jenkins build graylog2-server-integration-pr 294 has succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@joschi joschi deleted the issue-1439 branch Oct 20, 2015
joschi added a commit that referenced this pull request Oct 20, 2015
Handle user email values with multiple addresses
(cherry picked from commit ba1e464, refs #1439)
joschi added a commit that referenced this pull request Oct 20, 2015
Handle user email values with multiple addresses
(cherry picked from commit ba1e464, refs #1439)
bernd added a commit that referenced this pull request Oct 22, 2015
bernd added a commit that referenced this pull request Oct 22, 2015
Refs #1492

(cherry picked from commit b312e9e)
bernd added a commit that referenced this pull request Oct 22, 2015
Refs #1492

(cherry picked from commit b312e9e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants