Update template.py (#40)

fixes `milter.error: cannot opensocket`

My name is NOT stuart
This commit is contained in:
Barry de Graaff
2021-07-14 14:37:24 +02:00
committed by GitHub
parent e7592c6a96
commit 599277855c
+2 -1
View File
@@ -16,6 +16,7 @@ except:
from io import BytesIO from io import BytesIO
import time import time
import email import email
import os
import sys import sys
from socket import AF_INET, AF_INET6 from socket import AF_INET, AF_INET6
from Milter.utils import parse_addr from Milter.utils import parse_addr
@@ -157,7 +158,7 @@ def background():
def main(): def main():
bt = Thread(target=background) bt = Thread(target=background)
bt.start() bt.start()
socketname = "/home/stuart/pythonsock" socketname = os.getenv("HOME") + "/pythonsock"
timeout = 600 timeout = 600
# Register to have the Milter factory create instances of your class: # Register to have the Milter factory create instances of your class:
Milter.factory = myMilter Milter.factory = myMilter