And use the MTA's exit code as our own (so that the various
possible error states are correctly reported to the MUA).
cmd[0] = sendmail
from subprocess import Popen, PIPE
- mailpipe = Popen(cmd, stdin=PIPE).stdin
+ process = Popen(cmd, stdin=PIPE)
+ mailpipe = process.stdin
mailpipe.write( message_string )
- sys.exit( mailpipe.close() )
+ mailpipe.close()
+ sys.exit( process.wait() )
## SUB: print error message
def print_error():