Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tracking email replies with Message-ID?

Status
Not open for further replies.

cmayo

MIS
Apr 23, 2001
159
0
0
US
I'm working on a PHP widget to receive receipt confirmation emails from users, and need a way to link the replies received with the original emails sent.

Scenario: Our office management system allows us to email a work order to the labor who will be performing the work. We ask for the labor to reply to the work order email to acknowledge that they received it.

As we want a PHP script to receive their acknowledgement and set an appropriate flag for that work order in our office management system, it's important that we know which work order the labor's acknowledgement applies to.

I originally thought I could generate (and record) a specific Message-ID for the outgoing work order email and that replies from labor would pass that original Message-ID back to us in the form of an in-reply-to or a reference header, but in my first non-Outlook (Outlook does provide the original in-reply-to message-id) test response from a Gmail account, Gmail seems to have discarded the original message ID and created it's own in-reply-to Message-ID for the original message, so it doesn't appear that I can rely getting back the original message-id from all email platforms.

In other words:

1) I want one PHP script to send an email to a user

2) When the user replies to that email, another PHP script will access the POP3 mail server and download the response, and

3) Positively identify the user's reply as being in response to the first email, or

4) Positively identify the user's replay as pertaining to a specific work order #

Any ideas?

 
You might be better served in the PHP forum...possibly. I can't link to it but it's forum434..or just do a search for PHP in the search bar [smile]

I used to have a handle on life... but it broke. Cpt. Red Bull
 
Yeah, it's hard to know which forum to post in sometimes. This issue really deals more with internet standards for encoding email than with PHP, despite PHP being the coding platform.
 
You might get lucky then...clearly I wasn't able to answer the question [wink]

I used to have a handle on life... but it broke. Cpt. Red Bull
 
Sniper, that's a good thought and I may implement something like that as part of the project, but the project scope has crept a bit since yesterday and now needs to handle all email traffic for a work order instead of simply registering the receipt of the work order.

What I've hit on, though, is setting up a separate subdomain for those responses and configured a catchall action that simply forwards all email for that domain to another address.

That way, my work order emails will go out from/reply-to THE_WORK_ORDER_ID@catchall.domain.com, the recipient hits "Reply" and sends an acknowledgement to THE_WORK_ORDER_ID@catchall.domain.com, and the mail server forwards the acknowledgement to a special mail account, still addressed to THE_WORK_ORDER_ID@catchall.domain.com. Whent the PHP script fetches the mail, the work order ID can be easily grep'ed from the To: header.

Works like a charm.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top