Index: contrib/dma/mail.c =================================================================== --- contrib/dma/mail.c +++ contrib/dma/mail.c @@ -405,10 +405,7 @@ if ((ssize_t)error < 0) return (-1); - while (!feof(stdin)) { - newline[0] = '\0'; - if ((linelen = getline(&line, &linecap, stdin)) <= 0) - break; + while ((linelen = getline(&line, &linecap, stdin)) > 0) { if (had_last_line) errlogx(EX_DATAERR, "bad mail input format:" " from %s (uid %d) (envelope-from %s)", @@ -510,8 +507,8 @@ } } } - - ret = 0; + if (errno == 0) + ret = 0; fail: free(line); return (ret);