当前位置: 首页>>代码示例>>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;未经允许,请勿转载。