smtp: add 'body-md5' mime option

This option will allow the user to select weither or not he wants
to journalize the md5 of the mail body.
pull/1667/head
Eric Leblond 11 years ago
parent ea311c1594
commit 9900558428

@ -220,7 +220,7 @@ SCEnumCharMap smtp_reply_map[ ] = {
};
/* Create SMTP config structure */
SMTPConfig smtp_config = { 0, { 0, 0, 0, 0 }, 0, 0, 0};
SMTPConfig smtp_config = { 0, { 0, 0, 0, 0, 0 }, 0, 0, 0};
static SMTPString *SMTPStringAlloc(void);
@ -266,6 +266,11 @@ static void SMTPConfigure(void) {
if (ret) {
smtp_config.mime_config.extract_urls = val;
}
ret = ConfGetChildValueBool(config, "body-md5", &val);
if (ret) {
smtp_config.mime_config.body_md5 = val;
}
}
/* Pass mime config data to MimeDec API */

@ -79,7 +79,7 @@
#define MAX_IP6_CHARS 39
/* Globally hold configuration data */
static MimeDecConfig mime_dec_config = { 1, 1, 1, MAX_HEADER_VALUE };
static MimeDecConfig mime_dec_config = { 1, 1, 1, 0, MAX_HEADER_VALUE };
#ifdef DEBUG
/* Mime Parser String translation */
@ -2182,7 +2182,7 @@ static int ProcessMimeBody(const uint8_t *buf, uint32_t len,
uint32_t tlen;
#ifdef HAVE_NSS
if (state->body_begin == 1 && (state->md5_ctx == NULL)) {
if (MimeDecGetConfig()->body_md5 && state->body_begin == 1 && (state->md5_ctx == NULL)) {
state->md5_ctx = HASH_Create(HASH_AlgMD5);
if (state->md5_ctx != NULL) {
HASH_Begin(state->md5_ctx);

@ -97,6 +97,7 @@ typedef struct MimeDecConfig {
int decode_base64; /**< Decode base64 bodies */
int decode_quoted_printable; /**< Decode quoted-printable bodies */
int extract_urls; /**< Extract and store URLs in data structure */
int body_md5; /**< Compute md5 sum of body */
uint32_t header_value_depth; /**< Depth of which to store header values
(Default is 2000) */
} MimeDecConfig;

Loading…
Cancel
Save