chatwoot / chatwoot

Open-source live-chat, email support, omni-channel desk. An alternative to Intercom, Zendesk, Salesforce Service Cloud etc. 🔥💬
https://www.chatwoot.com/help-center
Other
18.98k stars 3.03k forks source link

chore: Handle invalid email address in IMAP channel #9450

Closed sojan-official closed 3 weeks ago

sojan-official commented 3 weeks ago

We have observed in Sentry that sometimes fetch_imap_emails_jobs fails with a validation error when creating a contact. This happens when the original_sender isn't in a format supported by the Chatwoot contact model schema. Chatwoot validates contacts email with Device.email_regexp.

This PR will skip processing such emails. It also adds a log for each email processed in the email fetch job and an error for the ones we skip.

Fixes: https://linear.app/chatwoot/issue/CW-3295/activerecordrecordinvalid-validation-failed-email-invalid-email

linear[bot] commented 3 weeks ago

CW-3295 ActiveRecord::RecordInvalid: Validation failed: Email Invalid email (ActiveRecord::RecordInvalid)

sentry-io[bot] commented 2 weeks ago

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

Did you find this useful? React with a 👍 or 👎