aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1996-10-18 23:44:13 +0000
committerEric S. Raymond <esr@thyrsus.com>1996-10-18 23:44:13 +0000
commit5c2ad28e251994c41438dc127b77e090f77ad40c (patch)
treefab55216a6f6740b6ced5b9283500fd6c95cf982
parent30ac0cb6ccf032c44c08beda24a3d23472cb4f1a (diff)
downloadfetchmail-5c2ad28e251994c41438dc127b77e090f77ad40c.tar.gz
fetchmail-5c2ad28e251994c41438dc127b77e090f77ad40c.tar.bz2
fetchmail-5c2ad28e251994c41438dc127b77e090f77ad40c.zip
Catch another rewrite case.
svn path=/trunk/; revision=347
-rw-r--r--NEWS2
-rw-r--r--driver.c19
2 files changed, 20 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 3cde1fb0..734d564f 100644
--- a/NEWS
+++ b/NEWS
@@ -40,6 +40,8 @@ bugs --
* --keep no longer overrides --flush.
+* Rewrite "To: jrh (J. Random Hacker)" correctly.
+
fetchmail-1.8 (Fri Oct 11 15:08:10 EDT 1996):
features --
diff --git a/driver.c b/driver.c
index dec8e7e8..8bc214aa 100644
--- a/driver.c
+++ b/driver.c
@@ -102,7 +102,24 @@ const char *host; /* server hostname */
/* If the address token is not properly terminated, ignore it. */
else if (*from == ' ' || *from == '\t')
- state = 1;
+ {
+ const char *cp;
+
+ /*
+ * The only lookahead case. If we're looking at space or tab,
+ * we might be looking at a local name immediately followed
+ * by a human name.
+ */
+ for (cp = from; isspace(*cp); cp++)
+ continue;
+ if (*cp == '(')
+ {
+ strcpy(buf, "@");
+ strcat(buf, host);
+ buf += strlen(buf);
+ state = 1;
+ }
+ }
/*
* On proper termination with no @, insert hostname.