コード例 #1
0
 def __init__(self, clientSocket, serverName, serverPort, spam, unsure):
     POP3ProxyBase.__init__(self, clientSocket, serverName, serverPort)
     self.handlers = {'RETR': self.onRetr}
     state.totalSessions += 1
     state.activeSessions += 1
     self.isClosed = False
     self.spam_folder = spam
     self.unsure_folder = unsure
コード例 #2
0
ファイル: sb_pop3dnd.py プロジェクト: alexeip0/spambayes
 def __init__(self, clientSocket, serverName, serverPort, spam, unsure):
     POP3ProxyBase.__init__(self, clientSocket, serverName, serverPort)
     self.handlers = {'RETR': self.onRetr}
     state.totalSessions += 1
     state.activeSessions += 1
     self.isClosed = False
     self.spam_folder = spam
     self.unsure_folder = unsure
コード例 #3
0
 def close(self):

        if not self.isClosed:

            self.isClosed = True

            state.activeSessions -= 1

            POP3ProxyBase.close(self)
コード例 #4
0
ファイル: sb_pop3dnd.py プロジェクト: alexeip0/spambayes
 def recv(self, size):
     """Logs the data to the log file."""
     data = POP3ProxyBase.recv(self, size)
     if options["globals", "verbose"]:
         state.logFile.write(data)
         state.logFile.flush()
     return data
コード例 #5
0
 def recv(self, size):
     """Logs the data to the log file."""
     data = POP3ProxyBase.recv(self, size)
     if options["globals", "verbose"]:
         state.logFile.write(data)
         state.logFile.flush()
     return data
コード例 #6
0
ファイル: sb_pop3dnd.py プロジェクト: alexeip0/spambayes
 def send(self, data):
     """Logs the data to the log file."""
     if options["globals", "verbose"]:
         state.logFile.write(data)
         state.logFile.flush()
     try:
         return POP3ProxyBase.send(self, data)
     except socket.error:
         self.close()
コード例 #7
0
 def send(self, data):
     """Logs the data to the log file."""
     if options["globals", "verbose"]:
         state.logFile.write(data)
         state.logFile.flush()
     try:
         return POP3ProxyBase.send(self, data)
     except socket.error:
         self.close()
コード例 #8
0
ファイル: sb_pop3dnd.py プロジェクト: alexeip0/spambayes
 def close(self):
     # This can be called multiple times by async.
     if not self.isClosed:
         self.isClosed = True
         state.activeSessions -= 1
         POP3ProxyBase.close(self)
コード例 #9
0
ファイル: sb_pop3dnd.py プロジェクト: Xodarap/Eipi
 def close(self):
     # This can be called multiple times by async.
     if not self.isClosed:
         self.isClosed = True
         state.activeSessions -= 1
         POP3ProxyBase.close(self)
コード例 #10
0
class  RedirectingBayesProxy (POP3ProxyBase) :
	"""Proxies between an email client and a POP3 server, redirecting
    mail to the imap server as necessary.  It acts on the following
    POP3 commands:
     o RETR:
        o Adds the judgement header based on the raw headers and body
          of the message.
    """
	    intercept_message = 'From: "Spambayes" <*****@*****.**>\r\n' \
                        'Subject: Spambayes Intercept\r\n\r\nA message ' \
                        'was intercepted by Spambayes (it scored %s).\r\n' \
                        '\r\nYou may find it in the Spam or Unsure ' \
                        'folder.\r\n\r\n'
	    def __init__(self, clientSocket, serverName, serverPort, spam, unsure):

        POP3ProxyBase.__init__(self, clientSocket, serverName, serverPort)

        self.handlers = {'RETR': self.onRetr}

        state.totalSessions += 1

        state.activeSessions += 1

        self.isClosed = False

        self.spam_folder = spam

        self.unsure_folder = unsure
 def send(self, data):

        """Logs the data to the log file."""