我正在运行Mac OS X并使用postfix来启用localhost。 这是我收到的错误消息:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py", line 239, in __init__
(code, msg) = self.connect(host, port)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py", line 295, in connect
self.sock = self._get_socket(host, port, self.timeout)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py", line 273, in _get_socket
return socket.create_connection((port, host), timeout)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 571, in create_connection
raise err
socket.error: [Errno 61] Connection refused
答案 0 :(得分:2)
首先使用netstat
验证SMTP服务器是否绑定到适当接口的端口25。
答案 1 :(得分:0)
检查后缀日志文件,该文件可能位于/var/log/mail
或类似名称,具体取决于您安装后缀的方式。