Skip to content

Incorrect new lines in the header #12

@npajkovsky

Description

@npajkovsky

I'm parsing an email with mail-parse and building a new mail that has truncated body content. What I would like to todo is reuse original headers.

========================================
Return-Path: Text("[email protected]")
Delivered-To: Text("[email protected]")
Received: Text("from 139-162-244-188.cprapid.com\n\tby 139-162-244-188.cprapid.com with LMTP\n\tid RQb5Ojfdd2O5LikAqCNTnA\n\t(envelope-from <[email protected]>)\n\tfor <[email protected]>; Fri, 18 Nov 2022 19:29:59 +0000")
Return-Path: Text("[email protected]")
Envelope-to: Text("[email protected]")
Delivery-date: Text("Fri, 18 Nov 2022 19:30:00 +0000")
Received: Text("from pajkovsky by 139-162-244-188.cprapid.com with local (Exim 4.95)\n\t(envelope-from <[email protected]>)\n\tid 1ov8pO-00A1jF-Dg\n\tfor [email protected];\n\tWed, 16 Nov 2022 03:11:06 +0000")
To: Address(Addr { name: None, address: Some("[email protected]") })
Subject: Text("[My Company] Your site has updated to WordPress 6.1.1")
X-PHP-Script: Text("cpanel.pajkovsky.io/wp-cron.php for 139.162.244.188\n X-PHP-Originating-Script: 1001:PHPMailer.php")
Date: DateTime(DateTime { year: 2022, month: 11, day: 16, hour: 3, minute: 11, second: 6, tz_before_gmt: false, tz_hour: 0, tz_minute: 0 })
From: Address(Addr { name: Some("WordPress"), address: Some("[email protected]") })
Message-ID: Text("[email protected]")
X-Mailer: Text("PHPMailer 6.6.5 (https://github.com/PHPMailer/PHPMailer)")
MIME-Version: Text("1.0")
Content-Type: ContentType(ContentType { c_type: "text", c_subtype: Some("plain"), attributes: Some([("charset", "UTF-8")]) })
[src/main.rs:33] &v = "from 139-162-244-188.cprapid.com\n\tby 139-162-244-188.cprapid.com with LMTP\n\tid RQb5Ojfdd2O5LikAqCNTnA\n\t(envelope-from <[email protected]>)\n\tfor <[email protected]>; Fri, 18 Nov 2022 19:29:59 +0000"
[src/main.rs:33] &v = "from pajkovsky by 139-162-244-188.cprapid.com with local (Exim 4.95)\n\t(envelope-from <[email protected]>)\n\tid 1ov8pO-00A1jF-Dg\n\tfor [email protected];\n\tWed, 16 Nov 2022 03:11:06 +0000"
========================================
Return-Path: [email protected]
Delivered-To: [email protected]
Received: from 139-162-244-188.cprapid.com
        by 139-162-244-188.cprapid.com with
         LMTP
        id RQb5Ojfdd2O5LikAqCNTnA
        (envelope-from <[email protected]>)

        for <[email protected]>; Fri, 18 Nov 2022 19:29:59 +0000
Return-Path: [email protected]
Envelope-to: [email protected]
Delivery-date: Fri, 18 Nov 2022 19:30:00 +0000
Received: from pajkovsky by 139-162-244-188.cprapid.com with local (Exim 4.95)

        (envelope-from <[email protected]>)
        id 1ov8pO-00A1jF-Dg

        for [email protected];
        Wed, 16 Nov 2022 03:11:06 +0000
To: <[email protected]>

But I'm seeing Received has an unexpected new line in the header. I am not convinced that's correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions