syslog(LOG_DEBUG, "POP3: %s %s %s <password>\n", roomname, pop3host, pop3user);
syslog(LOG_NOTICE, "Connecting to <%s>\n", pop3host);
- if (CtdlThreadCheckStop())
+ if (server_shutting_down)
return;
sock = sock_connect(pop3host, "110");
return;
}
- if (CtdlThreadCheckStop())
+ if (server_shutting_down)
goto bail;
syslog(LOG_DEBUG, "Connected!\n");
syslog(LOG_DEBUG, ">%s\n", buf);
if (strncasecmp(buf, "+OK", 3)) goto bail;
- if (CtdlThreadCheckStop())
+ if (server_shutting_down)
goto bail;
/* Identify ourselves. NOTE: we have to append a CR to each command. The LF will
syslog(LOG_DEBUG, ">%s\n", buf);
if (strncasecmp(buf, "+OK", 3)) goto bail;
- if (CtdlThreadCheckStop())
+ if (server_shutting_down)
goto bail;
/* Password */
syslog(LOG_DEBUG, ">%s\n", buf);
if (strncasecmp(buf, "+OK", 3)) goto bail;
- if (CtdlThreadCheckStop())
+ if (server_shutting_down)
goto bail;
/* Get the list of messages */
syslog(LOG_DEBUG, ">%s\n", buf);
if (strncasecmp(buf, "+OK", 3)) goto bail;
- if (CtdlThreadCheckStop())
+ if (server_shutting_down)
goto bail;
do {
- if (CtdlThreadCheckStop())
+ if (server_shutting_down)
goto bail;
if (sock_getln(&sock, buf, sizeof buf) < 0) goto bail;
snprintf(utmsgid, sizeof utmsgid, "pop3/%s/%s@%s", roomname, this_uidl, pop3host);
- if (CtdlThreadCheckStop())
+ if (server_shutting_down)
goto bail;
cdbut = cdb_fetch(CDB_USETABLE, utmsgid, strlen(utmsgid));
syslog(LOG_DEBUG, ">%s\n", buf);
if (strncasecmp(buf, "+OK", 3)) goto bail;
- if (CtdlThreadCheckStop())
+ if (server_shutting_down)
goto bail;
/* If we get to this point, the message is on its way. Read it. */
FILE *fp;
struct pop3aggr *pptr;
- if (CtdlThreadCheckStop())
+ if (server_shutting_down)
return;
assoc_file_name(filename, sizeof filename, qrbuf, ctdl_netcfg_dir);
syslog(LOG_DEBUG, "pop3client started\n");
CtdlForEachRoom(pop3client_scan_room, NULL);
- while (palist != NULL && !CtdlThreadCheckStop()) {
+ while (palist != NULL && !server_shutting_down) {
if ((palist->interval && time(NULL) > (last_run + palist->interval))
|| (time(NULL) > last_run + config.c_pop3_fetch))
pop3_do_fetching(palist->roomname, palist->pop3host,