def test_route_reply(): msg = mail.MailRequest('fakepeer', from_user['from'], from_user['to'], str(from_user)) reply = filter.route_reply(msg, marketroid_id, host).to_message() # make sure the user's address is never in a header for k, v in reply.items(): assert_not_equal(reply[k], user)
def test_route_reply(): msg = mail.MailRequest('fakepeer', from_user['from'], from_user['to'], str(from_user)) reply = filter.route_reply(msg, marketroid_id, host).to_message() # make sure the user's address is never in a header for k,v in reply.items(): assert_not_equal(reply[k], user)
def PROTECTING(message, marketroid_id=None, host=None, user_id=None): if user_id: logging.warning("Attempted user->user email from %r", message['from']) forbid = view.respond(locals(), "mail/forbid.msg", From="noreply@%(host)s", To=message['from'], Subject="You cannot email another user or yourself.") relay.deliver(forbid) else: reply = filter.route_reply(message, marketroid_id, host) relay.deliver(reply) return PROTECTING
def PROTECTING(message, marketroid_id=None, host=None, user_id=None): if user_id: logging.warning("Attempted user->user email from %r", message['from']) forbid = view.respond( locals(), "mail/forbid.msg", From="noreply@%(host)s", To=message['from'], Subject="You cannot email another user or yourself.") relay.deliver(forbid) else: reply = filter.route_reply(message, marketroid_id, host) relay.deliver(reply) return PROTECTING