  def get_mail_attachments
    Log.add_info(request, params.inspect)

    email_id = params[:id]

    email = Email.find_by_id(email_id)
    if email.nil? or email.user_id != @login_user.id
      render(:text => '')
      return
    end

    download_name = "mail_attachments#{email.id}.zip"
    zip_file = email.zip_attachments(params[:enc])

    if zip_file.nil?
      send_data('', :type => 'application/octet-stream;', :disposition => 'attachment;filename="'+download_name+'"')
    else
      filepath = zip_file.path
      send_file(filepath, :filename => download_name, :stream => true, :disposition => 'attachment')
    end
  end
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.