當前位置: 首頁>>代碼示例>>Python>>正文


Python poplib.POP3_SSL屬性代碼示例

本文整理匯總了Python中poplib.POP3_SSL屬性的典型用法代碼示例。如果您正苦於以下問題:Python poplib.POP3_SSL屬性的具體用法?Python poplib.POP3_SSL怎麽用?Python poplib.POP3_SSL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在poplib的用法示例。


在下文中一共展示了poplib.POP3_SSL屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: check

# 需要導入模塊: import poplib [as 別名]
# 或者: from poplib import POP3_SSL [as 別名]
def check(email, password):
    try:
        email = email
        password = password
        pop3_server = "pop.163.com"
        server = poplib.POP3(pop3_server)
        
        #ssl加密後使用
        #server = poplib.POP3_SSL('pop.163.com', '995')
        print(server.set_debuglevel(1)) #打印與服務器交互信息
        print(server.getwelcome()) #pop有歡迎信息
        server.user(email)
        server.pass_(password)
        print('Messages: %s. Size: %s' % server.stat())
        print(email+": successful")
    except poplib.error_proto as e:
        print(email+":fail")
        print(e) 
開發者ID:euphrat1ca,項目名稱:fuzzdb-collect,代碼行數:20,代碼來源:Testpop.py

示例2: test_context

# 需要導入模塊: import poplib [as 別名]
# 或者: from poplib import POP3_SSL [as 別名]
def test_context(self):
        ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
        self.assertRaises(ValueError, poplib.POP3_SSL, self.server.host,
                            self.server.port, keyfile=CERTFILE, context=ctx)
        self.assertRaises(ValueError, poplib.POP3_SSL, self.server.host,
                            self.server.port, certfile=CERTFILE, context=ctx)
        self.assertRaises(ValueError, poplib.POP3_SSL, self.server.host,
                            self.server.port, keyfile=CERTFILE,
                            certfile=CERTFILE, context=ctx)

        self.client.quit()
        self.client = poplib.POP3_SSL(self.server.host, self.server.port,
                                        context=ctx)
        self.assertIsInstance(self.client.sock, ssl.SSLSocket)
        self.assertIs(self.client.sock.context, ctx)
        self.assertTrue(self.client.noop().startswith(b'+OK')) 
開發者ID:Microvellum,項目名稱:Fluid-Designer,代碼行數:18,代碼來源:test_poplib.py

示例3: test

# 需要導入模塊: import poplib [as 別名]
# 或者: from poplib import POP3_SSL [as 別名]
def test(config):

    import poplib

    logger = logging.getLogger('POPListenerTest')

    server = poplib.POP3_SSL('localhost', config.get('port', 110))

    logger.info('Authenticating.')
    server.user('username')
    server.pass_('password')

    logger.info('Listing and retrieving messages.')
    print server.list()
    print server.retr(1)
    server.quit() 
開發者ID:fireeye,項目名稱:flare-fakenet-ng,代碼行數:18,代碼來源:POPListener.py

示例4: main

# 需要導入模塊: import poplib [as 別名]
# 或者: from poplib import POP3_SSL [as 別名]
def main(hostname,port,user,password):

        mailbox = poplib.POP3_SSL(hostname,port)

        try:
                mailbox.user(user)
                mailbox.pass_(password)
                response, listings, octet_count = mailbox.list()
                for listing in listings:
                        number, size = listing.decode('ascii').split()
                        print("Message %s has %s bytes" % (number, size))

        except poplib.error_proto as exception:
                print("Login failed:", exception)

        finally:
                mailbox.quit() 
開發者ID:PacktPublishing,項目名稱:Learning-Python-Networking-Second-Edition,代碼行數:19,代碼來源:mailbox_basic_params.py

示例5: run

# 需要導入模塊: import poplib [as 別名]
# 或者: from poplib import POP3_SSL [as 別名]
def run(self):
		value, user = getword()
		user = user.replace("\n","")
		value = value.replace("\n","")
		
		try:
			print "-"*12
			print "[+] User:",user,"Password:",value
			pop = poplib.POP3_SSL(server, 995)
			pop.user(user)
			pop.pass_(value)
			print "\t\t\n\nLogin successful:",user, value
			print "\t\tMail:",pop.stat()[0],"emails"
			print "\t\tSize:",pop.stat()[1],"bytes\n\n"
			success.append(user)
			success.append(value)
			success.append(pop.stat()[0])
			success.append(pop.stat()[1])
			pop.quit()
		except (poplib.error_proto), msg: 
			#print "An error occurred:", msg
			pass 
開發者ID:knightmare2600,項目名稱:d4rkc0de,代碼行數:24,代碼來源:gmailpopbrute.py

示例6: receive_pop_email

# 需要導入模塊: import poplib [as 別名]
# 或者: from poplib import POP3_SSL [as 別名]
def receive_pop_email():
    pop = poplib.POP3_SSL(host=pop_server)
    pop.set_debuglevel(1)
    pop.user(user)
    pop.pass_(password)
    # 列出郵件信息,包含郵件的大小和ID
    pop_reslut = pop.list()
    print(pop_reslut)
    print("==========")
    print(pop_reslut[2])
    pop_stat = pop.stat()
    # 第一項是代表的郵件ID
    for index in range(1, pop_stat[0]):
        print(pop.top(index, 0))
        if index > 5:
            break

    print(pop.retr(1))
    for line_content in pop.retr(1):
        print(line_content) 
