From 1e573957efc1e687d0dbf45ad4e002c6040f7b64 Mon Sep 17 00:00:00 2001 From: trisk Date: Sun, 8 Jul 2007 12:30:04 +0000 Subject: [PATCH] Generate a Message-Id if the an email did not include one, to prevent crashing the store on import. --- src/agents/store/mail.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/agents/store/mail.c b/src/agents/store/mail.c index 3b4bab0..86afd2c 100644 --- a/src/agents/store/mail.c +++ b/src/agents/store/mail.c @@ -300,6 +300,11 @@ StoreProcessIncomingMail(StoreClient *client, if (data.messageId) { info->data.mail.messageId = BongoMemStackPushStr(&client->memstack, data.messageId); + } else { + info->data.mail.messageId = + BONGO_MEMSTACK_ALLOC(&client->memstack, MAXEMAILNAMESIZE + 1); + snprintf(info->data.mail.messageId, MAXEMAILNAMESIZE + 1, "%u.%llu@%s", + info->timeCreatedUTC, info->guid, StoreAgent.agent.officialName); } if (data.parentMessageId) { info->data.mail.parentMessageId =