Re: [EXIM] check_spool_space not working?

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: Karsten Thygesen
Data:  
Para: exim-users
Assunto: Re: [EXIM] check_spool_space not working?
>>>>> "Karsten" == Karsten Thygesen <karthy@???> writes:

Karsten> Hi

Karsten> I have now tried both 2.01 and 2.05, nut I can't make any of
Karsten> them accept the check_spool_space option.

Karsten> I have defined:

Karsten> check_spool_space = 100M check_spool_inodes = 100

It seems (from reading accept.c) that exim is using the bfree ffree
vfstat entries. Is that the right way to do it? The favail and bavail
returns the files/space available *to non root users* which is what I
would expect to be measured in /var/mail. If the disk is 100% full (to
normal users) there is no point in storing more messages.

I have made a little patch (against 2.05), and now it works as I would
expect.

Best
Karsten

*** accept.c~    Thu Oct  8 12:00:08 1998
--- accept.c    Mon Nov 30 13:29:28 1998
***************
*** 65,75 ****
  if (check_spool_space > 0 || msg_size > 0 || check_spool_inodes > 0)
    {
    if (STATVFS(spool_directory, &statbuf) != 0 ||
!       statbuf.f_bfree < (check_spool_space + msg_size) / statbuf.F_FRSIZE ||
!       statbuf.f_ffree < check_spool_inodes) rc = FALSE;
    DEBUG(5) debug_printf("spool directory %s space = %d blocks; inodes = %d; "
      "check_space = %d (%d blocks); inodes = %d; msg_size = %d (%d blocks)\n",
!     spool_directory, statbuf.f_bfree, statbuf.f_ffree, check_spool_space,
      check_spool_space / statbuf.F_FRSIZE, check_spool_inodes,
      msg_size, msg_size / statbuf.F_FRSIZE);
    if (!rc) return FALSE;
--- 65,75 ----
  if (check_spool_space > 0 || msg_size > 0 || check_spool_inodes > 0)
    {
    if (STATVFS(spool_directory, &statbuf) != 0 ||
!       statbuf.f_bavail < (check_spool_space + msg_size) / statbuf.F_FRSIZE ||
!       statbuf.f_favail < check_spool_inodes) rc = FALSE;
    DEBUG(5) debug_printf("spool directory %s space = %d blocks; inodes = %d; "
      "check_space = %d (%d blocks); inodes = %d; msg_size = %d (%d blocks)\n",
!     spool_directory, statbuf.f_bavail, statbuf.f_favail, check_spool_space,
      check_spool_space / statbuf.F_FRSIZE, check_spool_inodes,
      msg_size, msg_size / statbuf.F_FRSIZE);
    if (!rc) return FALSE;
***************
*** 95,107 ****
      }


    if (STATVFS(path, &statbuf) != 0 ||
!       statbuf.f_bfree < check_log_space / statbuf.F_FRSIZE ||
!       statbuf.f_ffree < check_log_inodes) rc = FALSE;


    DEBUG(5) debug_printf("log directory %s space = %d blocks; inodes = %d; "
      "check_space = %d (%d blocks); inodes = %d\n",
      path,
!     statbuf.f_bfree, statbuf.f_ffree,
      check_log_space, check_log_space / statbuf.F_FRSIZE, check_log_inodes);


    if (!rc) return FALSE;
--- 95,107 ----
      }


    if (STATVFS(path, &statbuf) != 0 ||
!       statbuf.f_bavail < check_log_space / statbuf.F_FRSIZE ||
!       statbuf.f_favail < check_log_inodes) rc = FALSE;


    DEBUG(5) debug_printf("log directory %s space = %d blocks; inodes = %d; "
      "check_space = %d (%d blocks); inodes = %d\n",
      path,
!     statbuf.f_bavail, statbuf.f_favail,
      check_log_space, check_log_space / statbuf.F_FRSIZE, check_log_inodes);


    if (!rc) return FALSE;


--
*** Exim information can be found at http://www.exim.org/ ***