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

    return unless request.post?

    email_id = params[:email_id]
    unread = (params[:unread] == "1")

    begin
      email = Email.find(email_id)
      if !email.nil? and (email.user_id == @login_user.id)
        if email.xtype == Email::XTYPE_RECV
          status = (unread)?(Email::STATUS_UNREAD):(Email::STATUS_NONE)
          email.update_attribute(:status, status)
        end
      end
    rescue => evar
      Log.add_error(nil, evar)
    end

    render(:text => '')
  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.