added x-envelop-to: support to see the envelope recipient address

This commit is contained in:
SJ
2012-11-27 13:16:30 +01:00
parent 24672a02a1
commit 94a3e2d78b
5 changed files with 18 additions and 1 deletions

View File

@ -67,6 +67,7 @@ struct _parse_rule config_parse_rules[] =
{ "clamd_socket", "string", (void*) string_parser, offsetof(struct __config, clamd_socket), CLAMD_SOCKET, MAXVAL-1},
{ "debug", "integer", (void*) int_parser, offsetof(struct __config, debug), "0", sizeof(int)},
{ "default_retention_days", "integer", (void*) int_parser, offsetof(struct __config, default_retention_days), "2557", sizeof(int)},
{ "extra_to_field", "string", (void*) string_parser, offsetof(struct __config, extra_to_field), "", MAXVAL-1},
{ "hostid", "string", (void*) string_parser, offsetof(struct __config, hostid), HOSTID, MAXVAL-1},
{ "iv", "string", (void*) string_parser, offsetof(struct __config, iv), "", MAXVAL-1},
{ "listen_addr", "string", (void*) string_parser, offsetof(struct __config, listen_addr), "127.0.0.1", MAXVAL-1},

View File

@ -43,6 +43,7 @@ struct __config {
int session_timeout;
char piler_header_field[MAXVAL];
char extra_to_field[MAXVAL];
unsigned char key[KEYLEN];
unsigned char iv[MAXVAL];

View File

@ -13,7 +13,7 @@
#define VERSION "0.1.22"
#define BUILD 727
#define BUILD 728
#define HOSTID "mailarchiver"

View File

@ -348,6 +348,7 @@ int parse_line(char *buf, struct _state *state, struct session_data *sdata, int
else if(strncasecmp(buf, "Recipient:", strlen("Recipient:")) == 0) state->message_state = MSG_RECIPIENT;
else if(strncasecmp(buf, "Date:", strlen("Date:")) == 0 && sdata->sent == 0) sdata->sent = parse_date_header(buf);
else if(strncasecmp(buf, "Received:", strlen("Received:")) == 0) state->message_state = MSG_RECEIVED;
else if(cfg->extra_to_field[0] != '\0' && strncasecmp(buf, cfg->extra_to_field, strlen(cfg->extra_to_field)) == 0) state->message_state = MSG_TO;
if(state->message_state == MSG_MESSAGE_ID && state->message_id[0] == 0){
p = strchr(buf+11, ' ');