Greylisting Policy For/Subclass Of Concrete Mail HandlerThis 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 Example UsageYou use this as follows (at minimum): ServerCore(protocol=GreyListingPolicy, port=25) 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) How does it work?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:
Kamaelia.Apps.Grey.GreyListingPolicy.GreyListingPolicyclass GreyListingPolicy(Kamaelia.Apps.Grey.ConcreteMailHandler.ConcreteMailHandler)Methods defined hereWarning! You should be using the inbox/outbox interface, not these methods (except construction). This documentation is designed as a roadmap as to their functionalilty for maintainers and new component developers. Methods inherited from Kamaelia.Apps.Grey.ConcreteMailHandler.ConcreteMailHandler :
Methods inherited from Kamaelia.Apps.Grey.MailHandler.MailHandler :
FeedbackGot 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 |
Kamaelia
is an open source project originated from and guided by BBC
Research. For more information browse the site or get in
contact.
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.