iachat/app/mailers
Tanmay Deep Sharma 722e68eecb
fix: validate support_email format and handle parse errors in mailer (#13958)
## Description

ConversationReplyMailer#parse_email calls
Mail::Address.new(email_string).address without error handling. When an
account's support_email contains a non-email string (e.g., "Smith
Smith"), the mail gem raises Mail::Field::IncompleteParseError, crashing
conversation transcript emails.

This has caused 1,056 errors on Sentry (EXTERNAL-CHATINC-JX) since Feb
25, all from a single account that has a name stored in the
support_email field instead of a valid email address.

Closes
https://linear.app/chatwoot/issue/CW-6687/mailfieldincompleteparseerror-mailaddresslist-can-not-parse-orsmith

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)


## Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented on my code, particularly in hard-to-understand
areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream
modules

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Vishnu Narayanan <iamwishnu@gmail.com>
2026-04-13 19:06:06 +07:00
..
administrator_notifications feat: TikTok channel (#12741) 2025-12-17 07:54:50 -08:00
agent_notifications feat: sanitize inbox name (#11597) 2025-06-09 14:46:12 +05:30
team_notifications feat: Add send message, fix issues with message conditions (#4423) 2022-04-14 13:36:55 +05:30
application_mailer.rb chore: log emails sent from chatwoot (#8721) 2024-01-17 13:19:14 +04:00
conversation_reply_mailer_attachment_helper.rb fix: stream attachment handling in workers (#12870) 2025-12-05 13:02:53 -08:00
conversation_reply_mailer_helper.rb fix(email): Allow inbox OAuth replies without global SMTP (#13820) 2026-03-17 11:10:42 +04:00
conversation_reply_mailer.rb fix: validate support_email format and handle parse errors in mailer (#13958) 2026-04-13 19:06:06 +07:00
portal_instructions_mailer.rb fix: footer in ssl_instructions email (#12076) 2025-07-31 11:44:17 -07:00
references_header_builder.rb feat: add references header to reply emails (#11719) 2025-07-29 15:54:14 +05:30