Hey Folks,
I just pushed Lamson 1.0pre5 to PyPI for your enjoyment:
http://pypi.python.org/pypi?:action=files&name=lamson&version=1.0pre5
This is a small bugfix release that only adds one small feature. If
you're running with the SMTPRelay, you can raise a server.SMTPError with
an error code you want and the SMTPRelay will return that as the error
code to the client.
For example, if you do this in your handler:
@route(".+")
def START(message):
raise server.SMTPError(550)
Then it will generate a reasonable error message (using lamson.bounce
messages) and give that to the client.
Only warning with this is use it sparingly, as it then ties you always
running Lamson as an SMTPRelay, instead of off the QueueRelay. It also
leaks out to malicious clients more information about your server than
you might want them to know. In general, it's better to just ignore bad
messages and save them in an undeliverable queue for later inspection.
Alright, try it out and report bugs to me. Thanks.
--
Zed A. Shaw
http://zedshaw.com/
On Mon, Sep 07, 2009 at 05:25:01PM -0700, Zed A. Shaw wrote: > This is a small bugfix release that only adds one small feature. If > you're running with the SMTPRelay, you can raise a server.SMTPError with > an error code you want and the SMTPRelay will return that as the error > code to the client. > > Only warning with this is use it sparingly, as it then ties you always > running Lamson as an SMTPRelay, instead of off the QueueRelay. It also > leaks out to malicious clients more information about your server than > you might want them to know. In general, it's better to just ignore bad > messages and save them in an undeliverable queue for later inspection. Oops, I mean "Receiver" not "Relay". It's when you're using the SMTPReceiver. Sorry. -- Zed A. Shaw http://zedshaw.com/