diff --git a/src/message.c b/src/message.c index 644929d1..01d9d7cc 100644 --- a/src/message.c +++ b/src/message.c @@ -50,7 +50,7 @@ int store_index_data(struct session_data *sdata, struct parser_state *state, str char a[4*MAXBUFSIZE+4*SMALLBUFSIZE]; char *query=NULL; - snprintf(a, sizeof(a)-1, "INSERT INTO %s (id, arrived, sent, size, direction, folder, attachments, attachment_types, sender, rcpt, senderdomain, rcptdomain, subject, body) VALUES (%llu,%ld,%ld,%d,%d,%d,%d,'%s','", cfg->sphxdb, id, sdata->now, sdata->sent, sdata->tot_len, sdata->direction, data->folder, state->n_attachments, sdata->attachments); + snprintf(a, sizeof(a)-1, "REPLACE INTO %s (id, arrived, sent, size, direction, folder, attachments, attachment_types, sender, rcpt, senderdomain, rcptdomain, subject, body) VALUES (%llu,%ld,%ld,%d,%d,%d,%d,'%s','", cfg->sphxdb, id, sdata->now, sdata->sent, sdata->tot_len, sdata->direction, data->folder, state->n_attachments, sdata->attachments); int ret = append_string_to_buffer(&query, a);