karl@sugar.hackercorp.com (Karl Lehenbauer) (10/14/89)
When smail 2.5 bounces a message, it bounces the whole thing, which can be
awfully big. This trivial patch causes smail to only print the first
twenty or so lines of the message.
*** deliver.c.orig Sat Oct 14 00:58:55 1989
--- deliver.c Sat Oct 14 00:58:48 1989
***************
*** 472,477
** Copy input.
*/
(void) fprintf(out, "From %s\n", from);
while(fgets(buf, sizeof(buf), spoolfp) != NULL) {
(void) fputs(buf, out);
}
--- 472,478 -----
** Copy input.
*/
(void) fprintf(out, "From %s\n", from);
+ i = 0;
while(fgets(buf, sizeof(buf), spoolfp) != NULL) {
(void) fputs(buf, out);
if (i++ > 20) {
***************
*** 474,479
(void) fprintf(out, "From %s\n", from);
while(fgets(buf, sizeof(buf), spoolfp) != NULL) {
(void) fputs(buf, out);
}
(void) pclose(out);
}
--- 475,484 -----
i = 0;
while(fgets(buf, sizeof(buf), spoolfp) != NULL) {
(void) fputs(buf, out);
+ if (i++ > 20) {
+ (void) fprintf(out, "======= remainder of message truncated =======\n");
+ break;
+ }
}
(void) pclose(out);
}
--
-- uunet!sugar!karl "There is hopeful symbolism in the fact that
-- flags do not wave in a vacuum." -- Arthur C. Clarke
-- Usenet access: (713) 438-5018