You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "chennaji9 (via GitHub)" <gi...@apache.org> on 2026/10/14 11:20:58 UTC

[PR] fix(alert): parse quoted email recipient lists correctly [rocketmq-dashboard]

chennaji9 opened a new pull request, #6663:
URL: https://github.com/apache/rocketmq-dashboard/pull/6663

   ### Which Issue(s) This PR Fixes
   
   None — small self-contained fix found by inspection (no issue tracked).
   
   ### Brief Description
   
   `NotificationOutboxService.parseRecipients` split the configured recipient list on a plain `[,;]` regex before handing each fragment to `InternetAddress`. A list like
   
   ```
   "Doe, John" <jo...@example.com>, ops@example.com
   ```
   
   is valid RFC 822 input (`InternetAddress` is already used with display-name support), but the split broke it at the comma inside the quoted display name, validation failed on the unbalanced fragment, and the notification went to retry instead of sending.
   
   - `parseRecipients` now splits on `,` and `;` **only outside a quoted display name** (with backslash-escape handling inside quotes), then validates each whole address as before. Legacy semicolon-separated lists keep working, including a `;` inside a quoted name.
   
   ### How Did You Test This Change?
   
   `cd server && mvn -B -ntp test -Dtest='NotificationOutboxServiceTest' -DfailIfNoTests=false` → **Tests run: 36, Failures: 0, Errors: 0** (34 pre-existing + 2 new).
   
   New tests (both fail on the unfixed code):
   - `dispatchesEmailWithQuotedDisplayNameRecipientsTest` — `"Doe, John" <jo...@example.com>, ops@example.com` delivers to `[john@example.com, ops@example.com]`;
   - `dispatchesEmailToSemicolonSeparatedRecipientsTest` — `ops@example.com; "Night; Shift" <ni...@example.com>` delivers to `[ops@example.com, night@example.com]`.
   
   Red-green: both tests were run against the unfixed tree and fail there (the split fragments never validate), while the pre-existing comma-separated delivery test passes unchanged.
   
   Not run: the full `mvn test` suite (integration tests need MySQL 8); the change is confined to one private parser covered above.
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits (`fix:`)
   - [x] Tests added or updated for non-trivial changes (2 new red-green tests)
   - [x] New UI text has both Chinese and English entries under `web/src/i18n/` (n/a — no UI change)
   - [x] Architecture constraints stay green (same class, same package, no new dependency)
   - [x] New source files carry the ASF license header (n/a — no new source file)
   - [x] Documentation touched where behaviour changed (n/a — the settings field already accepts RFC 822 addresses; only parsing was broken)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(alert): parse quoted email recipient lists correctly [rocketmq-dashboard]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins merged PR #6663:
URL: https://github.com/apache/rocketmq-dashboard/pull/6663


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org