int clamhost;
char *msgtext;
size_t msglen;
+ CitContext *CCC;
/* Don't care if you're logged in. You can still spread viruses.
*/
*/
return(0);
}
+ CCC=CC;
+ CCC->sReadBuf = NewStrBuf();
+ CCC->sMigrateBuf = NewStrBuf();
+ CCC->sPos = NULL;
/* Command */
CtdlLogPrintf(CTDL_DEBUG, "Transmitting STREAM command\n");
/* If the service isn't running, just pass the mail
* through. Potentially throwing away mails isn't good.
*/
+ FreeStrBuf(&CCC->sReadBuf);
+ FreeStrBuf(&CCC->sMigrateBuf);
return(0);
}
else {
}
bail: close(sock);
+ FreeStrBuf(&CCC->sReadBuf);
+ FreeStrBuf(&CCC->sMigrateBuf);
return(is_virus);
}
char buf[SIZ];
char err_buf[SIZ];
char connected_to[SIZ];
+ CitContext *CCC=CC;
if (network_talking_to(node, NTT_CHECK)) return;
network_talking_to(node, NTT_ADD);
}
CtdlLogPrintf(CTDL_DEBUG, "Connected!\n");
-
+ CCC->sReadBuf = NewStrBuf();
+ CCC->sMigrateBuf = NewStrBuf();
+ CCC->sPos = NULL;
/* Read the server greeting */
if (sock_getln(&sock, buf, sizeof buf) < 0) goto bail;
CtdlLogPrintf(CTDL_DEBUG, ">%s\n", buf);
sock_puts(&sock, "QUIT");
bail:
+ FreeStrBuf(&CCC->sReadBuf);
+ FreeStrBuf(&CCC->sMigrateBuf);
if (sock != -1)
sock_close(sock);
network_talking_to(node, NTT_REMOVE);
char utmsgid[SIZ];
struct cdbdata *cdbut;
struct UseTable ut;
+ CitContext *CCC=CC;
CtdlLogPrintf(CTDL_DEBUG, "POP3: %s %s %s <password>\n", roomname, pop3host, pop3user);
CtdlLogPrintf(CTDL_NOTICE, "Connecting to <%s>\n", pop3host);
goto bail;
CtdlLogPrintf(CTDL_DEBUG, "Connected!\n");
+ CCC->sReadBuf = NewStrBuf();
+ CCC->sMigrateBuf = NewStrBuf();
+ CCC->sPos = NULL;
/* Read the server greeting */
if (sock_getln(&sock, buf, sizeof buf) < 0) goto bail;
if (sock_getln(&sock, buf, sizeof buf) < 0) goto bail;
CtdlLogPrintf(CTDL_DEBUG, ">%s\n", buf);
bail:
+ FreeStrBuf(&CCC->sReadBuf);
+ FreeStrBuf(&CCC->sMigrateBuf);
+
if (sock != -1)
sock_close(sock);
if (msglist) free(msglist);
char *ptr;
size_t msg_size;
int scan_done;
+ CitContext *CCC=CC;
/* Parse out the host portion of the recipient address */
user, node, name);
/* Load the message out of the database */
- CC->redirect_buffer = malloc(SIZ);
- CC->redirect_len = 0;
- CC->redirect_alloc = SIZ;
+ CCC->redirect_buffer = malloc(SIZ);
+ CCC->redirect_len = 0;
+ CCC->redirect_alloc = SIZ;
CtdlOutputMsg(msgnum, MT_RFC822, HEADERS_ALL, 0, 1, NULL, ESC_DOT);
msgtext = CC->redirect_buffer;
msg_size = CC->redirect_len;
- CC->redirect_buffer = NULL;
- CC->redirect_len = 0;
- CC->redirect_alloc = 0;
+ CCC->redirect_buffer = NULL;
+ CCC->redirect_len = 0;
+ CCC->redirect_alloc = 0;
/* If no envelope_from is supplied, extract one from the message */
if ( (envelope_from == NULL) || (IsEmptyStr(envelope_from)) ) {
return;
}
+ CCC->sReadBuf = NewStrBuf();
+ CCC->sMigrateBuf = NewStrBuf();
+ CCC->sPos = NULL;
+
/* Process the SMTP greeting from the server */
if (ml_sock_gets(&sock, buf) < 0) {
*status = 4;
user, node, name);
bail: free(msgtext);
+ FreeStrBuf(&CCC->sReadBuf);
+ FreeStrBuf(&CCC->sMigrateBuf);
if (sock != -1)
sock_close(sock);
int sa;
char *msgtext;
size_t msglen;
+ CitContext *CCC=CC;
/* For users who have authenticated to this server we never want to
* apply spam filtering, because presumably they're trustworthy.
return(0);
}
+ CCC->sReadBuf = NewStrBuf();
+ CCC->sMigrateBuf = NewStrBuf();
+ CCC->sPos = NULL;
+
/* Command */
CtdlLogPrintf(CTDL_DEBUG, "Transmitting command\n");
sprintf(buf, "CHECK SPAMC/1.2\r\n\r\n");
sock_write(&sock, buf, strlen(buf));
/* Message */
- CC->redirect_buffer = malloc(SIZ);
- CC->redirect_len = 0;
- CC->redirect_alloc = SIZ;
+ CCC->redirect_buffer = malloc(SIZ);
+ CCC->redirect_len = 0;
+ CCC->redirect_alloc = SIZ;
CtdlOutputPreLoadedMsg(msg, MT_RFC822, HEADERS_ALL, 0, 1, 0);
msgtext = CC->redirect_buffer;
msglen = CC->redirect_len;
- CC->redirect_buffer = NULL;
- CC->redirect_len = 0;
- CC->redirect_alloc = 0;
+ CCC->redirect_buffer = NULL;
+ CCC->redirect_len = 0;
+ CCC->redirect_alloc = 0;
sock_write(&sock, msgtext, msglen);
free(msgtext);
}
bail: close(sock);
+ FreeStrBuf(&CCC->sReadBuf);
+ FreeStrBuf(&CCC->sMigrateBuf);
return(is_spam);
}