int pass; /* how many times have we re-polled? */
int stage; /* where are we? */
int phase; /* where are we, for error-logging purposes? */
+int mytimeout; /* value of nonreponse timeout */
static const struct method *protocol;
static jmp_buf restart;
#define GENSYM (sprintf(tag, "A%04d", ++tagnum % TAGMOD), tag)
static char shroud[PASSWORDLEN]; /* string to shroud in debug output */
-static int mytimeout; /* value of nonreponse timeout */
static int timeoutcount; /* count consecutive timeouts */
static int msglen; /* actual message length */
resent_sender_offs = (line - msgblk.headers);
#ifdef __UNUSED__
- else if (!strncasecmp("Message-Id:", buf, 11))
+ else if (!strncasecmp("Message-Id:", line, 11))
{
if (ctl->server.uidl)
{
char id[IDLEN+1];
- buf[IDLEN+12] = 0; /* prevent stack overflow */
- sscanf(buf+12, "%s", id);
+ line[IDLEN+12] = 0; /* prevent stack overflow */
+ sscanf(line+12, "%s", id);
if (!str_find( &ctl->newsaved, num))
{
struct idlist *new = save_str(&ctl->newsaved,id,UID_SEEN);
/*
* If we've exceeded our threshold for consecutive timeouts,
* try to notify the user, then mark the connection wedged.
+ * Don't do this if the connection can idle, though; idle
+ * timeouts just mean the frequency of mail is low.
*/
if (timeoutcount > MAX_TIMEOUTS
&& !open_warning_by_mail(ctl, (struct msgblk *)NULL))
dispatches = 0;
++pass;
+ /* reset timeout, in case we did an IDLE */
+ mytimeout = ctl->server.timeout;
+
if (outlevel >= O_DEBUG)
{
if (idp->id)
if (new == -1 || ctl->fetchall)
new = count;
fetches = new; /* set error status ccorrectly */
- goto no_error;
+ /*
+ * There used to be a `got noerror' here, but this
+ * prevneted checking of multiple folders. This
+ * comment is a reminder in case I introduced some
+ * subtle bug by removing it...
+ */
}
else if (count > 0)
{
}
} while
/*
- * Only re-poll if we had some actual forwards, allowed
- * deletions and had no errors.
+ * Only re-poll if we either had some actual forwards and
+ * either allowed deletions and had no errors.
* Otherwise it is far too easy to get into infinite loops.
*/
(dispatches && protocol->retry && !ctl->keep && !ctl->errcount);