summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2016-09-28 19:41:08 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2016-09-28 22:02:50 +0100
commitddf1b11a732e293cd242c80bc63d459dda595bf4 (patch)
tree62ef610c900c492f332fe511547eeae1ce8900e8 /src
parent60d10ce7e68a5f2cf771a5c079521c8e4f18d157 (diff)
Default to filesystem space/inode checking enabled
Diffstat (limited to 'src')
-rw-r--r--src/src/globals.c8
-rw-r--r--src/src/receive.c21
2 files changed, 18 insertions, 11 deletions
diff --git a/src/src/globals.c b/src/src/globals.c
index cb71a6094..631e1d61c 100644
--- a/src/src/globals.c
+++ b/src/src/globals.c
@@ -488,11 +488,11 @@ int callout_cache_positive_expire = 24*60*60;
int callout_cache_negative_expire = 2*60*60;
uschar *callout_random_local_part = US"$primary_hostname-$tod_epoch-testing";
uschar *check_dns_names_pattern= US"(?i)^(?>(?(1)\\.|())[^\\W](?>[a-z0-9/_-]*[^\\W])?)+(\\.?)$";
-int check_log_inodes = 0;
-int check_log_space = 0;
+int check_log_inodes = 100;
+int check_log_space = 10*1024; /* 10K Kbyte == 10MB */
BOOL check_rfc2047_length = TRUE;
-int check_spool_inodes = 0;
-int check_spool_space = 0;
+int check_spool_inodes = 100;
+int check_spool_space = 10*1024; /* 10K Kbyte == 10MB */
uschar *chunking_advertise_hosts = US"*";
unsigned chunking_datasize = 0;
diff --git a/src/src/receive.c b/src/src/receive.c
index 51ce2844e..e53587619 100644
--- a/src/src/receive.c
+++ b/src/src/receive.c
@@ -124,6 +124,7 @@ receive_statvfs(BOOL isspool, int *inodeptr)
{
#ifdef HAVE_STATFS
struct STATVFS statbuf;
+struct stat dummy;
uschar *path;
uschar *name;
uschar buffer[1024];
@@ -180,12 +181,18 @@ else
memset(&statbuf, 0, sizeof(statbuf));
if (STATVFS(CS path, &statbuf) != 0)
- {
- log_write(0, LOG_MAIN|LOG_PANIC, "cannot accept message: failed to stat "
- "%s directory %s: %s", name, spool_directory, strerror(errno));
- smtp_closedown(US"spool or log directory problem");
- exim_exit(EXIT_FAILURE);
- }
+ if (stat(CS path, &dummy) == -1 && errno == ENOENT)
+ { /* Can happen on first run after installation */
+ *inodeptr = -1;
+ return -1;
+ }
+ else
+ {
+ log_write(0, LOG_MAIN|LOG_PANIC, "cannot accept message: failed to stat "
+ "%s directory %s: %s", name, path, strerror(errno));
+ smtp_closedown(US"spool or log directory problem");
+ exim_exit(EXIT_FAILURE);
+ }
*inodeptr = (statbuf.F_FILES > 0)? statbuf.F_FAVAIL : -1;
@@ -193,9 +200,9 @@ if (STATVFS(CS path, &statbuf) != 0)
return (int)(((double)statbuf.F_BAVAIL * (double)statbuf.F_FRSIZE)/1024.0);
+#else
/* Unable to find partition sizes in this environment. */
-#else
*inodeptr = -1;
return -1;
#endif