XYZ File Manager
Current Path:
/opt/alt/python27/lib/python2.7/site-packages/postomaat/plugins
opt
/
alt
/
python27
/
lib
/
python2.7
/
site-packages
/
postomaat
/
plugins
/
📁
..
📄
__init__.py
(578 B)
📄
__init__.pyc
(162 B)
📄
blackwhitelist.py
(10.08 KB)
📄
blackwhitelist.pyc
(7.95 KB)
📄
call-ahead.py
(77.45 KB)
📄
call-ahead.pyc
(67.93 KB)
📄
complexrules.py
(14.59 KB)
📄
complexrules.pyc
(17.37 KB)
📄
dbwriter.py
(5.7 KB)
📄
dbwriter.pyc
(4.69 KB)
📄
ebl-lookup.py
(9.03 KB)
📄
ebl-lookup.pyc
(8.3 KB)
📄
enforcetls.py
(5.1 KB)
📄
enforcetls.pyc
(4.39 KB)
📄
fluentd_writer.py
(6.92 KB)
📄
fluentd_writer.pyc
(6.73 KB)
📄
geoip.py
(7.47 KB)
📄
geoip.pyc
(7.4 KB)
📄
helotld.py
(3.37 KB)
📄
helotld.pyc
(3.07 KB)
📄
killer.py
(1.15 KB)
📄
killer.pyc
(1.47 KB)
📄
messagesize.py
(3.86 KB)
📄
messagesize.pyc
(3.54 KB)
📄
originpolicy.py
(11.2 KB)
📄
originpolicy.pyc
(9.51 KB)
📁
ratelimit
📄
rdns.py
(4.42 KB)
📄
rdns.pyc
(4.82 KB)
📄
recipientrules.py
(11.64 KB)
📄
recipientrules.pyc
(10.1 KB)
📄
script.py
(5.55 KB)
📄
script.pyc
(6 KB)
📄
spfcheck.py
(15.57 KB)
📄
spfcheck.pyc
(11.36 KB)
📄
srs.py
(4.51 KB)
📄
srs.pyc
(3.85 KB)
📄
suspect_collect.py
(7.84 KB)
📄
suspect_collect.pyc
(8.42 KB)
Editing: helotld.py
# -*- coding: UTF-8 -*- # Copyright 2012-2018 Oli Schacher # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # # from postomaat.shared import ScannerPlugin, DUNNO,apply_template from postomaat.shared import FileList import os class HELOTLDPlugin(ScannerPlugin): """ This plugin rejects messages if the HELO uses an invalid TLD """ 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 examine(self,suspect): helo_name=suspect.get_value('helo_name') if helo_name is None : self.logger.error('missing helo') return DUNNO helo_tld=helo_name.split('.')[-1].lower() #initialize loaders tld_file=self.config.get(self.section,'tldfile') if self.tld_loader is None: self.tld_loader=FileList(tld_file,lowercase=True,minimum_time_between_reloads=3600) if helo_tld in self.tld_loader.get_list(): return DUNNO,'' exceptionfile=self.config.get(self.section,'exceptionfile') if self.exception_loader is None: self.exception_loader=FileList(exceptionfile,lowercase=True,minimum_time_between_reloads=10) if helo_tld in self.exception_loader.get_list(): return DUNNO,'' message = apply_template(self.config.get(self.section,'messagetemplate'),suspect,dict(helo_tld=helo_tld)) action=self.config.get(self.section,"on_fail") return action, message def lint(self): lint_ok = True tld_file=self.config.get(self.section,'tldfile') exceptionfile=self.config.get(self.section,'exceptionfile') if not os.path.exists(tld_file): print("TLD file %s not found"%tld_file) lint_ok = False if not os.path.exists(exceptionfile): print("TLD exception file %s not found"%exceptionfile) lint_ok = False if not self.checkConfig(): print('Error checking config') lint_ok = False return lint_ok def __str__(self): return "HeloTLD"
Upload File
Create Folder