def test_cleanse_incoming(): msg = mail.MailRequest('fakepeer', from_marketroid['from'], from_marketroid['to'], str(from_marketroid)) reply = filter.cleanse_incoming(msg, user_id, host).to_message() assert_equal(reply['from'], marketroid) assert_equal(reply['to'], user) assert_equal(reply['reply-to'], mk_anon_addr)
def START(message, user_id=None, host=None): if user_id: market_anon = addressing.mapping(message['from'], 'marketroid', host) reply = filter.cleanse_incoming(message, user_id, host, market_anon) relay.deliver(reply) return DEMARKETING else: CONFIRM.send(relay, "start", message, "mail/start_confirm.msg", locals()) return CONFIRMING
def DEMARKETING(message, user_id=None, host=None): reply = filter.cleanse_incoming(message, user_id, host) relay.deliver(reply) return DEMARKETING