Skip to content

Commit 9041123

Browse files
committed
Clarify IPv6 vs. IPv4 protocol priority for local_address
Closes #152
1 parent b7f788a commit 9041123

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

emailproxy.config

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ documentation = Local servers are specified as demonstrated below where, for exa
2525
(assumed to be False otherwise). With this parameter set, STARTTLS negotiation will be handled by the proxy on your
2626
behalf (i.e., do not enable STARTTLS in your client). IMAP STARTTLS and POP STARTTLS are not currently supported.
2727

28-
- The `local_address` property can be used to set an IP address or hostname for the proxy to listen on (both IPv4
29-
and IPv6 are supported). If not specified, this value is set to `localhost`. When running the proxy using python 3.8
30-
or later, and in an environment with dual-stack support, the proxy will attempt to listen on both IPv4 and IPv6
31-
hosts simultaneously. To request this for the local host, set `local_address = ::`.
28+
- The `local_address` property can be used to set an IP address or hostname for the proxy to listen on. Both IPv4
29+
and IPv6 are supported. If not specified, this value is set to `localhost`. When using a hostname the proxy will
30+
first resolve this to an IP address, preferring IPv6 over IPv4 if both are available. When running in an environment
31+
with dual-stack support, the proxy will attempt to listen on both IPv4 and IPv6 hosts simultaneously. To explicitly
32+
request this for the local host, set `local_address = ::`. Note also that tools such as `netstat` do not always
33+
accurately show dual-stack mode; if in doubt it is worth actually testing both IPv4 and IPv6 connections.
3234

3335
Advanced server configuration:
3436
- In the standard configuration the channel between your email client and the proxy is unencrypted. This is not

emailproxy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
__author__ = 'Simon Robinson'
77
__copyright__ = 'Copyright (c) 2022 Simon Robinson'
88
__license__ = 'Apache 2.0'
9-
__version__ = '2023-03-28' # ISO 8601 (YYYY-MM-DD)
9+
__version__ = '2023-04-03' # ISO 8601 (YYYY-MM-DD)
1010

1111
import abc
1212
import argparse
@@ -1063,7 +1063,7 @@ def handle_error(self):
10631063
# APP_PACKAGE is used when we throw our own SSLError on handshake timeout or socket misconfiguration
10641064
ssl_errors = ['SSLV3_ALERT_BAD_CERTIFICATE', 'PEER_DID_NOT_RETURN_A_CERTIFICATE', 'WRONG_VERSION_NUMBER',
10651065
'CERTIFICATE_VERIFY_FAILED', 'TLSV1_ALERT_PROTOCOL_VERSION', 'TLSV1_ALERT_UNKNOWN_CA',
1066-
APP_PACKAGE]
1066+
'UNSUPPORTED_PROTOCOL', APP_PACKAGE]
10671067
if error_type == OSError and value.errno == 0 or issubclass(error_type, ssl.SSLError) and \
10681068
any(i in value.args[1] for i in ssl_errors):
10691069
Log.error('Caught connection error in', self.info_string(), ':', error_type, 'with message:', value)

0 commit comments

Comments
 (0)