def realm_from_principal(principal):
    """
    Attempt to retrieve a realm name from a principal, if the principal is fully qualified.

    :param principal: A principal name: user@DOMAIN.COM
    :type: principal: str
    :return: realm if present, else None
    :rtype: str
    """
    if '@' not in principal:
        return
    else:
        parts = principal.split('@')
        if len(parts) < 2:
            return
        return parts[-1]