Complete.Org: Mailing Lists: Archives: offlineimap: March 2003:
[Fwd: Re: offlineimap and ipv6]
Home

[Fwd: Re: offlineimap and ipv6]

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: offlineimap@xxxxxxxxxxxx
Subject: [Fwd: Re: offlineimap and ipv6]
From: Adriaan Peeters <apeeters@xxxxxxxxxxx>
Date: 26 Mar 2003 02:59:33 +0100

> See the attached patch. It works for me, feel free to include it in
> offlineimap.
 
> -- Binary/unsupported file stripped by Ecartis --
> -- Type: text/x-patch
> -- File: offlineimap-3.99.10-ipv6.patch

The patch didn't reach the mailinglist successfully, so I'm including it here 
inline for reference.

===start patch===
diff -ur orig/offlineimap-3.99.10/offlineimap/imaplib.py 
offlineimap-3.99.10/offlineimap/imaplib.py
--- orig/offlineimap-3.99.10/offlineimap/imaplib.py     2002-11-02 
17:18:15.000000000 +0100
+++ offlineimap-3.99.10/offlineimap/imaplib.py  2003-03-26 00:22:47.000000000 
+0100
@@ -217,8 +217,18 @@
         """
         self.host = host
         self.port = port
-        self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-        self.sock.connect((host, port))
+#        self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+#        self.sock.connect((host, port))
+
+#This connects to the first ip found ipv4/ipv6
+#Added by Adriaan Peeters <apeeters@xxxxxxxxxxx> based on a socket
+#example from the python documentation: 
http://www.python.org/doc/lib/socket-example.html
+
+       res = socket.getaddrinfo(host, port, socket.AF_UNSPEC, 
socket.SOCK_STREAM)
+       af, socktype, proto, canonname, sa = res[0]
+       self.sock = socket.socket(af, socktype, proto)
+       self.sock.connect(sa)
+
         self.file = self.sock.makefile('rb')
===end patch===

-- 
Adriaan Peeters <apeeters@xxxxxxxxxxx>



[Prev in Thread] Current Thread [Next in Thread]
  • [Fwd: Re: offlineimap and ipv6], Adriaan Peeters <=