import re


def check_email(email):
    """
    Check if the email is valid according to RFC 5322
    :param email: the email of the user
    :return: true if the email is valid, false if the email is invalid
    :return: error message if there is any
    """
    error = None
    email_rules = "(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)"
    if email == "":
        error = "Email is empty"
    elif not re.search(email_rules, email):
        error = "Email format is invalid"
    return not error, error