aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-01-13 17:08:31 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-01-13 17:08:31 +0000
commit345260e086c61c94336611049e0bb5157c46a927 (patch)
tree9fb742e5b85b8020c91d993c71fc3863e033721d
parent8839b46cd7cd1eddfb03a20449de2487bf77536a (diff)
downloadfetchmail-345260e086c61c94336611049e0bb5157c46a927.tar.gz
fetchmail-345260e086c61c94336611049e0bb5157c46a927.tar.bz2
fetchmail-345260e086c61c94336611049e0bb5157c46a927.zip
Can't reproduce NAKANE's problem.
svn path=/trunk/; revision=751
-rw-r--r--rfc822.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/rfc822.c b/rfc822.c
index d4342afb..31bf0c67 100644
--- a/rfc822.c
+++ b/rfc822.c
@@ -35,6 +35,10 @@ const char *host; /* server hostname */
strcpy(mycopy, buf);
for (from = mycopy; *from; from++)
{
+#ifdef FOO
+ printf("state %d: %s", state, mycopy);
+ printf("%*s^\n", from - mycopy + 10, " ");
+#endif /* TESTMAIN */
switch (state)
{
case 0: /* before header colon */
@@ -328,6 +332,7 @@ const char *hdr; /* header to be parsed, NUL to continue previous hdr */
main(int argc, char *argv[])
{
char buf[POPBUFSIZE], *cp;
+ int reply = (argc > 1 && !strcmp(argv[1], "-r"));
while (fgets(buf, sizeof(buf)-1, stdin))
{
@@ -340,11 +345,17 @@ main(int argc, char *argv[])
else
{
fputs(buf, stdout);
- if ((cp = nxtaddr(buf)) != (char *)NULL)
- do {
- printf("\t%s\n", cp);
- } while
- ((cp = nxtaddr((char *)NULL)) != (char *)NULL);
+ if (reply)
+ {
+ reply_hack(buf, "HOSTNAME.NET");
+ printf("Rewritten buffer: %s", buf);
+ }
+ else
+ if ((cp = nxtaddr(buf)) != (char *)NULL)
+ do {
+ printf("\t%s\n", cp);
+ } while
+ ((cp = nxtaddr((char *)NULL)) != (char *)NULL);
}
}