If there is the possibility of a message being added very late, and either being omitted from the scan that started earlier, or a delay from finishing the scan to performing the timestamp check, you might still miss a message.
You also mentioned a directory being created 5 minutes early: what if some system has a clock skewed the opposite way, and puts a message in a directory 5 minutes late instead?
You also mentioned a directory being created 5 minutes early: what if some system has a clock skewed the opposite way, and puts a message in a directory 5 minutes late instead?