aboutsummaryrefslogtreecommitdiffstats
path: root/odmr.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2002-10-18 11:39:25 +0000
committerEric S. Raymond <esr@thyrsus.com>2002-10-18 11:39:25 +0000
commite310f7cf0015c64b1a100472e04bb83d64bf6a4f (patch)
treee3f28e2a18b2b61bfcd8461d3f45ce4333430a4a /odmr.c
parentc6667a5a2aa4895596a76fc0aeb68f37a322bc44 (diff)
downloadfetchmail-e310f7cf0015c64b1a100472e04bb83d64bf6a4f.tar.gz
fetchmail-e310f7cf0015c64b1a100472e04bb83d64bf6a4f.tar.bz2
fetchmail-e310f7cf0015c64b1a100472e04bb83d64bf6a4f.zip
ODMR verbosity fix.
svn path=/trunk/; revision=3741
Diffstat (limited to 'odmr.c')
-rw-r--r--odmr.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/odmr.c b/odmr.c
index 76891681..6b89ef9c 100644
--- a/odmr.c
+++ b/odmr.c
@@ -48,6 +48,7 @@ static int odmr_getrange(int sock, struct query *ctl, const char *id,
/* send ODMR and then run a reverse SMTP session */
{
int ok, opts, smtp_sock;
+ int doing_smtp_data = 0; /* Are we in SMTP DATA state? */
char buf [MSGBUFSIZE+1];
struct idlist *qnp; /* pointer to Q names */
@@ -165,7 +166,7 @@ static int odmr_getrange(int sock, struct query *ctl, const char *id,
break;
SockWrite(smtp_sock, buf, n);
- if (outlevel >= O_MONITOR)
+ if (outlevel >= O_MONITOR && !doing_smtp_data)
report(stdout, "ODMR< %s", buf);
}
if (FD_ISSET(smtp_sock, &readfds))
@@ -177,6 +178,16 @@ static int odmr_getrange(int sock, struct query *ctl, const char *id,
SockWrite(sock, buf, n);
if (outlevel >= O_MONITOR)
report(stdout, "ODMR> %s", buf);
+
+ /* We are about to receive message data if the local MTA
+ * sends 354 (after receiving DATA) */
+ if (!doing_smtp_data && !strncmp(buf, "354", 3))
+ {
+ doing_smtp_data = 1;
+ report(stdout, "receiving message data\n");
+ }
+ else if (doing_smtp_data)
+ doing_smtp_data = 0;
}
}
SockClose(smtp_sock);