- Child = os.popen("/usr/sbin/sendmail -t", "w")
- Child.write(ErrReplyHead)
- Child.write(ErrReply)
- if Child.close() is not None:
+ Child = subprocess.Popen(['/usr/sbin/sendmail', '-t'], stdin=subprocess.PIPE)
+ Child.stdin.write(ErrReplyHead)
+ Child.stdin.write(ErrReply)
+ Child.stdin.close()
+ if Child.wait() != 0: