From 697cf08135884f8f2052a2a497b39d5ebbcc88e3 Mon Sep 17 00:00:00 2001 From: Ali Gholami Rudi Date: Mon, 18 Jan 2010 18:49:26 +0330 Subject: [PATCH] pop3: escape From_ lines --- pop3.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pop3.c b/pop3.c index 3da801e..29738a7 100644 --- a/pop3.c +++ b/pop3.c @@ -260,6 +260,13 @@ static char *put_from_(char *s) return s; } +static int lone_from(char *s) +{ + while (*s == '>') + s++; + return !strncmp("From ", s, 5); +} + static int ret_mail(int i) { char mail[MAXSIZE]; @@ -282,6 +289,8 @@ static int ret_mail(int i) hdr = 0; if (hdr && !dst) dst = mail_dst(line, len); + if (lone_from(line)) + *s++ = '>'; s = putmem(s, line, len); } *s++ = '\n'; -- 2.11.4.GIT