Mautic Community Forums

Mautic bounce emails - Delivered to IMAP bounce folder but with empty Return-Path header

Your software
My Mautic version is: 4.1
My PHP version is: 7.4.3
My Database type and version is: 10.3.31-MariaDB

Your problem
My problem is: Bounce messages using reply-to format are delivered to the configured bounce IMAP folder. e.g. Return-Path: bounce+bounce_619322718d3e9251078198@domain

Once the bounce message is delivered to the IMAP inbox what header is read to update contacts? Is it the Return-Path header? If so i my case the Return-Path is being stripped either by the Postfix MTA or IMAP Smartermail server as on delivery the header is empty e.g. Return-Path: <>

Has anyone seen this before and know where to look next?

Dean,
I’m not sure what part of the header is read by Mautic, but my bounced emails were not read either.

This is how I solved it:

  1. In my iReadMail installation I have an email account accessible from RoundCube.
  2. Create a subfolder to Inbox, i called it bounces
  3. Create a filter to collect all the incoming bounces emails in the subfolder called bounces
  4. Go to mautic / configuration/email, configure mautic imap to check the email account from iRedMail, set mautic bounced to check the bounced subfolder.

Yes that’s how mine is also setup using Mautic’s monitoring of the IMAP bounce folder with cron to fetch the bounce messages. It seems the Return-Path is used to set the To: address for the bounce email message and is removed by the recipents mail server.

“Only the recipient’s mail server is supposed to add a Return-Path header to the top of the email. This records the actual Return-Path sender during the SMTP session. If a Return-Path header already exists in the message, then that header is removed and replaced by the recipient’s mail server.”

  1. The return-path header is set by Mautic server as “youremail+bounce_receiver-email-id@your-domain.com
  2. Email bounced message is sent back using the Return-Path header address. The receiver SMTP sets a new Return-Path or in this case removes it.
  3. Mautic then uses ??? header to set the contact as bounced “do not contact”. Is Mautic using the To: header which was set using the Return-Path address?

Return-Path: <>
Received: from app.domain (app.domain [XX.XX.XX.XX]) by mail.otherdomain with SMTP
(version=TLS\Tls12
cipher=Aes256 bits=256);
Fri, 19 Nov 2021 17:32:10 +0800
Date: Fri, 19 Nov 2021 17:31:36 +0800 (HKT)
From: MAILER-DAEMON@domain (Mail Delivery System)
Subject: Undelivered Mail Returned to Sender
To: bounce+bounce_61976e9a4d2b4763769789@domain

Anyone know which header Mautic uses to detemine bounced contacts using IMAP method? That is the when Mautic cron fetch reads the IMAP folder configured under Settings > Configuration > Email Settings > Monitored Inbox Settings > Bounces

The bounce managment page does not make this clear. Bounce management | Mautic

Note that Mautic makes use of “append” email addresses. The return-path or the list-unsubscribe header will use something like youremail+bounce_abc123@your-domain.com . The bounce or unsubscribe allows Mautic to determine what type of email it is when it examines the inbox through IMAP.

Ok solved by restarting Mautic and Postfix server. I think Postfix had not reloaded it’s main config file.

The header To: is being read by Mautic now to process boucnes and contacts tagged and added by filter to the bounced segment.

1 Like