def get_secret(str_or_list):
    """
    Find and returns mail secret.

    Mail secret uses following format:

        SECRET{ some-secret }

    note that there are no spaces between all capitalized keyword
    SECRET and immediately following it curly brackets.
    However, the text inside curly brackets can be surrounded by white
    spaces. In example above ``get_secret``
    function returns "some-secret" string.

    :str_or_list: argument can be either a string of a list of
    strings.
    """

    text = str_or_list

    if isinstance(str_or_list, list):
        text = "\n".join(str_or_list)

    try:
        message_secret = text.split('SECRET{')[1].split('}')[0]
    except IndexError:
        message_secret = None

    if message_secret:
        message_secret = message_secret.strip()

    return message_secret