# File lib/vmail/imap_client.rb, line 748 def save_attachments(dir) log "Save_attachments #{dir}" if !@current_mail log "Missing a current message" end return unless dir && @current_mail attachments = @current_mail.attachments `mkdir -p #{dir}` saved = attachments.map do |x| path = File.join(dir, x.filename) log "Saving #{path}" File.open(path, 'wb') {|f| f.puts x.decoded} path end "Saved:\n" + saved.map {|x| "- #{x}"}.join("\n") end