I have, on occasion, had need to manually drop an email into a users inbox. For example, when an over-zealous virus scanner dumps mail into “quarantine”.
After confirming that the email are, in fact, virus free, the emails are able to be injected into the users maildir with the help of safecat, which guarantees atomic copying (even from a slow standard input stream) and unique file naming.
The basic format of the command is:
1 2 3 4
with the only restriction being that tmp_dir must be on the same file system, as the algorithm uses hard links to guarantee instant availability of the complete file.