aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1998-10-17 14:38:00 +0000
committerEric S. Raymond <esr@thyrsus.com>1998-10-17 14:38:00 +0000
commitb7356877e3484f1bdb40c60dae17b85a365eb434 (patch)
tree7d0b9b8f4d1618de3b2c20966a39f13b5b0deb52
parentb2ae3fb3f3f5ee8aecc07c0991aeb57e2bfffbdb (diff)
downloadfetchmail-b7356877e3484f1bdb40c60dae17b85a365eb434.tar.gz
fetchmail-b7356877e3484f1bdb40c60dae17b85a365eb434.tar.bz2
fetchmail-b7356877e3484f1bdb40c60dae17b85a365eb434.zip
Better diagnostics.
svn path=/trunk/; revision=2101
-rw-r--r--driver.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/driver.c b/driver.c
index f7ffc197..52882b2d 100644
--- a/driver.c
+++ b/driver.c
@@ -238,6 +238,8 @@ static char *parse_received(struct query *ctl, char *bufp)
char *ok = (char *)NULL;
static char rbuf[HOSTLEN + USERNAMELEN + 4];
+ if (outlevel >= O_VERBOSE)
+ error(0, 0, "analyzing Received line:\n%s", bufp);
/*
* Try to extract the real envelope addressee. We look here
* specifically for the mailserver's Received line.
@@ -263,9 +265,22 @@ static char *parse_received(struct query *ctl, char *bufp)
* recipient name after a following "for". Otherwise
* punt.
*/
- if (is_host_alias(rbuf, ctl) &&
- (ok = strstr(sp, "for ")) &&
- isspace(ok[-1]))
+ if (is_host_alias(rbuf, ctl))
+ {
+ if (outlevel >= O_VERBOSE)
+ error(0, 0,
+ "line accepted, %s is an alias of the mailserver", rbuf);
+ }
+ else
+ {
+ if (outlevel >= O_VERBOSE)
+ error(0, 0,
+ "line rejected, %s is not an alias of the mailserver",
+ rbuf);
+ return(NULL);
+ }
+
+ if ((ok = strstr(sp, "for ")) && isspace(ok[-1]))
{
flag want_gt = FALSE;
@@ -301,13 +316,18 @@ static char *parse_received(struct query *ctl, char *bufp)
}
if (!ok)
+ {
+ if (outlevel >= O_VERBOSE)
+ error(0, 0, "no Received address found");
return(NULL);
+ }
else
{
if (outlevel == O_VERBOSE) {
char *lf = rbuf + strlen(rbuf)-1;
*lf = '\0';
- error(0, 0, "found Received address `%s'", rbuf+2);
+ if (outlevel >= O_VERBOSE)
+ error(0, 0, "found Received address `%s'", rbuf+2);
*lf = '\n';
}
return(rbuf);