aboutsummaryrefslogtreecommitdiffstats
path: root/smtpd/mail.lmtp.c
diff options
context:
space:
mode:
Diffstat (limited to 'smtpd/mail.lmtp.c')
-rw-r--r--smtpd/mail.lmtp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/smtpd/mail.lmtp.c b/smtpd/mail.lmtp.c
index 685ec504..e6e4fa14 100644
--- a/smtpd/mail.lmtp.c
+++ b/smtpd/mail.lmtp.c
@@ -216,9 +216,11 @@ lmtp_engine(FILE *conn, struct session *session)
enum phase phase = PHASE_BANNER;
do {
+ fflush(conn);
if ((linelen = getline(&line, &linesize, conn)) == -1)
err(1, "getline");
line[strcspn(line, "\n")] = '\0';
+ line[strcspn(line, "\r")] = '\0';
if (linelen < 4 ||
!isdigit(line[0]) ||
@@ -273,9 +275,10 @@ lmtp_engine(FILE *conn, struct session *session)
case PHASE_QUIT:
exit(0);
}
- if (ferror(stdin))
- err(1, "getline");
} while (1);
+
+ if (ferror(conn))
+ err(1, "getline");
}
static void