I've noticed for messages that fail to deliver with postfix, the body of the message is removed. Here's an example (real emails replaced with temps):
--5F54EFCA0A.1653443634/MYDOMAIN.COM
Content-Description: Delivery report
Content-Type: message/delivery-status
Reporting-MTA: dns; MYDOMAIN.COM
X-Postfix-Queue-ID: 5F54EFCA0A
X-Postfix-Sender: rfc822; [email protected]
Arrival-Date: Wed, 25 May 2022 01:47:13 +0000 (UTC)
Final-Recipient: rfc822; [email protected]
Original-Recipient: rfc822;[email protected]
Action: delayed
Status: 4.2.1
Remote-MTA: dns; alt1.gmail-smtp-in.l.google.com
Diagnostic-Code: smtp; 450-4.2.1 The user you are trying to contact is
receiving mail at a rate that 450-4.2.1 prevents additional messages from
being delivered. Please resend your 450-4.2.1 message at a later time. If
the user is able to receive mail at that 450-4.2.1 time, your message will
be delivered. For more information, please 450-4.2.1 visit 450 4.2.1
https://support.google.com/mail/?p=ReceivingRate
i9-20020a544089000000b0032b06b69e67si10079646oii.275 - gsmtp
Will-Retry-Until: Mon, 30 May 2022 01:47:13 +0000 (UTC)
--5F54EFCA0A.1653443634/MYDOMAIN.COM
Content-Description: Undelivered Message Headers
Content-Type: text/rfc822-headers
Content-Transfer-Encoding: 8bit
Return-Path: <[email protected]>
Received: from [XX.XX.XX.XX] (localhost [127.0.0.1])
by MYDOMAIN.COM (Postfix) with ESMTP id 5F54EFCA0A
for <[email protected]>; Wed, 25 May 2022 01:47:13 +0000 (UTC)
Content-Type: multipart/mixed; boundary="===============9070788644322080819=="
MIME-Version: 1.0
Subject: MY SUBJECT
From: [email protected]
To: [email protected]
Message-Id: <[email protected]>
Date: Wed, 25 May 2022 01:47:13 +0000 (UTC)
--5F54EFCA0A.1653443634/MYDOMAIN.COM--
*** HEADER EXTRACTED deferred/3/3E377FD67F ***
named_attribute: encoding=8bit
*** MESSAGE FILE END deferred/3/3E377FD67F ***
I'm wondering are any of the below options possible? Just trying to find a way to avoid losing the original message whenever there's a bounce.
- Is there a way to stop postfix from generating this message and instead just place the original message in the deferred queue?
- Or, can I change how quickly it removes the original message and replaces it with this one?
- Or, is there a way to customize the format to make sure the original message's body content is included?