I have a problem with my postfix servers. When I send an email to an non-existing domain or mail address I get a bounce mail (which is normal) without From address nor Subject.
I tried to create my custom template for bounced mail as the documentation shows but I had no luck. I still receive the mail like that.
This is my bounced mail:
This is a MIME-encapsulated message.
--3F0F416065D.1642072227/server.domain.com
Content-Description: Notification
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
This is the mail system at host server.domain.com.
I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.
For further assistance, please send mail to postmaster.
If you do so, please include this problem report. You can
delete your own text from the attached returned message.
The mail system
<address@domain.com>: host mail.domain.com[45.82.82.50] said: 550 5.1.1
<send-address@domain.com>: Recipient address rejected: User unknown in
virtual mailbox table (in reply to RCPT TO command)
--3F0F416065D.1642072227/server.domain.com
Content-Description: Delivery report
Content-Type: message/delivery-status
Reporting-MTA: dns; server.domain.com
X-Postfix-Queue-ID: 3F0F416065D
X-Postfix-Sender: rfc822; address@domain2.com
Arrival-Date: Thu, 13 Jan 2022 11:10:26 +0000 (UTC)
Final-Recipient: rfc822; send-address@domain.com
Original-Recipient: rfc822;send-address@domain.com
Action: failed
Status: 5.1.1
Remote-MTA: dns; mail.domain.com
Diagnostic-Code: smtp; 550 5.1.1 <send-address@domain.com>: Recipient address
rejected: User unknown in virtual mailbox table
--3F0F416065D.1642072227/server.domain.com
Content-Description: Undelivered Message
Content-Type: message/rfc822
Content-Transfer-Encoding: 8bit
Return-Path: <address@domain2.com>
Received: from [10.0.0.6] (181.red-2-136-168.staticip.rima-tde.net [2.136.168.181])
by server.domain.com (Postfix) with ESMTP id 3F0F416065D
for <send-address@domain.com>; Thu, 13 Jan 2022 11:10:26 +0000 (UTC)
Message-ID: <3658411b-9235-ae87-ffd1-3cff0328f0e1@domain2.com>
Date: Thu, 13 Jan 2022 12:10:25 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.5.0
To: send-address@domain.com
From: address Popescu <address@domain2.com>
Subject: ee
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
ee
--3F0F416065D.1642072227/server.domain.com--
Postfix template:
failure_template = <<EOF
Charset: us-ascii
From: no-reply@mail.mydomain.com (Mail Delivery System)
Subject: Undelivered Mail Returned to Sender
Postmaster-Subject: Postmaster Copy: Undelivered Mail
This is the mail system at host $myhostname.
I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.
For further assistance, please send mail to <postmaster>
If you do so, please include this problem report. You can
delete your own text from the attached returned message.
The mail system
EOF
Postfix config (main.cf):
bounce_template_file = /etc/postfix/bounce.cf
myorigin = $mydomain