Author Topic: How can I fetch emails through a proxy?  (Read 1134 times)

0 Members and 2 Guests are viewing this topic.

Offline fox12345

  • Serf
  • *
  • Posts: 25
  • Cookies: -31
    • View Profile
How can I fetch emails through a proxy?
« on: October 10, 2013, 06:08:57 am »
Dear friends,
I want to write basic program to send email. so i use this script. as well as want to use proxy. So how to do it? please help me ... "exactly i want to send email through a proxy or proxy chain" How to develop this code?

Code: [Select]
import smtplib
fromaddr = ''
toaddrs = ''
msg = ''
 
username = ''
password = ''
 
server = smtplib . SMTP ( 'smtp.gmail.com: 587' )
server. ehlo ( )
server. starttls ( )
server. ehlo ( )
server. login ( username , password )
server. sendmail ( fromaddr , toaddrs , msg )
server. quit ( )
« Last Edit: October 10, 2013, 06:10:29 am by fox12345 »

Offline proxx

  • Avatarception
  • Global Moderator
  • Titan
  • *
  • Posts: 2803
  • Cookies: 256
  • ФФФ
    • View Profile
Re: How can I fetch emails through a proxy?
« Reply #1 on: October 10, 2013, 06:27:27 am »
Well it depends.
If you want to send mail through plan smtp your are likely going to need the assistance of the ISP of that particular network.
Most networks dont allow you to send stuff from port 25 and if that works its likely gonna be considered spam.

The majority of ISP's Ive seen have a specific address like smtp.thisisp.com, so depending on the provider for that specific proxy you need a way to obtain this data.
Smacking it through google like that basically blows all the need for any proxy in general.
Apart from the fact that google (like all major companies) keep very good track of what is a proxy and what not, its big business.

I personally would take a low level approach in combination with a module such as this: http://socksipy.sourceforge.net/
Routing it to the 'local' smtp server to me seems like the best approach.

I would suggest reading about that module ^ and find a clever way of using it for your purpose.
(maybe there are native proxy solutions/modules for sending email , that would be the easy way :P )

« Last Edit: October 10, 2013, 06:30:12 am by proxx »
Wtf where you thinking with that signature? - Phage.
This was another little experiment *evillaughter - Proxx.
Evilception... - Phage

Offline Ragehottie

  • Knight
  • **
  • Posts: 313
  • Cookies: -9
  • Hack to learn, not learn to hack.
    • View Profile
Re: How can I fetch emails through a proxy?
« Reply #2 on: October 20, 2013, 10:56:42 pm »
I have used urllib2, but that was unnecessarily hard so I switched to Requests(http://www.python-requests.org). Super easy, Its now the only http library I use.
There also should be some examples to use proxies on the website
Blog: rexmckinnon.tumblr.com

Offline proxx

  • Avatarception
  • Global Moderator
  • Titan
  • *
  • Posts: 2803
  • Cookies: 256
  • ФФФ
    • View Profile
Re: How can I fetch emails through a proxy?
« Reply #3 on: October 20, 2013, 11:04:00 pm »
I have used urllib2, but that was unnecessarily hard so I switched to Requests(http://www.python-requests.org). Super easy, Its now the only http library I use.
There also should be some examples to use proxies on the website

Thanks , wasnt aware of that.
requests looks pretty sweet.
+1
Wtf where you thinking with that signature? - Phage.
This was another little experiment *evillaughter - Proxx.
Evilception... - Phage

Offline vezzy

  • Royal Highness
  • ****
  • Posts: 771
  • Cookies: 172
    • View Profile
Re: How can I fetch emails through a proxy?
« Reply #4 on: October 20, 2013, 11:08:47 pm »
Thanks , wasnt aware of that.
requests looks pretty sweet.
+1

Odd.

It's extremely popular and recommended everywhere. Plenty of people even want it merged to the standard library. Personally though I never found the need for it, I've always been complacent with urllib2.

On the other hand, with Java it's a completely different story. Using java.net instead of Apache HttpComponents is pretty painful, though still manageable for smaller things.
Quote from: Dippy hippy
Just brushing though. I will be semi active mainly came to find a HQ botnet, like THOR or just any p2p botnet