ph10 2006/03/01 11:24:04 GMT
Modified files:
exim-doc/doc-txt ChangeLog
exim-src/src/transports appendfile.c
Added files:
exim-test/confs 5008
exim-test/log 5008
exim-test/scripts/5000-maildir 5008
exim-test/stderr 5008
Log:
Avoid unnecessary scan of maildir mailbox when mailbox_size is set but
mailbox_filecount and quota_filecount are not.
Revision Changes Path
1.318 +7 -0 exim/exim-doc/doc-txt/ChangeLog
1.14 +7 -6 exim/exim-src/src/transports/appendfile.c
1.1 +50 -0 exim/exim-test/confs/5008 (new)
1.1 +6 -0 exim/exim-test/log/5008 (new)
1.1 +9 -0 exim/exim-test/scripts/5000-maildir/5008 (new)
1.1 +77 -0 exim/exim-test/stderr/5008 (new)
Index: ChangeLog
===================================================================
RCS file: /home/cvs/exim/exim-doc/doc-txt/ChangeLog,v
retrieving revision 1.317
retrieving revision 1.318
diff -u -r1.317 -r1.318
--- ChangeLog 1 Mar 2006 10:40:03 -0000 1.317
+++ ChangeLog 1 Mar 2006 11:24:04 -0000 1.318
@@ -1,4 +1,4 @@
-$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.317 2006/03/01 10:40:03 ph10 Exp $
+$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.318 2006/03/01 11:24:04 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
@@ -244,6 +244,13 @@
PH/48 The ${prvs expansion was broken on systems where time_t was long long.
PH/49 Installed latest patch from the Sieve maintainer.
+
+PH/50 When an Exim quota was set without a file count quota, and mailbox_size
+ was also set, the appendfile transport was unnecessarily scanning a
+ directory of message files (e.g. for maildir delivery) to find the count
+ of files (along with the size), even though it did not need this
+ information. It now does the scan only if it needs to find either the
+ size of the count of files.
Exim version 4.60
Index: appendfile.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/transports/appendfile.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- appendfile.c 21 Feb 2006 16:24:20 -0000 1.13
+++ appendfile.c 1 Mar 2006 11:24:04 -0000 1.14
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/transports/appendfile.c,v 1.13 2006/02/21 16:24:20 ph10 Exp $ */
+/* $Cambridge: exim/exim-src/src/transports/appendfile.c,v 1.14 2006/03/01 11:24:04 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -2317,13 +2317,14 @@
}
#endif /* SUPPORT_MAILDIR */
- /* Otherwise (mailbox_size is not yet set), if we are going to do a quota
- check later on, find the current size of the mailbox. (We don't need to check
- ob->quota_filecount_value, because it can only be set if ob->quota_value is
- set.) */
-
- if ((mailbox_size < 0 || mailbox_filecount < 0) &&
- (ob->quota_value > 0 || THRESHOLD_CHECK))
+ /* Otherwise if we are going to do a quota check later on, and the mailbox
+ size is not set, find the current size of the mailbox. Ditto for the file
+ count. Note that ob->quota_filecount_value cannot be set without
+ ob->quota_value being set. */
+
+ if ((ob->quota_value > 0 || THRESHOLD_CHECK) &&
+ (mailbox_size < 0 ||
+ (mailbox_filecount < 0 && ob->quota_filecount_value > 0)))
{
off_t size;
int filecount = 0;
Index: 5008
====================================================================
# Exim test configuration 5008
QUOTA_FILECOUNT=0
exim_path = EXIM_PATH
host_lookup_order = bydns
primary_hostname = myhost.test.ex
rfc1413_query_timeout = 0s
spool_directory = DIR/spool
log_file_path = DIR/spool/log/%slog
gecos_pattern = ""
gecos_name = CALLER_NAME
# ----- Main settings -----
delay_warning =
qualify_domain = test.ex
# ----- Routers -----
begin routers
r1:
driver = accept
transport = t1
# ----- Transports -----
begin transports
t1:
driver = appendfile
directory = DIR/test-mail/$local_part
user = CALLER
maildir_format
mailbox_size = 100K
quota = 1M
quota_filecount = QUOTA_FILECOUNT
# ----- Retry -----
begin retry
* * F,1d,1d
# End
Index: 5008
====================================================================
1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@??? U=CALLER P=local S=sss
1999-03-02 09:44:33 10HmaX-0005vi-00 => userx <userx@???> R=r1 T=t1
1999-03-02 09:44:33 10HmaX-0005vi-00 Completed
1999-03-02 09:44:33 10HmaY-0005vi-00 <= CALLER@??? U=CALLER P=local S=sss
1999-03-02 09:44:33 10HmaY-0005vi-00 => userx <userx@???> R=r1 T=t1
1999-03-02 09:44:33 10HmaY-0005vi-00 Completed
Index: 5008
====================================================================
# mailbox_size and mailbox_filecount
#
exim -d-all+transport -odi userx@???
Test message
****
exim -DQUOTA_FILECOUNT=20 -d-all+transport -odi userx@???
Test message
****
no_message_check
Index: 5008
====================================================================
Exim version x.yz ....
configuration file is TESTSUITE/test-config
admin user
LOG: MAIN
<= CALLER@??? U=CALLER P=local S=sss
created log directory TESTSUITE/spool/log
Exim version x.yz ....
configuration file is TESTSUITE/test-config
trusted user
admin user
>>>>>>>>>>>>>>>> Local deliveries >>>>>>>>>>>>>>>>
--------> userx@??? <--------
appendfile transport entered
appendfile: mode=600 notify_comsat=0 quota=1048576 warning=0
directory=TESTSUITE/test-mail/userx format=maildir
message_prefix=null
message_suffix=null
maildir_use_size_file=no
ensuring maildir directories exist in TESTSUITE/test-mail/userx
created directory TESTSUITE/test-mail/userx
created directory TESTSUITE/test-mail/userx/tmp
created directory TESTSUITE/test-mail/userx/new
created directory TESTSUITE/test-mail/userx/cur
delivering in maildir format in TESTSUITE/test-mail/userx
writing to tmp/MAILDIR.myhost.test.ex
Exim quota = 1048576 old size = sssss this message = sss (included)
file count quota = 0 count = -1
writing data block fd=6 size=sss timeout=0
renaming temporary file
renamed tmp/MAILDIR.myhost.test.ex as new/MAILDIR.myhost.test.ex
appendfile yields 0 with errno=dd more_errno=dd
t1 transport returned OK for userx@???
LOG: MAIN
=> userx <userx@???> R=r1 T=t1
LOG: MAIN
Completed
>>>>>>>>>>>>>>>> Exim pid=pppp terminating with rc=0 >>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Exim pid=pppp terminating with rc=0 >>>>>>>>>>>>>>>>
Exim version x.yz ....
configuration file is TESTSUITE/test-config
admin user
LOG: MAIN
<= CALLER@??? U=CALLER P=local S=sss
Exim version x.yz ....
configuration file is TESTSUITE/test-config
trusted user
admin user
>>>>>>>>>>>>>>>> Local deliveries >>>>>>>>>>>>>>>>
--------> userx@??? <--------
appendfile transport entered
appendfile: mode=600 notify_comsat=0 quota=1048576 warning=0
directory=TESTSUITE/test-mail/userx format=maildir
message_prefix=null
message_suffix=null
maildir_use_size_file=no
ensuring maildir directories exist in TESTSUITE/test-mail/userx
quota checks on directory TESTSUITE/test-mail/userx
MUNGED: the check_dir_size lines have been sorted to ensure consistency
check_dir_size: dir=TESTSUITE/test-mail/userx sum=dddd count=dd
check_dir_size: dir=TESTSUITE/test-mail/userx/cur sum=0 count=dd
check_dir_size: dir=TESTSUITE/test-mail/userx/new sum=dddd count=dd
check_dir_size: dir=TESTSUITE/test-mail/userx/tmp sum=0 count=dd
delivering in maildir format in TESTSUITE/test-mail/userx
writing to tmp/MAILDIR.myhost.test.ex
Exim quota = 1048576 old size = sssss this message = sss (included)
file count quota = 20 count = 4
writing data block fd=6 size=sss timeout=0
renaming temporary file
renamed tmp/MAILDIR.myhost.test.ex as new/MAILDIR.myhost.test.ex
appendfile yields 0 with errno=dd more_errno=dd
t1 transport returned OK for userx@???
LOG: MAIN
=> userx <userx@???> R=r1 T=t1
LOG: MAIN
Completed
>>>>>>>>>>>>>>>> Exim pid=pppp terminating with rc=0 >>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Exim pid=pppp terminating with rc=0 >>>>>>>>>>>>>>>>