summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Metzler <ametzler@bebt.de>2020-05-29 22:50:16 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2020-05-29 23:06:54 +0100
commit361615d1e97b82f4797381b749bc5977d7a1d66b (patch)
tree03fb1dacbe3bb445e57a7a8ef602173c08323966 /src
parent5fbb51949cbd9765421c5832c2d391f80f8183e9 (diff)
Fix format of maildir filenames. Bug 1329
Diffstat (limited to 'src')
-rw-r--r--src/src/transports/appendfile.c13
1 files changed, 7 insertions, 6 deletions
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);