Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.112
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
lib /
python2.7 /
dist-packages /
getmailcore /
Delete
Unzip
Name
Size
Permission
Date
Action
__init__.py
923
B
-rwxrwxrwx
2017-11-02 16:52
__init__.pyc
1.08
KB
-rwxrwxrwx
2020-08-24 23:52
_pop3ssl.py
5.8
KB
-rwxrwxrwx
2009-04-05 21:10
_pop3ssl.pyc
5.94
KB
-rwxrwxrwx
2020-08-24 23:52
_retrieverbases.py
70.04
KB
-rwxrwxrwx
2017-11-02 16:52
_retrieverbases.pyc
52.54
KB
-rwxrwxrwx
2020-08-24 23:52
baseclasses.py
14.33
KB
-rwxrwxrwx
2012-06-20 05:27
baseclasses.pyc
16.14
KB
-rwxrwxrwx
2020-08-24 23:52
compatibility.py
2.39
KB
-rwxrwxrwx
2012-06-21 21:24
compatibility.pyc
2.19
KB
-rwxrwxrwx
2020-08-24 23:52
constants.py
222
B
-rwxrwxrwx
2006-01-27 18:13
constants.pyc
348
B
-rwxrwxrwx
2020-08-24 23:52
destinations.py
43.11
KB
-rwxrwxrwx
2016-09-11 17:30
destinations.pyc
37.52
KB
-rwxrwxrwx
2020-08-24 23:52
exceptions.py
2.3
KB
-rwxrwxrwx
2012-06-20 05:27
exceptions.pyc
3.87
KB
-rwxrwxrwx
2020-08-24 23:52
filters.py
19.38
KB
-rwxrwxrwx
2016-10-22 18:46
filters.pyc
17.34
KB
-rwxrwxrwx
2020-08-24 23:52
imap_utf7.py
3.66
KB
-rwxrwxrwx
2012-05-26 20:10
imap_utf7.pyc
5.04
KB
-rwxrwxrwx
2020-08-24 23:52
logging.py
3.47
KB
-rwxrwxrwx
2008-02-17 18:10
logging.pyc
4.84
KB
-rwxrwxrwx
2020-08-24 23:52
message.py
7.69
KB
-rwxrwxrwx
2013-08-03 22:27
message.pyc
6.87
KB
-rwxrwxrwx
2020-08-24 23:52
retrievers.py
20.76
KB
-rwxrwxrwx
2016-10-22 18:46
retrievers.pyc
19.47
KB
-rwxrwxrwx
2020-08-24 23:52
utilities.py
22.36
KB
-rwxrwxrwx
2016-09-11 17:30
utilities.pyc
20.41
KB
-rwxrwxrwx
2020-08-24 23:52
Save
Rename
#!/usr/bin/env python2.3 '''Provide an SSL-capable POP3 class. ''' __all__ = [ 'POP3_ssl_port', 'sslsocket', 'POP3SSL', ] import socket from poplib import POP3, CR, LF, CRLF, error_proto from getmailcore.exceptions import * import getmailcore.logging log = getmailcore.logging.Logger() POP3_ssl_port = 995 class sslsocket(object): '''The Python poplib.POP3() class mixes socket-like .sendall() and file-like .readline() for communications. That would be okay, except that the new socket.ssl objects provide only read() and write(), so they don't act like a socket /or/ like a file. Argh. This class takes a standard, connected socket.socket() object, sets it to blocking mode (required for socket.ssl() to work correctly, though apparently not documented), wraps .write() for .sendall() and implements .readline(). The modified POP3 class below can then use this to provide POP3-over-SSL. Thanks to Frank Benkstein for the inspiration. ''' def __init__(self, sock, keyfile=None, certfile=None): log.trace() self.sock = sock self.sock.setblocking(1) if keyfile and certfile: self.ssl = socket.ssl(self.sock, keyfile, certfile) else: self.ssl = socket.ssl(self.sock) self.buf = '' self.bufsize = 128 def _fillbuf(self): '''Fill an internal buffer for .readline() to use. ''' log.trace() want = self.bufsize - len(self.buf) log.trace('want %i bytes\n' % want) if want <= 0: return s = self.ssl.read(want) got = len(s) log.trace('got %i bytes\n' % got) self.buf += s def close(self): self.sock.close() self.ssl = None # self.sock.sendall def sendall(self, s): # Maybe only set blocking around this call? self.ssl.write(s) # self.file.readline def readline(self): '''Simple hack to implement .readline() on a non-file object that only supports .read(). ''' log.trace() line = '' try: if not self.buf: self._fillbuf() log.trace('checking self.buf\n') if self.buf: log.trace('self.buf = "%r", len %i\n' % (self.buf, len(self.buf))) while True: log.trace('looking for EOL\n') i = self.buf.find('\n') if i != -1: log.trace('EOL found at %d\n' % i) line += self.buf[:i + 1] self.buf = self.buf[i + 1:] break # else log.trace('EOL not found, trying to fill self.buf\n') line += self.buf self.buf = '' self._fillbuf() if not self.buf: log.trace('nothing read, exiting\n') break log.trace('end of loop\n') log.trace('returning line "%r"\n' % line) return line except (socket.sslerror, socket.error), o: raise getmailOperationError( 'socket/ssl error while reading from server (%s)' % o ) class POP3SSL(POP3): '''Thin subclass to add SSL functionality to the built-in POP3 class. Note that Python's socket module does not do certificate verification for SSL connections. This gets rid of the .file attribute from os.makefile(rawsock) and relies on sslsocket() above to provide .readline() instead. ''' def __init__(self, host, port=POP3_ssl_port, keyfile=None, certfile=None): if not ((certfile and keyfile) or (keyfile == certfile == None)): raise getmailConfigurationError('certfile requires keyfile') self.host = host self.port = port msg = "getaddrinfo returns an empty list" self.rawsock = None self.sock = None for res in socket.getaddrinfo(self.host, self.port, 0, socket.SOCK_STREAM): (af, socktype, proto, canonname, sa) = res try: self.rawsock = socket.socket(af, socktype, proto) self.rawsock.connect(sa) if certfile and keyfile: self.sock = sslsocket(self.rawsock, keyfile, certfile) else: self.sock = sslsocket(self.rawsock) except socket.error, msg: if self.rawsock: self.rawsock.close() self.rawsock = None continue break if not self.sock: raise socket.error, msg self._debugging = 0 self.welcome = self._getresp() # Internal: return one line from the server, stripping CRLF. # This is where all the CPU time of this module is consumed. # Raise error_proto('-ERR EOF') if the connection is closed. def _getline(self): line = self.sock.readline() if self._debugging > 1: print '*get*', `line` if not line: raise error_proto('-ERR EOF') octets = len(line) # server can send any combination of CR & LF # however, 'readline()' returns lines ending in LF # so only possibilities are ...LF, ...CRLF, CR...LF if line[-2:] == CRLF: return line[:-2], octets if line[0] == CR: return line[1:-1], octets return line[:-1], octets def quit(self): """Signoff: commit changes on server, unlock mailbox, close connection. """ try: resp = self._shortcmd('QUIT') except (error_proto, socket.error), val: resp = val self.sock.close() del self.sock return resp