[Pymilter] custom reply text after quarantine?

Stuart D Gathman stuart at bmsi.com
Sat Jan 12 19:01:59 EST 2013


On Jan 12, Tom Hendrikx transmitted in part:

>>> Is there any way to accomplished the above?
>> You cannot set a 5.7.1 extended status with a 250 status.
>> If you still have problems, what callback are you doing the above in?
>
> I want to do this during eom()
> Changing the esmtp code from 5.7.1. to 2.5.0 gives me the same error.

It is the 250 that is the problem.  Read the C API page:

https://www.milter.org/developers/api/smfi_setreply

rcode 	The three-digit (RFC 821/2821) SMTP reply code, as a
null-terminated string. rcode cannot be NULL, and must be a valid 4XX or
5XX reply code.

Here is an example of setreply in a production milter:

   def eom(self):
     if self.is_bounce and len(self.recipients) > 1:
       self.log("REJECT: DSN to multiple recipients")
       self.setreply('550','5.7.1', 'DSN to multiple recipients')
       return Milter.REJECT
     ...



More information about the Pymilter mailing list