如何在Lamson / Salmon处理程序中设置无法送达的邮件?

时间:2015-01-07 07:45:48

标签: lamson

如果没有处理程序匹配,Lamson / Salmon会将邮件放入无法传送的队列中。但是,我不能完全使用正则表达式来匹配路由装饰器,因为我需要使用来自例如数据库的信息来验证地址。因此,我需要能够将具有无效地址的邮件放入处理程序的无法传递的队列中。我怎么能这样做?

我的处理程序看起来像:

@route("(address)@(host)", address=".+", host="example\.com")
@stateless
def START(message, address=None, host=None):

    # Here is a complex validation of the address.
    # It uses, for instance, information from a database.
    # If the address is valid, mail is sent and the function returns

    # The code ends up here if the address wasn't valid.
    # How can I put the mail into the undelivarable queue?

0 个答案:

没有答案