-
-
Notifications
You must be signed in to change notification settings - Fork 226
Fix email-to-ticket sender detection for “via”/mailing-list emails #1259
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
base: develop
Are you sure you want to change the base?
Conversation
Develop to Master for Release
Merge Develop into Master for v25.11.1 release
Develop to Master for 25.12 release
Develop to Master for 25.12.1 Maint Release
Prefer Reply-To and X-Original-* headers before From when parsing inbound mail. This fixes cases (e.g. Google Groups DMARC mitigation) where From is rewritten to the group address like support@…, causing ITFlow to misidentify the requester and break contact/domain matching + ticket threading. Falls back to From when Reply-To/original headers aren’t present; no other parsing behavior changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello & Welcome! :)
Thanks for taking the time to help improve ITFlow. We're excited to review your contributions - we'll review this PR as soon as we can!
Whilst you're waiting, please feel free to check out the forum.
Just so you know, all contributions to ITFlow are licensed under the GNU GPL. By contributing you grant us a perpetual & irrevocable license to include your work in ITFlow.
Mailing-list/Google Groups DMARC behavior can produce display names like “{Sender Name} via Support”. This commit prefers Reply-To personal name when available and strips trailing “ via …” from the resolved sender name so auto-replies and auto-created contacts don’t address users with the “via” junk.
…tify them of ticket creation Collect From/Reply-To/To/Cc participants on inbound emails, add them as ticket watchers, and send the ticket-created auto-reply to additional participants as separate emails. This keeps multi-recipient threads intact without requiring mail-queue CC support (phase 2).
|
|
Hi @zoltan151 Thanks for the PR! Can you please share more details of the service causing this NDR so we may test how this change works? In any event, I think it's probably worth including this newer NDR sender identification in the new NDR block that we have if at all possible. This is where we attach the NDR to the associated ticket, or simply alert on it. NDRs don't need to create tickets by themselves, and I don't think the core 'from' code needs to be so complex to account for an edge case when it can be caught later on. Please also ensure you're familiar with our contributing guidelines, in particular our policy on the use of AI/LLM for code contributions. Thanks, |



Summary
Prefer Reply-To and X-Original-* headers before From when parsing inbound mail. This fixes cases (e.g. Google Groups DMARC mitigation) where From is rewritten to the group address like support@…, causing ITFlow to misidentify the requester and break contact/domain matching + ticket threading. Falls back to From when Reply-To/original headers aren’t present; no other parsing behavior changed.
Detailed Explanation
Context
Some inbound emails arrive as
"Customer Name" via {Group Name} <support@example.com>due to mailing-list/Google Groups DMARC behavior. In those cases, the visible From address is rewritten to the group address while the real sender is preserved in Reply-To (and sometimes X-Original-* headers). The cron parser previously relied solely on Webklex getFrom(), so ITFlow treated the message as coming from support@example.com, which broke requester attribution, contact/domain matching, and email-to-ticket threading.What changed
Updated sender resolution in cron_ticket_email_parser.php to determine the requester email using this precedence order:
The display name (from_name) remains sourced from the From header’s personal name for readability.
Why this works
For “via support@…” messages, Reply-To contains the customer’s real address (e.g. customer@placeholder.com), so ITFlow can correctly:
For standard direct emails, Reply-To is typically absent or matches From, so behavior remains effectively unchanged.
Testing / verification
Risk / rollback
Low risk; this only changes sender selection logic and includes fallbacks to previous behavior when Reply-To/original headers are not available. Rollback is a simple revert of this commit.