Retrieve Previous Email Headers
Moderators: Chris Corbyn, General Moderators
Retrieve Previous Email Headers
I'm working on an automated bounce detection system that I'll submit to the community. I'm trying to capture the header details of all of the various headers in parts of bounce emails I've retrieved, specifically Swift's message-id to allow database reference. Looking through PHP 5's API docs, I've seen there's methods that return header details. I realize this is for the message swift is about to send, but is there a way to pass my raw headers from another email into swift somewhere and get those methods to return my bounced email's header info? More a question of Swift's internals, but figured it was worth a shot. I've tried everything recently to retrieve the message-id from past email headers (lower level?) to relate the captured bounce and its status to the email sent by Swift, but have yet to uncover a flexible solution. Thanks!
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Parsing emails into Swift's MIME object format is something I've wanted to do for a while. It would make it easier to "attach" emails to a swift message and it would also allow emails to be stored and then sent later.
Currently there's no implementation of this however. If all you want is the message ID it's a simple Regex:
Currently there's no implementation of this however. If all you want is the message ID it's a simple Regex:
Code: Select all
if (preg_match('/^Message-ID: <([^>]+)>/ism', $full_email, $matches))
{
echo "Message-ID is " . $matches[1];
}
else
{
echo "There's no Message-ID";
}