otherwise the user can believe that he/she can edit it and risk to lose his/her
work (see upstream bug http://bugs.mutt.org/3261)
+#528233, updated in #572203
+
--- a/attach.c
+++ b/attach.c
-@@ -494,6 +494,7 @@
+@@ -492,6 +492,7 @@ int mutt_view_attachment (FILE *fp, BODY
+ FREE (&fname);
+ if (mutt_save_attachment (fp, a, tempfile, 0, NULL) == -1)
goto return_error;
++ chmod (tempfile, 0400);
}
-+ chmod (tempfile, 0400);
use_pipe = rfc1524_expand_command (a, tempfile, type,
- command, sizeof (command));
- use_pager = entry->copiousoutput;
+@@ -633,7 +634,11 @@ int mutt_view_attachment (FILE *fp, BODY
+ if (entry)
+ rfc1524_free_entry (&entry);
+ if (fp && tempfile[0])
++ {
++ /* Restore write permission so mutt_unlink can open the file for writing */
++ chmod(tempfile, 0600);
+ mutt_unlink (tempfile);
++ }
+ else if (unlink_tempfile)
+ unlink(tempfile);
+