Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6802907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:16:47+00:00 2026-05-26T19:16:47+00:00

I’m working on something that logs e-mail messages sent to a certain address. I

  • 0

I’m working on something that logs e-mail messages sent to a certain address. I have a PHP script that puts the info into MySql, which is working fine.

I need to be able to group messages based on the ‘conversation’ similar to Gmail, and have already read up on this a bit. This doesn’t need to be perfect because messages will be manually approved before being shown on the website, and any errors can be corrected then. I just want to make it the least amount of work as possible so that linking a new e-mail to the original should be done automatically.

My understanding is that the In-Reply-To header can identify the original message, but that its use is not standard.

I found this on another page:

The most common forms of In-Reply-To seemed to be:

31%     NAME's message of TIME <ID@HOST>
22%     <ID@HOST>
9%      <ID@HOST> from NAME at "TIME"
8%      USER's message of TIME <ID@HOST>
7%      USER's message of TIME
6%      Your message of "TIME"
17%     hundreds of other variants (average 0.4% each?)

However, this seems to indicate that it’s not unreasonable to assume that, if there is an In-Reply-To field, then the first <> bracketed text found therein is the Message-ID of the parent message.

So, what is the easiest way to get that value? Is there a regular expression that would let me grab whatever is inside the < and > if is is available? (According to the post I found, should this be the FIRST value inside a < and > ?)

Thanks for any help you can provide.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:16:48+00:00Added an answer on May 26, 2026 at 7:16 pm

    You should be able to just grab the first match in the back-reference:

    <(.+)>

    Explanation:

    //    Match the character “<” literally «<»
    //    Match the regular expression below and capture its match into backreference number 1 «(.+)»
    //       Match any single character that is not a line break character «.+»
    //          Between one and unlimited times, as many times as possible, giving back as needed (greedy) «+»
    //    Match the character “>” literally «>»
    

    According to this documentation you could write something like as follows to accomplish what you want to do (forgive me if this is not valid php):

    $string ='blah blah blah <ID@HOST>';
    preg_match('/<(.+)>/', $string, $match);
    print_r($match);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.