開發者ID:menhuan,項目名稱:notes,代碼行數:22,代碼來源:email_lean.py

示例7: setUp

# 需要導入模塊: import poplib [as 別名]
# 或者: from poplib import POP3_SSL [as 別名]
def setUp(self):
        self.server = DummyPOP3Server((HOST, 0))
        self.server.handler = DummyPOP3_SSLHandler
        self.server.start()
        self.client = poplib.POP3_SSL(self.server.host, self.server.port) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:7,代碼來源:test_poplib.py

示例8: test__all__

# 需要導入模塊: import poplib [as 別名]
# 或者: from poplib import POP3_SSL [as 別名]
def test__all__(self):
        self.assertIn('POP3_SSL', poplib.__all__) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:4,代碼來源:test_poplib.py

示例9: getPopMail

# 需要導入模塊: import poplib [as 別名]
# 或者: from poplib import POP3_SSL [as 別名]
def getPopMail( mailDomain ):
    if mailDomain in ['163','gmali','126','qq','sina']:
        temp1 = 'pop.'+mailDomain+'.com'
        mail = poplib.POP3_SSL(temp1)   
    elif ( mailDomain == 'hotmail' ):
        mail = poplib.POP3_SSL('pop3.live.com')
    elif ( mailDomain == 'yahoo' ):
        mail = poplib.POP3_SSL('pop.mail.yahoo.com')
    return mail 
開發者ID:euphrat1ca,項目名稱:fuzzdb-collect,代碼行數:11,代碼來源:多線程驗證郵箱褲子.py

示例10: mailbruteforce

# 需要導入模塊: import poplib [as 別名]
# 或者: from poplib import POP3_SSL [as 別名]
def mailbruteforce(listuser,listpwd,type): 
    if len(listuser) < 1 or len(listpwd) < 1 : 
        print "[-] Error: An error occurred: No user or pass list\n" 
        return 1 
     
    for user in listuser: 
        for passwd in listpwd : 
            user = user.replace("\n","") 
            passwd = passwd.replace("\n","") 
             
            try: 
                print "-"*12 
                print "[+] User:",user,"Password:",passwd 
                 
#                 time.sleep(0.1)       
                if type in ['163','236']: 
                    popserver = poplib.POP3(server,110)         
                else: 
                    popserver = poplib.POP3_SSL(server,995) 
                popserver.user(user) 
                auth = popserver.pass_(passwd) 
                print auth 
                 
                if auth.split(' ')[0] == "+OK" or auth =="+OK": 
                    ret = (user,passwd,popserver.stat()[0],popserver.stat()[1]) 
                    success.append(ret) 
                    #print len(success) 
                    popserver.quit() 
                    break 
                else : 
                    popserver.quit() 
                    continue 
             
            except: 
                #print "An error occurred:", msg 
                pass 
開發者ID:euphrat1ca,項目名稱:fuzzdb-collect,代碼行數:38,代碼來源:baopo.py

示例11: setUp

# 需要導入模塊: import poplib [as 別名]
# 或者: from poplib import POP3_SSL [as 別名]
def setUp(self):
            self.server = DummyPOP3Server((HOST, 0))
            self.server.handler = DummyPOP3_SSLHandler
            self.server.start()
            self.client = poplib.POP3_SSL(self.server.host, self.server.port) 
開發者ID:dxwu,項目名稱:BinderFilter,代碼行數:7,代碼來源:test_poplib.py

示例12: test__all__

# 需要導入模塊: import poplib [as 別名]
# 或者: from poplib import POP3_SSL [as 別名]
def test__all__(self):
            self.assertIn('POP3_SSL', poplib.__all__) 
開發者ID:dxwu,項目名稱:BinderFilter,代碼行數:4,代碼來源:test_poplib.py

示例13: connect

# 需要導入模塊: import poplib [as 別名]
# 或者: from poplib import POP3_SSL [as 別名]
def connect(self, host, port, ssl, timeout):
    if ssl == '0':
      if not port:
        port = 110
      fp = POP3(host, int(port), timeout=int(timeout))
    else:
      if not port:
        port = 995
      fp = POP3_SSL(host, int(port)) # timeout=int(timeout)) # no timeout option in python2

    return TCP_Connection(fp, fp.welcome) 
開發者ID:lanjelot,項目名稱:patator,代碼行數:13,代碼來源:patator.py

示例14: setUp

# 需要導入模塊: import poplib [as 別名]
# 或者: from poplib import POP3_SSL [as 別名]
def setUp(self):
        self.server = DummyPOP3Server((HOST, PORT))
        self.server.handler = DummyPOP3_SSLHandler
        self.server.start()
        self.client = poplib.POP3_SSL(self.server.host, self.server.port) 
開發者ID:Microvellum,項目名稱:Fluid-Designer,代碼行數:7,代碼來源:test_poplib.py

示例15: connect

# 需要導入模塊: import poplib [as 別名]
# 或者: from poplib import POP3_SSL [as 別名]
def connect(self, host, port, ssl, timeout):
    if ssl == '0':
      if not port: port = 110
      fp = POP3(host, int(port), timeout=int(timeout))
    else:
      if not port: port = 995
      fp = POP3_SSL(host, int(port)) # timeout=int(timeout)) # no timeout option in python2

    return POP_Connection(fp, fp.welcome) 
開發者ID:c0rvax,項目名稱:project-black,代碼行數:11,代碼來源:patator_ext.py


注:本文中的poplib.POP3_SSL屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。