Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 3rd, 2008, 07:15 PM
Dave
Guest
 
Posts: n/a
Default imap4_SSL from behind a proxy server

First to admit I'm a newbie at Python, IMAP, or SSL. And it's been a
long time since I've posted anything to a Usenet group. But I've
spent countless hours spinning my wheels on this one, so I thought I'd
ask for help.

I'm trying write some Python code to connect to Gmail from work, where
I need to direct all non-HTTP traffic through a proxy server. Can
anyone provide syntax which would redirect the imap4_SSL method
through a proxy server:port? I suspect there are some environment
variables which, when set, will do this very easily and elegantly. I
also suspect there is a really complicated way to 'wrap' the imap
classes so as to force requests to go through a proxy which, as a
newbie, I am trying to avoid.

FYI, I'm currently running Python 2.5.2. via IDLE on Windows XP. But
when this project is done, I will move it to Linux.

Thanks for any help.

Dave
fkaprince, at Gmail, dot-com
  #2  
Old July 3rd, 2008, 07:55 PM
Diez B. Roggisch
Guest
 
Posts: n/a
Default Re: imap4_SSL from behind a proxy server

Dave schrieb:
Quote:
First to admit I'm a newbie at Python, IMAP, or SSL. And it's been a
long time since I've posted anything to a Usenet group. But I've
spent countless hours spinning my wheels on this one, so I thought I'd
ask for help.
>
I'm trying write some Python code to connect to Gmail from work, where
I need to direct all non-HTTP traffic through a proxy server. Can
anyone provide syntax which would redirect the imap4_SSL method
through a proxy server:port? I suspect there are some environment
variables which, when set, will do this very easily and elegantly. I
also suspect there is a really complicated way to 'wrap' the imap
classes so as to force requests to go through a proxy which, as a
newbie, I am trying to avoid.
>
FYI, I'm currently running Python 2.5.2. via IDLE on Windows XP. But
when this project is done, I will move it to Linux.
AFAIK that's simply not possible. Proxying that is not transparent is
only (for practical matters, there might be esoteric protocols that do
that as well) defined for HTTP. So "I need to direct all non-HTTP
traffic through a proxy server." does not make much sense - at least to me.


In other words: there is no such thing as general proxying, and thus no
support in any library e.g. imaplib or such.

Do you have an example of an application (e.g. mailclient or such) that
*does* support the above scenario?

Diez
  #3  
Old July 4th, 2008, 01:35 PM
=?ISO-8859-1?Q?Michael_Str=F6der?=
Guest
 
Posts: n/a
Default Re: imap4_SSL from behind a proxy server

Diez B. Roggisch wrote:
Quote:
Dave schrieb:
Quote:
>I'm trying write some Python code to connect to Gmail from work, where
>I need to direct all non-HTTP traffic through a proxy server.
>
AFAIK that's simply not possible.
It's possible.
Quote:
Proxying that is not transparent is
only (for practical matters, there might be esoteric protocols that do
that as well) defined for HTTP.
Your mixing terms here.
Quote:
So "I need to direct all non-HTTP traffic through a proxy server."
does not make much sense - at least to me.
The fact you don't know about it does not mean it does not make much
sense. ;-)

E.g. when using HTTPS the proxy does not see any HTTP traffic except the
HTTP CONNECT going to the proxy itself.
Quote:
Do you have an example of an application (e.g. mailclient or such) that
*does* support the above scenario?
Widely used: OpenVPN, Netscape Communicator 4.x (at least for NNTPS - 10
years ago) etc.

The key-word to search for is HTTP CONNECT method. I'd try to implement
a file-like object for it and pass that into imap module. But the proxy
configuration may disallow it. Firewall admins also know the commonly
used freemail services.

Ciao, Michael.
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles