def get_smtp_config_vars(context):
    """
    Helper function.  Get the values of e-mail-related configuration variables
    from the given context.

    In particular, this function looks for `cs_smtp_host`, `cs_smtp_port`,
    `cs_smtp_user`, and `cs_smtp_password`.  If those values are not provided,
    the function assumes it is connecting to localhost on port 25, and that no
    username or password are required.

    **Parameters:**

    * `context`: the context associated with this request

    **Returns:** a 4-tuple `(hostname, port, username, password)`
    """
    host = context.get('cs_smtp_host', 'localhost')
    port = context.get('cs_smtp_port', 25)
    user = context.get('cs_smtp_user', None)
    passwd = context.get('cs_smtp_password', None)
    return host, port, user, passwd
