title: How can I fetch emails via POP or IMAP through a proxy?
body: <p>Neither poplib or imaplib seem to offer proxy support and I couldn't find much info about it despite my google-fu attempts.</p>
  
  <p>I'm using python to fetch emails from various imap/pop enabled servers and need to be able to do it through proxies.</p>
  
  <p>Ideally, I'd like to be able to do it in python directly but using a wrapper (external program/script, OSX based) to force all traffic to go through the proxy might be enough if I can't find anything better.</p>
  
  <p>Could anyone give me a hand? I can't imagine I'm the only one who ever needed to fetch emails through a proxy in python...</p>
  
  <p>** EDIT Title edit to remove HTTP, because I shouldn't type so fast when I'm tired, sorry for that guys **</p>
  
  <p>The proxies I'm planning to use allow socks in addition to http. </p>
  
  <p>Pop or Imap work through http wouldn't make much sense (stateful vs stateless) but my understanding is that socks would allow me to do what I want.</p>
  
  <p>So far the only way to achieve what I want seems to be dirty hacking of imaplib... would rather avoid it if I can. </p>