!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/5.6.40 

uname -a: Linux cpanel06wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.80.el6.x86_64 #1 SMP Thu Sep 24
01:42:00 EDT 2020 x86_64
 

uid=851(cp949260) gid=853(cp949260) groups=853(cp949260) 

Safe-mode: OFF (not secure)

/etc/mail/spamassassin/CMAE-SA/example/python/   drwxr-xr-x
Free 215.66 GB of 981.82 GB (21.97%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     mbox.py (4.09 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
"""@package mbox
Abstract an mbox file.

This package contains two classes
  mail which abstracts a single email
and
  mbox which abstracts an mbox file as a sequence of mails
"""

class mail :
    """ Abstract an email.

    This is a simple abstraction of an email. 
    """
    def __init__(self, frm) :
        """ Initialize an instance setting the instance vars to defalult values.
        """
        self.from_line = frm
        self.text = ''
        self.body_offset = -1

    def accumulate(self, line) :
        """ Append a line to the mail.

        Append the next line to the mail, and check for the break between the
        headers and the body
        """
        self.text += line
        if ((line == '\n') | (line == '\r\n')) & (self.body_offset < 0) :
            self.body_offset = len(self.text)
        
    def valid(self) :
        """ Test for valid mail.

        Return True if we have text and the text has a body
        """
        return (self.text != '') & (self.body_offset > 0)

    def fetch_header(self, header) :
        """ Fetch a given header from the mail.

        Search the mail for the specified header and return it,
        unfolding it as necessary. Note that if there are multiple
        headers with the same name, this will only return the first
        occurance.
        """
        start = 0
        while True :
            idx = self.text.find(header, start, self.body_offset)
            if idx < 0 :
                return None
            if (idx == 0) | (self.text[idx-1] == '\n') :
                st1 = idx
                hdr = ''
                while not hdr :
                    eidx = self.text.find('\n', st1, self.body_offset)
                    if eidx < 0 :
                        return None
                    if self.text[eidx+1] != ' ':
                        hdr = self.text[idx:eidx]
                    else :
                        st1 = eidx+1
                hdr.replace('\r', '')
                hdr.replace('\n', '')
                return hdr
            else :
                start = idx+1


class mbox :
    """ Abstract an mbox file.

    This is a simple abstraction of an mbox file, set up as an iterator
    """
    def __init__(self, path) :
        """ Initalize a new instance

        Set our instance vars and open the file. 

        Keyword arguments:
        path -- the path to the file.
        """
        self.last_line_empty = False
        self.from_line = ''
        self.rfc822 = ''
        self.mbox_file = None
        self.mbox_file = open(path, 'r')

    def next_mail(self) :
        """ Get the next mail from the file.
        
        Return the next mail int the file as a mail object,
        or None if no more mails are available.
        """
        if self.mbox_file is None :
            return None
        while not self.from_line :
            line1 = self.mbox_file.readline()
            if not line1 :
                self.mbox_file.close()
                self.mbox_file = None
                return None
            if line1[:5] == 'From ' :
                self.from_line = line1
        
        amail = mail(self.from_line)

        self.from_line = ''
        while (not self.from_line) & (self.mbox_file is not None) :
            line = self.mbox_file.readline()
            if line :
                if (line[:5] == 'From ') & self.last_line_empty :
                    self.from_line = line
                else :
                    self.last_line_empty = ((line == '\n') | (line == '\r\n') )
                    amail.accumulate(line)
            else :
                self.mbox_file.close()
                self.mbox_file = None
        return amail 

    def __iter__(self) :
        """ Allow this object to be used as an iterator """
        return self

    def next(self) :
        """ Wrap next_mail so we can use it as an iterator """
        m = self.next_mail()
        if m is None :
            raise StopIteration
        else :
            return m

    def __del__(self):
        """ On destruction, make sure our file is closed """
        if self.mbox_file is not None:
            self.mbox_file.close()
            

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0177 ]--