Skip to content

Parse more than one Received: header #61

@Polfo

Description

@Polfo

I have the folowing header

Received: from com-bemdirector002.mailprotect.com ([x.x.x.x])
\tby com-bemback004.mailprotect.com (Dovecot) with LMTP id K617O9xE3F8XaAAA+HLQTg
\tfor <laravel.test@example.com>; Fri, 18 Dec 2020 06:57:49 +0100
Received: from com-bemdirector001.mailprotect.com ([x.x.x.x])
\tby com-bemdirector002.mailprotect.com (Dovecot) with LMTP id YfJnO9xE3F/NPAAAQ2+l/g
\t; Fri, 18 Dec 2020 06:57:48 +0100
Received: from com-basicem-smtp003.srv.combell-ops.net ([x.x.x.x] helo=smtp03.mailprotect.com)
\tby com-bemdirector001.mailprotect.com with esmtp (Exim 4.89)
\t(envelope-from <noreply@sunnyportal.com>)
\tid 1kq8lw-0005bc-Q2
\tfor logs_sunny@example.com; Fri, 18 Dec 2020 06:57:48 +0100
Received: from gateway.mailprotect.com (gateway.mailprotect.com [x.x.x.x])
\tby smtp03.mailprotect.com (Postfix) with ESMTP id C17C442A2B4
\tfor <logs_sunny@example.com>; Fri, 18 Dec 2020 06:57:48 +0100 (CET)
Received: from localhost (localhost [x.x.x.x])
\tby gateway.mailprotect.com (Postfix) with ESMTP id AF479300F1
\tfor <logs_sunny@example.com>; Fri, 18 Dec 2020 06:57:48 +0100 (CET)
X-Virus-Scanned: amavisd-new at mailprotect.com
Received: from gateway.mailprotect.com ([x.x.x.x])
\tby localhost (gateway.mailprotect.com [x.x.x.x]) (amavisd-new, port 10025)
\twith ESMTP id Uw-k-ri61xlr for <logs_sunny@example.com>;
\tFri, 18 Dec 2020 06:57:48 +0100 (CET)
Received: from mx.mailprotect.com (mx.mailprotect.com [x.x.x.x])
\tby gateway.mailprotect.com (Postfix) with ESMTP id 6C6683005E
\tfor <logs_sunny@example.com>; Fri, 18 Dec 2020 06:57:48 +0100 (CET)
X-Greylist: from auto-whitelisted by SQLgrey-1.8.0
Received: from 2nd-mailin.sunnyportal.com (2nd-mailin.sunnyportal.com [x.x.x.x])
\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
\t(No client certificate requested)
\tby mx.mailprotect.com (Postfix) with ESMTPS id 530F11800CB
\tfor <logs_sunny@example.com>; Fri, 18 Dec 2020 06:57:48 +0100 (CET)
dkim-signature: ...
Received: from mailin.sunnyportal.com (Unknown [x.x.x.x])
\tby 2nd-mailin.sunnyportal.com with ESMTP
\t; Fri, 18 Dec 2020 06:57:46 +0100
X-Footer: c3Vubnlwb3J0YWwuY29t
Received: from sunnyportal.com ([x.x.x.x])
\tby mailin.sunnyportal.com with ESMTP;
\tFri, 18 Dec 2020 06:57:44 +0100

However, getHeader() only shows the content of one received header in the attributes

#attributes: array:23 [▼
    "from" => array:1 [▶]
    "to" => array:2 [▶]
    ...
    "received" => array:3 [▼
      0 => "from sunnyportal.com ([192.168.5.23])"
      1 => "by mailin.sunnyportal.com with ESMTP;"
      2 => "Fri, 18 Dec 2020 06:57:44 +0100"
    ]
    "x-virus-scanned" => "amavisd-new at mailprotect.com"

Would it be possible to have all the Received: headers in the received array?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions