The following python
script(simple tcp server)just returns REJECT User is blacklisted
for any data it receive.
import SocketServer
class MyTCPHandler(SocketServer.BaseRequestHandler):
def handle(self):
self.data = self.request.recv(1024).strip()
print "{} wrote:".format(self.client_address[0])
print self.data
# reply data
data = '200 REJECT%20User%20is%20blacklisted\n'
self.request.send(data)
if __name__ == "__main__":
HOST, PORT = "localhost", 9999
server = SocketServer.TCPServer((HOST, PORT), MyTCPHandler)
server.serve_forever()
After starting the server, You can query this as
[clement@myhost ~]$ postmap -q user@domain.com tcp:localhost:9999
REJECT User is blacklisted
So the text
is the string that returns some human readable description.It is the same text
you sepcify in your access table. Eg.user@domain.tld REJECT You are blacklisted