aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--driver.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/driver.c b/driver.c
index 563a68ba..b1fa4bf4 100644
--- a/driver.c
+++ b/driver.c
@@ -493,11 +493,25 @@ static int fetch_messages(int mailserver_socket, struct query *ctl,
err = readheaders(mailserver_socket, len, msgsizes[num-1],
ctl, num);
if (err == PS_RETAINED)
- suppress_readbody = suppress_forward = suppress_delete = retained = TRUE;
+ {
+ suppress_forward = suppress_delete = retained = TRUE;
+ /* do not read the body only if the underlying protocol
+ * allows the body to be fetched separately */
+ if (ctl->server.base_protocol->fetch_body)
+ suppress_readbody = TRUE;
+ }
else if (err == PS_TRANSIENT)
+ {
suppress_delete = suppress_forward = TRUE;
+ if (ctl->server.base_protocol->fetch_body)
+ suppress_readbody = TRUE;
+ }
else if (err == PS_REFUSED)
+ {
suppress_forward = TRUE;
+ if (ctl->server.base_protocol->fetch_body)
+ suppress_readbody = TRUE;
+ }
#if 0
/*
* readheaders does not read the body when it