Are you looking to create a MessageID for use with SMTP, or for some other use? Or just to track unique transactions downstream? In general, you could create a random code to insert into a header, or a cookie, or into the response sent back to the client.
For example, this fragment uses a simple random sequence of eight bytes, hex-encoded:
# Random, suitable for cryptographic use
$myMessageID = string.hexencode(string.randomBytes( 8 ));
http.setHeader( "X-My-Header", $myMessageID );
Alternatively, this constructs an ID including micro-second timing and hostname:
# Random, machine id, date/time, hostname
$myMessageID = string.sprintf( "%.6f", sys.time.highres()) . "@" . sys.hostname() . "." . sys.domainname());
http.setHeader( "X-My-Header", $myMessageID );
Are you looking to simply log the MessageID in your SIEM, or to use it for additional processing?
For example, if you are looking to track the time taken individual transactions, you could use our analytics application with Services Director, or you could use connection tracing, as shown here:
https://community.pulsesecure.net/t5/Pulse-Secure-vADC/Finding-a-needle-in-your-haystack-using-the-connection/ta-p/34701
... View more