On 04/07/2019 15:07, Ygor Fernandes via Exim-dev wrote: > I would like to know if they could help me, I have an environment where my
> client connects to a server that I call RELAY this authenticates the data
> and then fire the message to the server that I call SEND.
>
> The sending occurs perfectly well, however I realize that in RELAY after
> sending a message it generates a new ID, this new ID that SEND follows
> using to complete the process of sending the message.
>
> My need would be to relate these IDs because I work with the database in my
> environment. I can in SEND use the variable, $ message_id, and get the ID
> that is currently running, however I need to relate to the ID that was
> previously used in my RELAY.
>
> Would you have any suggestions?
A properly-formed message should have a Message-ID: header, and this
will be logged on all the reception lines (ones with "<=") in the "id="
field. Use this for tracking the message across systems. in logfiles.
If you're wanting to track via some other means that you are coding
in your configuration, use $h_Message-ID:
Naturally, messages that arrive without the header make your life
difficult. The development tip has some help for this (log_selector
"msg_id_created"), but that probably isn't what you are running.