- print " %s %s:%u: %s" %(x[2],x[0],x[1],x[3]);
- sys.exit(ErrType);
+ Trace = Trace + " %s %s:%u: %s\n" %(x[2],x[0],x[1],x[3]);
+
+ Subst["__TRACE__"] = Trace;
+
+ # Try to send the bounce
+ try:
+ ErrReply = TemplateSubst(Subst,open(TemplatesDir+"error-reply","r").read());
+
+ Child = posix.popen("/usr/sbin/sendmail -t","w");
+ Child.write(ErrReplyHead);
+ Child.write(ErrReply);
+ if Child.close() != None:
+ raise Error, "Sendmail gave a non-zero return code";
+ except:
+ sys.exit(EX_TEMPFAIL);
+
+ if ErrType != EX_PERMFAIL:
+ sys.exit(ErrType);
+ sys.exit(0);