inbound email parser accepts any "to" recipient shape and can create junk itinerary items #15

Closed
opened 2026-08-12 03:47:40 +00:00 by Mark · 0 comments
Owner

src/app/api/inbound/resend/route.ts: toEmail is taken as-is (array first element or string) and matched against trips.forwardEmail with no normalization (case, whitespace, display-name wrappers like "Trip abc <trip-xxxx@inbound...>"). A display-name-wrapped To header therefore 404s valid mail. parseEmailContent also always returns at least one item (type defaults to note) with the raw subject as title, so a completely unrelated email forwarded by mistake creates a junk itinerary item instead of staying needs_review.

src/app/api/inbound/resend/route.ts: toEmail is taken as-is (array first element or string) and matched against trips.forwardEmail with no normalization (case, whitespace, display-name wrappers like "Trip abc <trip-xxxx@inbound...>"). A display-name-wrapped To header therefore 404s valid mail. parseEmailContent also always returns at least one item (type defaults to note) with the raw subject as title, so a completely unrelated email forwarded by mistake creates a junk itinerary item instead of staying needs_review.
Mark closed this issue 2026-08-13 00:13:12 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AuWoMe/planish#15
No description provided.