I have email to case feature enabled for my org. For customers whose OOO notifications is turned on, it is creating a new case instead of appending to old case. This creates an overhead task for support agent to close this case. Is there any better way to handle creation of new cases for such situations.
You can use InboundEmailHandler
to write code that handles the incoming emails instead of the configured rules. You could inspect email's subject for CaseNumber or something else (see below), query the database for Cases with same number and reopen them / add comment. If none found - create new Case.
It's been few years since I've done it and there was a critical update recently. In the old days when you replied to Case from SF it was injecting a "thread id" (shortened version of org id and case id - a globally unique identifier making it easy to match stuff). This special field was available in email templates or https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_System_Cases_getCaseIdFromEmailThreadId.htm
Critical update https://help.salesforce.com/s/articleView?id=000355168&type=1 seems to move the matching from inspecting subject/body for the "thread id" to more standard email headers. Read up about the update, maybe after enabling it it'll just work, reopen cases better. If it won't - you could still write some code and use https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_System_Cases_methods.htm.