def __init__(self,config,section=None): ScannerPlugin.__init__(self,config,section) self.logger=self._logger() self.selective_domain_loader = None self.requiredvars={ 'domainlist':{ 'default':'', 'description':""" if this is empty, all recipient domains will be forced to use TLS txt:<filename> - get from simple textfile which lists one domain per line sql:<statement> - get from sql database :domain will be replaced with the actual domain name. must return field enforce_inbound_tls """, }, 'dbconnection':{ 'default':"mysql://root@localhost/enforcetls?charset=utf8", 'description':'SQLAlchemy Connection string', }, 'action':{ 'default':'DEFER', 'description':'Action if connection is not TLS encrypted. set to DUNNO, DEFER, REJECT', }, 'messagetemplate':{ 'default':'Unencrypted connection. This recipient requires TLS' } }
def __init__(self,config,section=None): ScannerPlugin.__init__(self,config,section) self.logger=self._logger() if HAVE_GEOIP == LIB_GEOIP_PYGEOIP: self.geoip = PyGeoIPCache(None) elif HAVE_GEOIP == LIB_GEOIP_MAXMIND: self.geoip = GeoIPCache(None) else: self.geoip = None self.requiredvars={ 'database':{ 'default':'/var/lib/geoip/GeoIP.dat', 'description':'location of the MaxMind GeopIP database file', }, 'blacklist':{ 'default':'', 'description':'list of countries you do not want to receive mail from.', }, 'whitelist':{ 'default':'', 'description':'list of countries you want want to receive mail from. all other countries will be rejected. If you specify a whitelist, the blacklist will have no function.', }, 'on_unknown':{ 'default':'DUNNO', 'description':'what to do with unknown countries? this affects local IP-addresses. Set this to DUNNO or REJECT', }, 'reject_message':{ 'default':'this system does not accept mail from servers in your country "${cn}" - request whitelisting', 'description':'message displayed to client on reject. use ${cc} as placeholder for country code and ${cn} for English country name', }, }
def __init__(self, config, section=None): ScannerPlugin.__init__(self, config, section) self.requiredvars = { 'limiterfile': { 'default': '/etc/postomaat/conf.d/ratelimit.conf', 'description': 'file based rate limits', }, 'backendtype':{ 'default': 'memory', 'description': 'type of backend where the events are stored. memory is only recommended for low traffic standalone systems. alternatives are: redis, sqlalchemy' #pylint: disable=C0301 }, 'backendconfig':{ 'default': '', 'description': 'backend specific configuration. sqlalchemy: the database url, redis: redis://:[password]@hostname:6379/0' #pylint: disable=C0301 } } self.logger = self._logger() self.backends = dict() self.reqired_strategies = list() self.limiters = None self.logger.info("RateLimit plugin available backends: %s", ' '.join([str(k) + " => " + str(AVAILABLE_BACKENDS[k].keys()) for k in AVAILABLE_BACKENDS.keys()]))
def __init__(self,config,section=None): ScannerPlugin.__init__(self,config,section) self.logger=self._logger() self.requiredvars={ 'ip_whitelist_file':{ 'default':'', 'description':'file containing a list of ip adresses to be exempted from SPF checks. Supports CIDR notation if the netaddr module is installed. 127.0.0.0/8 is always exempted', }, 'domain_selective_spf_file':{ 'default':'', 'description':'if this is non-empty, only sender domains in this file will be checked for SPF', }, 'on_fail':{ 'default':'DUNNO', 'description':'Action for SPF fail.', }, 'on_softfail':{ 'default':'DUNNO', 'description':'Action for SPF softfail.', }, 'messagetemplate':{ 'default':'SPF ${result} for domain ${from_domain} from ${client_address} : ${explanation}' } } self.ip_whitelist_loader=None self.ip_whitelist=[] # either a list of plain ip adress strings or a list of IPNetwork if netaddr is available self.selective_domain_loader=None
def __init__(self, config, section=None): ScannerPlugin.__init__(self, config, section) self.logger = self._logger() self.requiredvars = { 'tldfile': { 'default': '/etc/mail/tlds-alpha-by-domain.txt', 'description': 'filename containing official TLDs. Add a cronjob to dowload this.', }, 'exceptionfile': { 'default': '/etc/mail/tlds-exceptions.txt', 'description': 'additional tld file with local exceptions', }, 'on_fail': { 'default': 'REJECT', 'description': 'Action to take if the TLD is invalid', }, 'messagetemplate': { 'default': """HELO ${helo_name} contains forged/unresolvable TLD '.${helo_tld}'""" } } self.tld_loader = None self.exception_loader = None
def __init__(self, config, section=None): ScannerPlugin.__init__(self, config, section) self.logger = self._logger() self.whitelist = None self.requiredvars = { 'whitelist_file': { 'default': '/etc/postomaat/conf.d/ebl-whitelist.txt', 'description': 'path to file containing whitelisted sender domains', }, 'dnszone': { 'default': 'ebl.msbl.org', 'description': 'the DNS zone to query. defaults to ebl.msbl.org', }, 'response': { 'default': '127.0.0.2', 'description': 'expected response of zone query', }, 'messagetemplate': { 'default': '${sender} listed by ${dnszone} for ${message}' } }
def __init__(self,config,section=None): ScannerPlugin.__init__(self,config,section) self.logger=self._logger() self.requiredvars={ 'scriptdir':{ 'default':'/etc/postomaat/scriptfilter', 'description':'Dir that contains the scripts (*.pmf files)', } }
def __init__(self, config, section=None): ScannerPlugin.__init__(self, config, section) self.logger = self._logger() self.requiredvars = { 'scriptdir': { 'default': '/etc/postomaat/scriptfilter', 'description': 'Dir that contains the scripts (*.pmf files)', } }
def __init__(self,config,section=None): ScannerPlugin.__init__(self,config,section) self.logger=self._logger() self.requiredvars={ 'filename':{ 'default':'/etc/postomaat/complexrules.cf', 'description':'File containing rules', }, } self.ruleparser=ComplexRuleParser() self.filereloader=FileList()
def __init__(self,config,section=None): ScannerPlugin.__init__(self,config,section) self.logger=self._logger() self.requiredvars={ 'filename':{ 'default':'/etc/postomaat/complexrules.cf', 'description':'File containing rules', }, } self.ruleparser=ComplexRuleParser() self.filereloader=FileReloader(None)
def __init__(self, config, section=None): ScannerPlugin.__init__(self, config, section) self.logger = self._logger() self.requiredvars = { 'configfile': { 'default': '/etc/postomaat/recipient_rules.conf', 'description': 'Recipient rule file', } } self.ruledict = None self.lastreload = 0
def __init__(self,config,section=None): ScannerPlugin.__init__(self,config,section) self.logger=self._logger() self.requiredvars={ 'configfile':{ 'default':'/etc/postomaat/recipient_rules.conf', 'description':'Recipient rule file', } } self.ruledict=None self.lastreload=0
def __init__(self,config,section=None): ScannerPlugin.__init__(self,config,section) self.logger=self._logger() self.requiredvars={ 'action':{ 'default':'DEFER', 'description':'Action if sender has no FcRDNS and is using a address literal HELO', }, 'message':{ 'default':'No FcrDNS and address literal HELO - Who are you?', }, } self.pattern=re.compile('^\[[0-9a-fA-F:.]+\]$')
def __init__(self,config,section=None): ScannerPlugin.__init__(self,config,section) self.logger=self._logger() self.requiredvars={ 'ip_whitelist_file':{ 'default':'', 'description':'file containing a list of ip adresses to be exempted from SPF checks. Supports CIDR notation if the netaddr module is installed. 127.0.0.0/8 is always exempted', }, 'domain_selective_spf_file':{ 'default':'', 'description':'if this is non-empty, only sender domains in this file will be checked for SPF', }, 'dbconnection':{ 'default':"mysql://root@localhost/spfcheck?charset=utf8", 'description':'SQLAlchemy Connection string. Leave empty to disable SQL lookups', }, 'domain_sql_query':{ 'default':"SELECT check_spf from domain where domain_name=:domain", 'description':'get from sql database :domain will be replaced with the actual domain name. must return field check_spf', }, 'on_fail':{ 'default':'DUNNO', 'description':'Action for SPF fail.', }, 'on_softfail':{ 'default':'DUNNO', 'description':'Action for SPF softfail.', }, 'messagetemplate':{ 'default':'SPF ${result} for domain ${from_domain} from ${client_address} : ${explanation}' } } if HAVE_NETADDR: self.private_nets = [ IPNetwork('10.0.0.0/8'), # private network IPNetwork('127.0.0.0/8'), # localhost IPNetwork('169.254.0.0/16'), # link local IPNetwork('172.16.0.0/12'), # private network IPNetwork('192.168.0.0/16'), # private network IPNetwork('fe80::/10'), # ipv6 link local IPNetwork('::1/128'), # localhost ] else: self.private_nets = None self.ip_whitelist_loader=None self.ip_whitelist=[] # either a list of plain ip adress strings or a list of IPNetwork if netaddr is available self.selective_domain_loader=None
def __init__(self, config, section=None): ScannerPlugin.__init__(self, config, section) self.logger = self._logger() self.whitelist = None self.requiredvars = { 'whitelist_file': { 'default': '/etc/postomaat/conf.d/ebl-whitelist.txt', 'description': 'path to file containing whitelisted sender domains', }, 'dnszone': { 'default': 'ebl.msbl.org', 'description': 'the DNS zone to query. defaults to ebl.msbl.org', }, 'hash': { 'default': 'sha1', 'description': 'hash function used by DNS zone. Use one of sha1, md5' }, 'response': { 'default': '127.0.0.2', 'description': 'expected response of zone query', }, 'messagetemplate': { 'default': '${sender} listed by ${dnszone} for ${message}' }, 'normalisation': { 'default': 'ebl', 'description': 'type of normalisation to be applied to email addresses before hashing. choose one of ebl (full normalisation according to ebl.msbl.org standard), low (lowercase only)' }, 'decode_srs': { 'default': '0', 'description': 'decode SRS encoded sender addresses before lookup' }, 'check_srs_only': { 'default': '0', 'description': 'only check decoded SRS sender addresses against the blacklist zone' }, }
def __init__(self, config, section=None): ScannerPlugin.__init__(self, config, section) self.logger = self._logger() self.requiredvars = { 'action': { 'default': 'DEFER', 'description': 'Action if sender has no FcRDNS and is using a address literal HELO', }, 'message': { 'default': 'No FcrDNS and address literal HELO - Who are you?', }, } self.pattern = re.compile('^\[[0-9a-fA-F:.]+\]$')
def __init__(self, config, section=None): ScannerPlugin.__init__(self, config, section) self.logger = self._logger() self.requiredvars = { 'ip_whitelist_file': { 'default': '', 'description': 'file containing a list of ip adresses to be exempted from SPF checks. Supports CIDR notation if the netaddr module is installed. 127.0.0.0/8 is always exempted', }, 'domain_selective_spf_file': { 'default': '', 'description': 'if this is non-empty, only sender domains in this file will be checked for SPF', }, 'dbconnection': { 'default': "mysql://root@localhost/spfcheck?charset=utf8", 'description': 'SQLAlchemy Connection string. Leave empty to disable SQL lookups', }, 'domain_sql_query': { 'default': "SELECT check_spf from domain where domain_name=:domain", 'description': 'get from sql database :domain will be replaced with the actual domain name. must return field check_spf', }, 'on_fail': { 'default': 'DUNNO', 'description': 'Action for SPF fail.', }, 'on_softfail': { 'default': 'DUNNO', 'description': 'Action for SPF softfail.', }, 'messagetemplate': { 'default': 'SPF ${result} for domain ${from_domain} from ${client_address} : ${explanation}' } } self.ip_whitelist_loader = None self.ip_whitelist = [ ] # either a list of plain ip adress strings or a list of IPNetwork if netaddr is available self.selective_domain_loader = None
def __init__(self,config,section=None): ScannerPlugin.__init__(self,config,section) self.logger=self._logger() self.mxrules = None self.spfrules = None self.requiredvars={ 'datafile_mx':{ 'default':'/etc/postomaat/conf.d/enforcemx.txt', 'description':'recipient domain based rule file', }, 'datafile_spf':{ 'default':'/etc/postomaat/conf.d/fakespf.txt', 'description':'sender domain based rule file', }, }
def __init__(self, config, section=None): ScannerPlugin.__init__(self, config, section) self.backendconfig = self.config.get(self.section, 'backendconfig') self.queryfile = self.config.get(self.section, 'queryfile') self.requiredvars = { "backendconfig": { 'default': 'mysql://root@localhost/sender_meta_db?charset=utf8', 'description': 'SQLAlchemy Connection string' }, "queryfile": { 'default': "/etc/postomaat/conf.d/suspectcollect.queries", 'description': 'file with queriy configs to run for data collection' } } self.logger = self._logger() self.queries = None
def __init__(self,config,section=None): ScannerPlugin.__init__(self,config,section) self.logger=self._logger() self.requiredvars={ 'action':{ 'default':'REJECT', 'description':'Action if sender uses invalid TLD', }, 'message':{ 'default':'forged rDNS TLD', }, 'tldfile':{ 'default':'/etc/mail/tlds-alpha-by-domain.txt', }, } self.filelist=FileList(filename=None,strip=True, skip_empty=True, skip_comments=True,lowercase=True,minimum_time_between_reloads=86400)
def __init__(self, config, section=None): ScannerPlugin.__init__(self, config, section) self.logger = self._logger() self.geoip = None self.requiredvars = { "database": { "default": "/var/lib/geoip/GeoIP.dat", "description": "location of the MaxMind GeopIP database file", }, "blacklist": {"default": "", "description": "list of countries you do not want to receive mail from."}, "whitelist": { "default": "", "description": "list of countries you want want to receive mail from. all other countries will be rejected. If you specify a whitelist, the blacklist will have no function.", }, "on_unknown": { "default": "DUNNO", "description": "what to do with unknown countries? this affects local IP-addresses. Set this to DUNNO or REJECT", }, }
def __init__(self,config,section=None): ScannerPlugin.__init__(self,config,section) self.logger=self._logger() self.requiredvars={ 'dbconnection':{ 'default':"mysql://root@localhost/dbwriter?charset=utf8", 'description':'SQLAlchemy Connection string', }, 'table':{ 'default': "maillog", 'description': """Tablename where we should insert mails""" }, 'fields':{ 'default': "from_address to_address from_domain to_domain size queue_id:queueid", 'description': """Fields that should be inserted. use <fieldname>:<columnname> or just <fieldname> if the database column name matches the fieldname""" }, }
def __init__(self, config, section=None): ScannerPlugin.__init__(self, config, section) self.logger = self._logger() if HAVE_GEOIP == LIB_GEOIP_PYGEOIP: self.geoip = PyGeoIPCache(None) elif HAVE_GEOIP == LIB_GEOIP_MAXMIND: self.geoip = GeoIPCache(None) else: self.geoip = None self.requiredvars = { 'database': { 'default': '/var/lib/geoip/GeoIP.dat', 'description': 'location of the MaxMind GeopIP database file', }, 'blacklist': { 'default': '', 'description': 'list of countries you do not want to receive mail from.', }, 'whitelist': { 'default': '', 'description': 'list of countries you want want to receive mail from. all other countries will be rejected. If you specify a whitelist, the blacklist will have no function.', }, 'on_unknown': { 'default': 'DUNNO', 'description': 'what to do with unknown countries? this affects local IP-addresses. Set this to DUNNO or REJECT', }, 'reject_message': { 'default': 'this system does not accept mail from servers in your country "${cn}" - request whitelisting', 'description': 'message displayed to client on reject. use ${cc} as placeholder for country code and ${cn} for English country name', }, }
def __init__(self,config,section=None): ScannerPlugin.__init__(self,config,section) self.logger=self._logger() self.requiredvars={ 'ip_whitelist':{ 'default':'127.0.0.0/8', 'description':'which sending hosts/networks should be excluded from SPF checks', }, 'domain_whitelist':{ 'default':'', 'description':'which sender domains should be excluded from SPF checks', }, 'on_softfail':{ 'default':'DUNNO', 'description':'what to do on softfail', }, 'on_softerror':{ 'default':'DEFER', 'description':'what to do on softerror', }, }
def __init__(self, config, section=None): ScannerPlugin.__init__(self, config, section) self.logger = self._logger() self.requiredvars = { 'action': { 'default': 'REJECT', 'description': 'Action if sender uses invalid TLD', }, 'message': { 'default': 'forged rDNS TLD', }, 'tldfile': { 'default': '/etc/mail/tlds-alpha-by-domain.txt', }, } self.filelist = FileList(filename=None, strip=True, skip_empty=True, skip_comments=True, lowercase=True, minimum_time_between_reloads=86400)
def __init__(self,config,section=None): ScannerPlugin.__init__(self,config,section) self.logger=self._logger() self.whitelist = None self.requiredvars={ 'whitelist_file':{ 'default':'/etc/postomaat/conf.d/ebl-whitelist.txt', 'description':'path to file containing whitelisted sender domains', }, 'dnszone':{ 'default':'ebl.msbl.org', 'description':'the DNS zone to query. defaults to ebl.msbl.org', }, 'hash': { 'default':'sha1', 'description':'hash function used by DNS zone. Use one of sha1, md5' }, 'response':{ 'default':'127.0.0.2', 'description':'expected response of zone query', }, 'messagetemplate':{ 'default':'${sender} listed by ${dnszone} for ${message}' }, 'normalisation':{ 'default':'ebl', 'description':'type of normalisation to be applied to email addresses before hashing. choose one of ebl (full normalisation according to ebl.msbl.org standard), low (lowercase only)' }, 'decode_srs':{ 'default':'0', 'description':'decode SRS encoded sender addresses before lookup' }, 'check_srs_only':{ 'default':'0', 'description':'only check decoded SRS sender addresses against the blacklist zone' }, }
def __init__(self, config, section=None): ScannerPlugin.__init__(self, config, section) self.logger = self._logger() self.requiredvars = { 'forward_domain': { 'default': 'example.com', 'description': 'the SRS envelope sender domain', }, 'secret': { 'default': '', 'description': 'cryptographic secret. set the same random value on all your machines', }, 'maxage': { 'default': '8', 'description': 'maximum lifetime of bounces', }, 'hashlength': { 'default': '8', 'description': 'size of auth code', }, 'separator': { 'default': '=', 'description': 'SRS token separator', }, 'messagetemplate': { 'default': '${from_address} is not a valid SRS bounce address' }, 'accept_unsigned': { 'default': 'True', 'description': 'Accept unsigend (non SRS) recpients. Set to False to reject', } }
def __init__(self,config,section=None): ScannerPlugin.__init__(self,config,section) self.logger=self._logger() self.requiredvars={ 'tldfile':{ 'default':'/etc/mail/tlds-alpha-by-domain.txt', 'description':'filename containing official TLDs. Add a cronjob to dowload this.', }, 'exceptionfile':{ 'default':'/etc/mail/tlds-exceptions.txt', 'description':'additional tld file with local exceptions', }, 'on_fail':{ 'default':'REJECT', 'description':'Action to take if the TLD is invalid', }, 'messagetemplate':{ 'default':"""HELO ${helo_name} contains forged/unresolvable TLD '.${helo_tld}'""" } } self.tld_loader=None self.exception_loader=None
def __init__(self, config, section=None): ScannerPlugin.__init__(self, config, section) self.requiredvars = { 'limiterfile': { 'default': '/etc/postomaat/ratelimit.conf', 'description': 'file based rate limits', }, 'backendtype': { 'default': 'memory', 'description': 'type of backend where the events are stored. memory is only recommended for low traffic standalone systems. alternatives are: redis, sqlalchemy' }, 'backendconfig': { 'default': '', 'description': 'backend specific configuration. sqlalchemy: the database url, redis: hostname:port:db' } } self.logger = self._logger() self.backend_instance = None self.limiters = None
def __init__(self, config, section=None): ScannerPlugin.__init__(self, config, section) self.logger = self._logger() self.memcache = SettingsCache() self.requiredvars = { 'dbconnection': { 'default': "mysql://spamassassin@localhost/spamassassin?charset=utf8", 'description': 'SQLAlchemy connection string', }, 'usecache': { 'default': "True", 'description': 'Use Mem Cache. This is recommended. However, if enabled it will take up to 5 minutes until a listing gets effective.', }, 'action_whitelist_to': { 'default': "OK", 'description': 'Action for this listing type', }, 'message_whitelist_to': { 'default': "", 'description': 'Message for this listing type', }, 'action_more_spam_to': { 'default': "OK", 'description': 'Action for this listing type', }, 'message_more_spam_to': { 'default': "", 'description': 'Message for this listing type', }, 'action_all_spam_to': { 'default': "OK", 'description': 'Action for this listing type', }, 'message_all_spam_to': { 'default': "", 'description': 'Message for this listing type', }, 'action_whitelist_from': { 'default': "OK", 'description': 'Action for this listing type', }, 'message_whitelist_from': { 'default': "", 'description': 'Message for this listing type', }, 'action_blacklist_to': { 'default': "REJECT", 'description': 'Action for this listing type', }, 'message_blacklist_to': { 'default': "", 'description': 'Blacklisted recipient', }, 'action_blacklist_from': { 'default': "REJECT", 'description': 'Action for this listing type', }, 'message_blacklist_from': { 'default': "", 'description': 'Blacklisted sender', }, }
def __init__(self,config,section=None): ScannerPlugin.__init__(self,config,section) self.logger=self._logger() self.memcache = SettingsCache() self.requiredvars={ 'dbconnection':{ 'default':"mysql://spamassassin@localhost/spamassassin?charset=utf8", 'description':'SQLAlchemy connection string', }, 'usecache':{ 'default':"True", 'description':'Use Mem Cache. This is recommended. However, if enabled it will take up to 5 minutes until a listing gets effective.', }, 'action_whitelist_to':{ 'default':"OK", 'description':'Action for this listing type', }, 'message_whitelist_to':{ 'default':"", 'description':'Message for this listing type', }, 'action_more_spam_to':{ 'default':"OK", 'description':'Action for this listing type', }, 'message_more_spam_to':{ 'default':"", 'description':'Message for this listing type', }, 'action_all_spam_to':{ 'default':"OK", 'description':'Action for this listing type', }, 'message_all_spam_to':{ 'default':"", 'description':'Message for this listing type', }, 'action_whitelist_from':{ 'default':"OK", 'description':'Action for this listing type', }, 'message_whitelist_from':{ 'default':"", 'description':'Message for this listing type', }, 'action_blacklist_to':{ 'default':"REJECT", 'description':'Action for this listing type', }, 'message_blacklist_to':{ 'default':"", 'description':'Blacklisted recipient', }, 'action_blacklist_from':{ 'default':"REJECT", 'description':'Action for this listing type', }, 'message_blacklist_from':{ 'default':"", 'description':'Blacklisted sender', }, }