Would something like a theoretical (at least i think) $connection_id
be useful? You'd still have to tie it back to a message but at least
you'd have variable that would be (again theoretically) set at
connection time, since you don't have access to $message_id before
DATA.
I know a variable like that would be useful for tracking connections
in logs, esp if there was an log_selector type for it (rather than
logwrite'ing). I know you could do a warn acl_c#=something in the HELO
acl, but that feels kludgish and having it as a log_selector would be
really really cool.
Dunno what it would look like though. Maybe just a timestamp and random garbage.
But barring this getting added as a wishlist item, your best bet is to
do this in the HELO ACL:
warn acl_c9 = something vaguely unique, like $sender_host_address-%tod_zulu
and then you can logwrite it at the top of each subsequent ACL
warn logwrite = ID $acl_c9
Of course you might be using acl_c9 for something else, so whichever
acl_c# is fine. Again there could be more than one message per
connection but it's a start.