The keys of %msg are message numbers. Since %msg contains records for only those messages that are active in the queue at a particular time, there is no collision between keys. If we wanted to store historical information about messages, we would need to use different keys. The values of %msg are references to structures that represent the messages. A typical structure looks like this: * | | Message V +-----------------------------------------+ | arrived => arrival time in Unix format | | msg => message number | | bounced => 'B' or '-' | | length => length in bytes | | from => sender's address | +--------------+ | del => *------------------------------>|123456 => *--------+ | finished => removal time in Unix format | | 23987 => *------+ | +-----------------------------------------+ | ... ... | | | |(One entry for| | | | each delivery| | | | attempt.) | | | Delivery attempt +--------------+ | | +------------------------------------------+ | | | lr => recipient is local or remote | | | | to => recipient address |<--------------------------+ | | started => delivery attempt time | | | finished => completion time | +--------------+ | | result => success/deferral/failure | |lr => ... |<---------+ | report => additional messages | |to => ... | +------------------------------------------+ |... ... | +--------------+