From d23909af806f8758c851c199e3cda0aa93ac5803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Matijevi=C3=A6?= Date: Fri, 22 Mar 2019 11:40:27 +0100 Subject: [PATCH] Enable delivery to Exchange 2007 IMAP Set env FDM_EXCHANGE_VERSION=2007 to activate workaround --- deliver-imap.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/deliver-imap.c b/deliver-imap.c index f261c51e..142a6fce 100644 --- a/deliver-imap.c +++ b/deliver-imap.c @@ -169,7 +169,7 @@ deliver_imap_deliver(struct deliver_ctx *dctx, struct actitem *ti) struct io *io; struct fetch_ctx fctx; struct fetch_imap_data fdata; - char *cause, *folder, *ptr, *line; + char *cause, *folder, *ptr, *line, *exchange_version; size_t len, maillen; u_int total, body; @@ -235,6 +235,13 @@ deliver_imap_deliver(struct deliver_ctx *dctx, struct actitem *ti) */ count_lines(m, &total, &body); maillen = m->size + total - 1; + exchange_version = getenv("FDM_EXCHANGE_VERSION"); + if (exchange_version != NULL) { + if (strncmp(exchange_version, "2007", strlen(exchange_version)) == 0) { + log_debug2("%s: reducing size by 1 for Exchange %s", a->name, exchange_version); + maillen--; + } + } if (fdata.capa & IMAP_CAPA_XYZZY) { log_debug2("%s: adjusting size: actual %zu", a->name, maillen); maillen = m->size;