Uploaded image for project: 'Commons Net'
  1. Commons Net
  2. NET-650

IMAPClient over proxy doesn't properly resolve DNS

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.6
    • 3.10.0
    • IMAP
    • None

    Description

      IMAPClient when configured to use a socks proxy is not able to resolve DNS names through the proxy.

      See attached sample code, if I use it with:

      $ java -DsocksProxyHost=localhost -DsocksProxyPort=16003 -cp .:./commons-net-3.6.jar imapproxy imap.server.test.com user1 userpass
      connect error: java.net.UnknownHostException: imap.server.test.com: unknown error
      

      vs if I use it with the appropriate IP:

      $ java -DsocksProxyHost=localhost -DsocksProxyPort=16003 -cp .:./commons-net-3.6.jar imapproxy 10.250.3.127 user1 userpass
      * OK IMAP4rev1 proxy server ready
      IMAP: 10.250.3.127 143
      AAAA LOGIN *******
      AAAA OK [CAPABILITY IMAP4rev1 ACL BINARY CATENATE CHILDREN CONDSTORE ENABLE ESEARCH ESORT I18NLEVEL=1 ID IDLE LIST-EXTENDED LIST-STATUS LITERAL+ LOGIN-REFERRALS MULTIAPPEND NAMESPACE QRESYNC QUOTA RIGHTS=ektx SASL-IR SEARCHRES SORT THREAD=ORDEREDSUBJECT UIDPLUS UNSELECT WITHIN XLIST] LOGIN completed
      AAAB LOGOUT
      * BYE 10.250.3.127 Zimbra IMAP4rev1 server closing connection
      AAAB OK LOGOUT completed
      

      Attachments

        1. socketproxy.java
          0.8 kB
          Matthew McGillis
        2. imapproxy2.java
          1 kB
          Sebb
        3. imapproxy.java
          0.9 kB
          Matthew McGillis

        Issue Links

          Activity

            People

              Unassigned Unassigned
              msm Matthew McGillis
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: