commit 09953e4005573c130e48edab594c2de95d23dadb
parent f6a36635995becb411f30602424d2625dafd2298
Author: Paul <paul@claws-mail.org>
Date: Tue, 13 Aug 2024 09:55:49 +0100
fix bug 4821, 'If the Mail folder is on another partition, folder chmod settings are not applied to draft and queue'
patch by MatN
Diffstat:
3 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/AUTHORS b/AUTHORS
@@ -352,3 +352,4 @@ contributors (in addition to the above; based on Changelog)
Gianni Ceccarelli
Paul Wolneykien
Quentin Rameau
+ MatN
diff --git a/src/gtk/authors.h b/src/gtk/authors.h
@@ -265,6 +265,7 @@ static char *CONTRIBS_LIST[] = {
"Damian Poddebniak",
"Marcel Pol",
"Martin Pool",
+"MatN",
"Quar",
"Don Quijote",
"Steve Rader",
diff --git a/src/mh.c b/src/mh.c
@@ -418,6 +418,7 @@ static gint mh_add_msgs(Folder *folder, FolderItem *dest, GSList *file_list,
gchar *destfile;
GSList *cur;
MsgFileInfo *fileinfo;
+ FolderItemPrefs *prefs;
cm_return_val_if_fail(dest != NULL, -1);
cm_return_val_if_fail(file_list != NULL, -1);
@@ -427,6 +428,8 @@ static gint mh_add_msgs(Folder *folder, FolderItem *dest, GSList *file_list,
if (dest->last_num < 0) return -1;
}
+ prefs = dest->prefs;
+
for (cur = file_list; cur != NULL; cur = cur->next) {
fileinfo = (MsgFileInfo *)cur->data;
@@ -445,6 +448,10 @@ static gint mh_add_msgs(Folder *folder, FolderItem *dest, GSList *file_list,
#ifdef G_OS_UNIX
}
#endif
+ if (prefs && prefs->enable_folder_chmod && prefs->folder_chmod) {
+ if (chmod(destfile, prefs->folder_chmod) < 0)
+ FILE_OP_ERROR(destfile, "chmod");
+ }
if (relation != NULL)
g_hash_table_insert(relation, fileinfo, GINT_TO_POINTER(dest->last_num + 1));