Use a pipe command instead of a temp mbox.
Use tempfile.mkdtemp() to create the temp file.