From: Andreas Metzler Date: Fri, 29 May 2020 21:50:16 +0000 (+0100) Subject: Fix format of maildir filenames. Bug 1329 X-Git-Tag: exim-4.95-RC0~347^2 X-Git-Url: https://git.exim.org/exim.git/commitdiff_plain/361615d1e97b82f4797381b749bc5977d7a1d66b?ds=inline;hp=-c Fix format of maildir filenames. Bug 1329 --- 361615d1e97b82f4797381b749bc5977d7a1d66b diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index 62777266f..e8f704839 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -6,7 +6,9 @@ options, and new features, see the NewStuff file next to this ChangeLog. Since Exim version 4.94 ---------------------- -(none yet) +JH/01 Bug 1329: Fix format of Maildir-format filenames to match other mail- + related applications. Previously an "H" was used where available info + says that "M" should be, so change to match. Exim version 4.94 diff --git a/src/src/transports/appendfile.c b/src/src/transports/appendfile.c index a621de074..c8c0a58b6 100644 --- a/src/src/transports/appendfile.c +++ b/src/src/transports/appendfile.c @@ -2485,7 +2485,7 @@ else uschar *basename; (void)gettimeofday(&msg_tv, NULL); - basename = string_sprintf(TIME_T_FMT ".H%luP" PID_T_FMT ".%s", + basename = string_sprintf(TIME_T_FMT ".M%luP" PID_T_FMT ".%s", msg_tv.tv_sec, msg_tv.tv_usec, getpid(), primary_hostname); filename = dataname = string_sprintf("tmp/%s", basename); @@ -2557,11 +2557,12 @@ else dataname = string_sprintf("%s.msg", mailstore_basename); fd = Uopen(filename, O_WRONLY|O_CREAT|O_EXCL, mode); - if (fd < 0 && /* failed to open, and */ - (errno != ENOENT || /* either not non-exist */ - !ob->create_directory || /* or not allowed to make */ - !directory_make(NULL, path, ob->dirmode, FALSE) || /* or failed to create dir */ - (fd = Uopen(filename, O_WRONLY|O_CREAT|O_EXCL, mode)) < 0)) /* or then failed to open */ + if ( fd < 0 /* failed to open, and */ + && ( errno != ENOENT /* either not non-exist */ + || !ob->create_directory /* or not allowed to make */ + || !directory_make(NULL, path, ob->dirmode, FALSE) /* or failed to create dir */ + || (fd = Uopen(filename, O_WRONLY|O_CREAT|O_EXCL, mode)) < 0 /* or then failed to open */ + ) ) { addr->basic_errno = errno; addr->message = string_sprintf("while creating file %s", filename); diff --git a/test/runtest b/test/runtest index c73ad4101..1e206f5d0 100755 --- a/test/runtest +++ b/test/runtest @@ -916,7 +916,7 @@ RESET_AFTER_EXTRA_LINE_READ: s/renamed tmp\/\d+\.[^.]+\.(\S+) as new\/\d+\.[^.]+\.(\S+)/renamed tmp\/MAILDIR.$1 as new\/MAILDIR.$1/; # Maildir file names in general - s/\b\d+\.H\d+P\d+\b/dddddddddd.HddddddPddddd/; + s/\b\d+\.M\d+P\d+\b/dddddddddd.HddddddPddddd/; # Maildirsize data while (/^\d+S,\d+C\s*$/)