[exim-cvs] Fix format of maildir filenames. Bug 1329

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Exim Git Commits Mailing List
Datum:  
To: exim-cvs
Betreff: [exim-cvs] Fix format of maildir filenames. Bug 1329
Gitweb: https://git.exim.org/exim.git/commitdiff/361615d1e97b82f4797381b749bc5977d7a1d66b
Commit:     361615d1e97b82f4797381b749bc5977d7a1d66b
Parent:     5fbb51949cbd9765421c5832c2d391f80f8183e9
Author:     Andreas Metzler <ametzler@???>
AuthorDate: Fri May 29 22:50:16 2020 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Fri May 29 23:06:54 2020 +0100


    Fix format of maildir filenames.  Bug 1329
---
 doc/doc-txt/ChangeLog           |  4 +++-
 src/src/transports/appendfile.c | 13 +++++++------
 test/runtest                    |  2 +-
 3 files changed, 11 insertions(+), 8 deletions(-)


diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog
index 6277726..e8f7048 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 a621de0..c8c0a58 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 c73ad41..1e206f5 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*$/)