[Pymilter] milter.setreply exception

Stuart D Gathman stuart at bmsi.com
Tue Mar 19 17:02:43 EDT 2013


On Mar 19, Steve Foster transmitted in part:

> On Tue, 19 Mar 2013, Tom Hendrikx wrote:
>
>> Can you show us a bit more code, so we can see if you're doing stuff in
>> the wrong order or something like that?
>
> Basically I'm using one of the example from the documentation with the 
> following
>
>  def envrcpt(self, to, *str):
>    self.log("mail to:", to, *str)
>    self.setreply('250','2.0.0','All OK')
>    return Milter.CONTINUE

If you look at the documentation:
http://pythonhosted.org/pymilter/classMilter_1_1Base.html#ad474d1db07ac5f7b61ad9b78ece53a23

or the C API documentation:
https://www.milter.org/developers/api/smfi_setreply

You will see that setreply would be better named "set_error_reply".
You can only set 4xx/5xx codes, and cannot change the message for 2xx codes.

This is a limitation of the current milter protocol.



More information about the Pymilter mailing list