def anonymize_reverse_name(name):
    """
    Anonymize reverse name before storing in the database.

    At most the 3 last labels are left unmasked. All the preceding labels are
    masked by using "[…]".

    """
    anonymized_name = ""
    mask = "[…]"
    if name:
        unmasked_labels = 3
        if name[-1] == ".":
            unmasked_labels += 1
        splitted = name.rsplit(".", unmasked_labels)
        splitted[0] = mask
        anonymized_name = ".".join(splitted)
    return anonymized_name