To manipulate message-id in postfix

Posted on 2014-12-09
Last Modified: 2015-04-20

I have my postfix installed on CentOS7.

Java App ---> Postfix Gateway --> Internet ---> Relay Host --> Client

But messages are failing and I need to tweak the message ID.


Dec  9 17:18:52 gateway1 postfix/cleanup[30261]: AD80082F2A05: message-id=<1494044579.165.1418122141370.JavaMail.root@myserver01-web01>


Dec  9 17:18:52 gateway1 postfix/cleanup[30261]: AD80082F2A05: message-id=<1494044579.165.1418122141370.JavaMail.root@mydomain.tld>

Help, Please.

Question by:williamwlk
  • 2
LVL 12

Assisted Solution

Sommerblink earned 150 total points
ID: 40489831
Hello Will,

I am not a programmer, but the Message-ID header is set by the MTA, not the server... in your case, looks like JavaMail.

A quick google search of javamail and message-id did lead to this:

Does this make sense to you?

Accepted Solution

williamwlk earned 0 total points
ID: 40725413
#cat /etc/postfix/header_checks
/Message-ID:\s+<(.*?)@myserver01-web01>/ REPLACE Message-ID: <$1@mydomain.tld>

Hi Sommerblink,

While it is originally set up by the MTA, we can manipulate it this way, I have found.


Author Closing Comment

ID: 40733038
Own finding.

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question