Greylisting Policy For/Subclass Of Concrete Mail Handler
This component implements a greylisting SMTP proxy protocol, by subclassing ConcreteMailHandler and overriding the appropriate methods (primarily the shouldWeAcceptMail method).
For more detail, please see http://www.kamaelia.org/KamaeliaGrey
You use this as follows (at minimum):
If you want to have a hardcoded/configured greylisting server you could do this:
class GreyLister(ServerCore): class protocol(GreyListingPolicy): allowed_senders =  allowed_sender_nets =  allowed_domains = [ ] GreyLister(port=25)
Primarily it override the method shouldWeAcceptMail, and implements the following logic:
if self.sentFromAllowedIPAddress(): return True # Allowed hosts can always send to anywhere through us if self.sentFromAllowedNetwork(): return True # People on truste networks can always do the same if self.sentToADomainWeForwardFor(): try: for recipient in self.recipients: if self.whiteListed(recipient): return True if not self.isGreylisted(recipient): return False except Exception, e: pass return True # Anyone can always send to hosts we own
Clearly AllowedIPAddress, AllowedNetwork, whiteListed, and DomainWeForwardFor are fairly clear concepts, so for more details on those please look at the implementation.
isGreylisted by comparison is slightly more complex. Fundamentally this works on the basis of saying this:
Now there is a little more subtlty here, based on the following conditions:
Methods defined here
Methods inherited from Kamaelia.Apps.Grey.ConcreteMailHandler.ConcreteMailHandler :
Got a problem with the documentation? Something unclear that could be clearer? Want to help improve it? Constructive criticism is very welcome - especially if you can suggest a better rewording!
Please leave you feedback here in reply to the documentation thread in the Kamaelia blog.
-- Automatic documentation generator, 05 Jun 2009 at 03:01:38 UTC/GMT
This is an ongoing community based development site. As a result the contents of this page is the opinions of the contributors of the pages involved not the organisations involved. Specificially, this page may contain personal views which are not the views of the BBC. (the site is powered by a wiki engine)
(C) Copyright 2008 Kamaelia Contributors, including the British Broadcasting Corporation, All Rights Reserved.