void smtp_get_pass(char *argbuf) {
char password[SIZ];
+ memset(password, 0, sizeof(password));
CtdlDecodeBase64(password, argbuf, SIZ);
/* CtdlLogPrintf(CTDL_DEBUG, "Trying <%s>\n", password); */
if (CtdlTryPassword(password) == pass_ok) {
datestring(nowstamp, sizeof nowstamp, time(NULL), DATESTRING_RFC822);
body = malloc(4096);
- if (body != NULL) snprintf(body, 4096,
- "Received: from %s (%s [%s])\n"
- " by %s; %s\n",
- SMTP->helo_node,
- CC->cs_host,
- CC->cs_addr,
- config.c_fqdn,
- nowstamp);
-
+ if (body != NULL) {
+ if (SMTP->is_lmtp && (CC->cs_UDSclientUID != -1)) {
+ snprintf(body, 4096,
+ "Received: from %s (Citadel from userid %ld)\n"
+ " by %s; %s\n",
+ SMTP->helo_node,
+ CC->cs_UDSclientUID,
+ config.c_fqdn,
+ nowstamp);
+ }
+ else {
+ snprintf(body, 4096,
+ "Received: from %s (%s [%s])\n"
+ " by %s; %s\n",
+ SMTP->helo_node,
+ CC->cs_host,
+ CC->cs_addr,
+ config.c_fqdn,
+ nowstamp);
+ }
+ }
body = CtdlReadMessageBody(".", config.c_maxmsglen, body, 1, 0);
if (body == NULL) {
cprintf("550 Unable to save message: internal error.\r\n");
*/
void smtp_do_queue(void) {
static int doing_queue = 0;
+ int num_processed = 0;
/*
* This is a simple concurrency check to make sure only one queue run
CtdlLogPrintf(CTDL_ERR, "Cannot find room <%s>\n", SMTP_SPOOLOUT_ROOM);
return;
}
- CtdlForEachMessage(MSGS_ALL, 0L, NULL,
- SPOOLMIME, NULL, smtp_do_procmsg, NULL);
+ num_processed = CtdlForEachMessage(MSGS_ALL, 0L, NULL, SPOOLMIME, NULL, smtp_do_procmsg, NULL);
- CtdlLogPrintf(CTDL_INFO, "SMTP client: queue run completed\n");
+ CtdlLogPrintf(CTDL_INFO, "SMTP client: queue run completed; %d messages processed\n", num_processed);
run_queue_now = 0;
doing_queue = 0;
}