[Pymilter] Unknown command and further processing

Larry G. Wapnitsky LWapnitsky at ph.wrtdesign.com
Tue May 22 11:54:11 EDT 2012


I have the following code in a milter that determines when Postfix has
received an unknown command:

 

@Milter.noreply

    def unknown(self, cmd):

        self.unkMilterlog.warning('Invalid command sent: %s' % cmd)

        try:

            self.unkMilterlog.warning('From: %s' % self.canon_from)

        except:

            self.unkMilterlog.warning('unable to determine Sender')

        try:

            for R in self.R:

                for recipient in R:

                    if not len(recipient) < 1: self.log('To %s' %
recipient)

        except:

            self.unkMilterlog.warning('unable to determine
Recipient(s)')

        return Milter.CONTINUE

 

Is it possible to do further processing on a message when "unknown" has
been called?  Part of the reason this was initially created (for logging
purposes) was that another milter was not being hit when an unknown
command was being interpreted.  What I'd like to do is take the full
message and put it into a MySQL blob for further analysis.

 

Thanks,
Larry






----wrtmail--%3423wrt%----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gathman.org/pipermail/pymilter/attachments/20120522/4aa86444/attachment.html>


More information about the Pymilter mailing list