Open received attachments as read-only so the editor won't be able to modify
it; 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)

--- a/attach.c
+++ b/attach.c
@@ -492,6 +492,7 @@
       FREE (&fname);
       if (mutt_save_attachment (fp, a, tempfile, 0, NULL) == -1)
 	goto return_error;
+      chmod (tempfile, 0400);
     }
 
     use_pipe = rfc1524_expand_command (a, tempfile, type,
@@ -633,7 +634,11 @@
   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);
 
