From dd6711f05c57e1e284306ccc9bb6cd6c926cea01 Mon Sep 17 00:00:00 2001 From: Erik Lax Date: Mon, 20 Apr 2020 21:34:33 +0100 Subject: [PATCH] Fix spool space check to account for SIZE. Bug 2552 --- doc/doc-txt/ChangeLog | 5 +++++ src/src/receive.c | 4 ++-- src/src/smtp_in.c | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index edab6a829..3fb7ed8a9 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -167,6 +167,11 @@ JH/35 The dsearch lookup now requires that the directory is an absolute path. JH/36 Bug 2554: Fix msg:defer event for the hosts_max_try_hardlimit case. Previously no event was raised. +JH/37 Bug 2552: Fix the check on spool space during reception to use the SIZE + parameter supplied by the sender MAIL FROM command. Previously it was + ignored, and only the check_spool_space option value for the required + leeway checked. + Exim version 4.93 ----------------- diff --git a/src/src/receive.c b/src/src/receive.c index 2d88d6476..f22816920 100644 --- a/src/src/receive.c +++ b/src/src/receive.c @@ -270,8 +270,8 @@ if (check_spool_space > 0 || msg_size > 0 || check_spool_inodes > 0) "check_space = " PR_EXIM_ARITH "K inodes = %d msg_size = %d\n", space, inodes, check_spool_space, check_spool_inodes, msg_size); - if ((space >= 0 && space < check_spool_space) || - (inodes >= 0 && inodes < check_spool_inodes)) + if ( space >= 0 && space + msg_size / 1024 < check_spool_space + || inodes >= 0 && inodes < check_spool_inodes) { log_write(0, LOG_MAIN, "spool directory space check failed: space=" PR_EXIM_ARITH " inodes=%d", space, inodes); diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c index 2c54a4ccf..1c02eb5c8 100644 --- a/src/src/smtp_in.c +++ b/src/src/smtp_in.c @@ -4861,8 +4861,8 @@ while (done <= 0) and EXPN etc. to be used when space is short. */ if (!receive_check_fs( - (smtp_check_spool_space && message_size >= 0)? - message_size + 5000 : 0)) + smtp_check_spool_space && message_size >= 0 + ? message_size + 5000 : 0)) { smtp_printf("452 Space shortage, please try later\r\n", FALSE); sender_address = NULL; -- 2.25.1