aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rfc822.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/rfc822.c b/rfc822.c
index e940f700..94b60c7f 100644
--- a/rfc822.c
+++ b/rfc822.c
@@ -48,7 +48,7 @@ const char *host; /* server hostname */
else if (*from == ')')
--parendepth;
- if (!parendepth)
+ if (!parendepth && !has_host_part)
switch (state)
{
case 0: /* before header colon */
@@ -65,8 +65,10 @@ const char *host; /* server hostname */
{
while (isspace(*from))
--from;
+ from++;
while (isspace(*buf))
--buf;
+ buf++;
strcpy(buf, "@");
strcat(buf, host);
buf += strlen(buf);