From d314a606b21937ba00a442da44e972db010074eb Mon Sep 17 00:00:00 2001 From: SJ Date: Fri, 28 Oct 2016 22:37:12 +0200 Subject: [PATCH] move email fix Change-Id: Ie9754cae0d08c6717069cff2d6c93443f5e48066 Signed-off-by: SJ --- src/misc.c | 2 +- src/smtp.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/misc.c b/src/misc.c index f08dd239..3eeaa7a1 100644 --- a/src/misc.c +++ b/src/misc.c @@ -666,7 +666,7 @@ int can_i_write_current_directory(){ void move_email(struct smtp_session *session){ char buf[SMALLBUFSIZE]; - snprintf(buf, sizeof(buf)-1, "%d/%s", session->ttmpfile[RND_STR_LEN-1] % session->cfg->number_of_worker_processes, session->ttmpfile); + snprintf(buf, sizeof(buf)-1, "%d/%s", session->ttmpfile[0] % session->cfg->number_of_worker_processes, session->ttmpfile); if(rename(session->ttmpfile, buf)){ syslog(LOG_PRIORITY, "ERROR: couldn't rename %s to %s", session->ttmpfile, buf); diff --git a/src/smtp.c b/src/smtp.c index 9b38965f..2770fa4e 100644 --- a/src/smtp.c +++ b/src/smtp.c @@ -89,8 +89,6 @@ void process_data(struct smtp_session *session, char *readbuf, int readlen){ pos = searchStringInBuffer(&puf[0], len, SMTP_CMD_PERIOD, 5); if(pos > 0){ - //write(session->fd, puf, pos+2); - //session->tot_len += pos+2; write(session->fd, puf, pos); session->tot_len += pos; process_command_period(session);