Starky Starky - 1 month ago 12
PHP Question

Do emails contain an out off office flag that can be read from PHP

I'm making some improvements to an internal ticketing system. The system pulls emails from our exchange server and converts them into tickets in the system. We already take information from the header of each email during this process of ticket generation.

What I would like to know is if there is a way to know for certain if an email is an out-of-office reply and has been automatically sent back. This would be from any system and not just Outlook. This would be useful as these emails could be filtered out and not converted into tickets, reducing spam in our system and saving our agents time.

However this really has to be spot on as we would rather handle these emails manually than miss an email that wasn't automated. Another helpful thing to detect would be bounce backs from invalid addresses, server messages and the like.

I am developing in PHP but any pointers in the right direction would be appreciated.

Answer

This is discussed in RFC 3834 Recommendations for Automatic Responses to Electronic Mail. It defines the Auto-Submitted header field that indicates if the message was sent automatically. Check if it's there and if it is, then exclude that message.

Comments