mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 07:30:12 +01:00
added a queue id to piler-smtp
Change-Id: Id616c31c709ccc3e986c7cbe46f23ec927efa5df Signed-off-by: SJ <sj@acts.hu>
This commit is contained in:
parent
4e5ded4da9
commit
37d4babd38
@ -35,6 +35,7 @@
|
||||
#define RANDOM_POOL "/dev/urandom"
|
||||
#define RND_STR_LEN 36
|
||||
#define BUFLEN 32
|
||||
#define QUEUE_ID_LEN 16
|
||||
#define IPLEN 16+1
|
||||
#define KEYLEN 56
|
||||
|
||||
|
@ -299,7 +299,7 @@ int extractEmail(char *rawmail, char *email){
|
||||
|
||||
void make_random_string(char *buf, int buflen){
|
||||
int i, len;
|
||||
static char alphanum[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
static char alphanum[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||
|
||||
len = strlen(alphanum);
|
||||
|
||||
|
@ -105,7 +105,6 @@ int process_email(char *filename, struct session_data *sdata, struct __data *dat
|
||||
sdata->tot_len = size;
|
||||
|
||||
snprintf(sdata->filename, SMALLBUFSIZE-1, "%s", filename);
|
||||
snprintf(sdata->ttmpfile, SMALLBUFSIZE-1, "%s", filename);
|
||||
|
||||
parser_state = parse_message(sdata, 1, data, cfg);
|
||||
post_parse(sdata, &parser_state, cfg);
|
||||
@ -157,9 +156,9 @@ int process_email(char *filename, struct session_data *sdata, struct __data *dat
|
||||
|
||||
gettimeofday(&tv2, &tz);
|
||||
|
||||
syslog(LOG_PRIORITY, "%s: size=%d/%d, attachments=%d, reference=%s, "
|
||||
syslog(LOG_PRIORITY, "%s: piler-id=%s, size=%d/%d, attachments=%d, reference=%s, "
|
||||
"message-id=%s, retention=%d, folder=%d, delay=%.4f, status=%s",
|
||||
filename, sdata->tot_len, sdata->stored_len,
|
||||
filename, sdata->ttmpfile, sdata->tot_len, sdata->stored_len,
|
||||
parser_state.n_attachments, parser_state.reference, parser_state.message_id,
|
||||
parser_state.retention, data->folder, tvdiff(tv2,tv1)/1000000.0, status);
|
||||
|
||||
|
@ -223,7 +223,8 @@ void process_command_mail_from(struct smtp_session *session, char *buf){
|
||||
send(session->socket, SMTP_RESP_503_ERR, strlen(SMTP_RESP_503_ERR), 0);
|
||||
}
|
||||
else {
|
||||
create_id(&(session->ttmpfile[0]), 15);
|
||||
memset(&(session->ttmpfile[0]), 0, SMALLBUFSIZE);
|
||||
make_random_string(&(session->ttmpfile[0]), QUEUE_ID_LEN);
|
||||
session->protocol_state = SMTP_STATE_MAIL_FROM;
|
||||
|
||||
extractEmail(buf, session->mailfrom);
|
||||
@ -314,6 +315,6 @@ void process_command_reset(struct smtp_session *session){
|
||||
|
||||
reset_bdat_counters(session);
|
||||
|
||||
create_id(&(session->ttmpfile[0]), 15);
|
||||
memset(&(session->ttmpfile[0]), 0, SMALLBUFSIZE);
|
||||
make_random_string(&(session->ttmpfile[0]), QUEUE_ID_LEN);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user