diff --git a/lib/sup/modes/edit_message_mode.rb b/lib/sup/modes/edit_message_mode.rb index 39d7b36b7..a1577dc2e 100644 --- a/lib/sup/modes/edit_message_mode.rb +++ b/lib/sup/modes/edit_message_mode.rb @@ -342,6 +342,7 @@ def unsaved?; edited? end def attach_file fn = BufferManager.ask_for_filename :attachment, "File name (enter for browser): " return unless fn + if HookManager.enabled? "check-attachment" reason = HookManager.run("check-attachment", :filename => fn) if reason @@ -349,6 +350,12 @@ def attach_file end end begin + # This code is being used to backslash special characters in file name + fn.gsub! "\\", "\\\\\\\\" + fn.gsub! '*', '\*' + fn.gsub! '?', '\?' + fn.gsub! "[", "\\[" + # End of this code Dir[fn].each do |f| @attachments << RMail::Message.make_file_attachment(f) @attachment_names << f @@ -375,7 +382,7 @@ def rerun_crypto_selector_hook HookManager.run "crypto-mode", :header => @header, :body => @body, :crypto_selector => @crypto_selector end end - + def mime_encode string string = [string].pack('M') # basic quoted-printable string.gsub!(/=\n/,'') # .. remove trailing newline