public function parseHeaderInfo(Email &$email, $header)
    {

        //map the most useful header info to the email object itself
        $email->all_headers = $header;
        $email->subject = $header->subject;
        $email->to = $header->to[0]->mailbox . '@' . $header->to[0]->host;
        $email->from = $header->from[0]->mailbox . '@' . $header->from[0]->host;
        $email->reply_to = $header->reply_to[0]->mailbox . '@' . $header->reply_to[0]->host;
        $email->sender = $header->sender[0]->mailbox . '@' . $header->sender[0]->host;
        $email->size = $header->Size;
        $email->date = $header->date;
        $email->timestamp = $header->udate;
        $email->message_id = $header->message_id;
        if ($header->Deleted == 'D') {
            $email->deleted = 1;
        }

        //add the entire header in case we want access to custom headers later
        $this->headers = $header;
    }