--- qmail-smtpd.c.orig Mon Jun 15 19:53:16 1998 +++ qmail-smtpd.c Fri Jul 23 10:45:11 2004 @@ -39,7 +39,9 @@ char ssoutbuf[512]; substdio ssout = SUBSTDIO_FDBUF(safewrite,1,ssoutbuf,sizeof ssoutbuf); -void flush() { substdio_flush(&ssout); } +static char *throttle; +static atodec(s) char *s; {int x; x = 0; while (x < 214748364 && *s >= '0' && *s <= '9') x = x * 10 + *s++ - '0'; return x; } +void flush() { if (throttle && *throttle) { int x; x = atodec(throttle); sleep(x ? x : 10); } substdio_flush(&ssout); } void out(s) char *s; { substdio_puts(&ssout,s); } void die_read() { _exit(1); } @@ -131,6 +133,7 @@ if (!remotehost) remotehost = "unknown"; remoteinfo = env_get("TCPREMOTEINFO"); relayclient = env_get("RELAYCLIENT"); + throttle = env_get("THROTTLE"); dohelo(remotehost); }