Created
March 18, 2014 19:50
-
-
Save malexmave/9628006 to your computer and use it in GitHub Desktop.
secure-smtpd exceptions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncore | |
from secure_smtpd import ProxyServer | |
class MyProxyServer(ProxyServer): | |
def process_message(self, peer, mailfrom, rcpttos, data): | |
ProxyServer.process_message(self, peer, mailfrom, rcpttos, data) | |
def run(): | |
foo = MyProxyServer(("localhost", 2525), | |
("smtp.target-host.tld", 465), | |
ssl_out_only=True) | |
try: | |
asyncore.loop() | |
except KeyboardInterrupt: | |
pass | |
if __name__ == '__main__': | |
run() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
error: uncaptured python exception, closing channel <secure_smtpd.smtp_channel.SMTPChannel connected 127.0.0.1:42381 at 0x7f12575068c0> (<type 'exceptions.NameError'>:global name 'socket' is not defined [/usr/lib/python2.7/asyncore.py|read|83] [/usr/lib/python2.7/asyncore.py|handle_read_event|449] [/usr/lib/python2.7/asynchat.py|handle_read|158] [/usr/local/lib/python2.7/dist-packages/secure_smtpd-1.1.9-py2.7.egg/secure_smtpd/smtp_channel.py|found_terminator|123] [test.py|process_message|17] [/usr/local/lib/python2.7/dist-packages/secure_smtpd-1.1.9-py2.7.egg/secure_smtpd/proxy_server.py|process_message|55] [/usr/local/lib/python2.7/dist-packages/secure_smtpd-1.1.9-py2.7.egg/secure_smtpd/proxy_server.py|_deliver|84]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I see that you created this gist a long time ago Malex. But do you remember if you did ever resolve this? I'm running into the same issue.