#include <string.h>
#include <ctype.h>
#include <unistd.h>
+#include <sys/stat.h>
#include "intl.h"
#include "main.h"
gchar *buf;
gchar *cachefile, *markfile;
GSList * cur;
+ gint filemode = 0;
+ PrefsFolderItem *prefs;
if (!summaryview->folder_item || !summaryview->folder_item->path)
return -1;
}
if (change_file_mode_rw(fps.cache_fp, cachefile) < 0)
FILE_OP_ERROR(cachefile, "chmod");
+
+ prefs = summaryview->folder_item->prefs;
+ if (prefs && prefs->enable_folder_chmod && prefs->folder_chmod) {
+ /* for cache file */
+ filemode = prefs->folder_chmod;
+ if (filemode & S_IRGRP) filemode |= S_IWGRP;
+ if (filemode & S_IROTH) filemode |= S_IWOTH;
+#if HAVE_FCHMOD
+ fchmod(fileno(fps.cache_fp), filemode);
+#else
+ chmod(cachefile, filemode);
+#endif
+ }
+
g_free(cachefile);
markfile = folder_item_get_mark_file(summaryview->folder_item);
}
if (change_file_mode_rw(fps.mark_fp, markfile) < 0)
FILE_OP_ERROR(markfile, "chmod");
+ if (prefs && prefs->enable_folder_chmod && prefs->folder_chmod) {
+#if HAVE_FCHMOD
+ fchmod(fileno(fps.mark_fp), filemode);
+#else
+ chmod(markfile, filemode);
+#endif
+ }
+
g_free(markfile);
buf = g_strdup_printf(_("Writing summary cache (%s)..."),
Xalloca(from, strlen(msginfo->from) + 1, return);
strcpy(from, msginfo->from);
extract_address(from);
- if (account_find_mail_from_address(from)) {
+ if (account_find_from_address(from)) {
g_free(to);
to = g_strconcat("-->", msginfo->to, NULL);
text[S_COL_FROM] = to;
compose_new_with_recipient
(ac, summaryview->folder_item->path);
else
- compose_new(ac);
+ compose_new_with_folderitem(ac, summaryview->folder_item);
} else
compose_new(NULL);
return;