def METHOD_NAME(self, db_session, raw_folders):
    """
    Save the folders present on the remote backend for an account.
    * Create Folder objects.
    * Delete Folders that no longer exist on the remote.
    Notes
    -----
    Generic IMAP uses folders (not labels).
    Canonical folders ('inbox') and other folders are created as Folder
    objects only accordingly.
    We don't canonicalize folder names to lowercase when saving because
    different backends may be case-sensitive or otherwise - code that
    references saved folder names should canonicalize if needed when doing
    comparisons.
    """
    account = db_session.query(Account).get(self.account_id)
    remote_folder_names = {sanitize_name(f.display_name) for f in raw_folders}
    local_folders = {
        f.name: f
        for f in db_session.query(Folder).filter(
            Folder.account_id == self.account_id
        )
    }
    # Delete folders no longer present on the remote.
    # Note that the folder with canonical_name='inbox' cannot be deleted;
    # remote_folder_names will always contain an entry corresponding to it.
    discard = set(local_folders) - remote_folder_names
    for name in discard:
        log.info(
            "Folder deleted from remote", account_id=self.account_id, name=name
        )
        if local_folders[name].category_id is not None:
            cat = db_session.query(Category).get(local_folders[name].category_id)
            if cat is not None:
                db_session.delete(cat)
        del local_folders[name]
    # Create new folders
    for raw_folder in raw_folders:
        folder = Folder.find_or_create(
            db_session, account, raw_folder.display_name, raw_folder.role
        )
        if folder.canonical_name != raw_folder.role:
            folder.canonical_name = raw_folder.role
    # Set the should_run bit for existing folders to True (it's True by
    # default for new ones.)
    for f in local_folders.values():
        if f.imapsyncstatus:
            f.imapsyncstatus.sync_should_run = True
    db_session.commit()