This file is indexed.

/usr/share/pyshared/MailPing/maildir.py is in mailping 0.0.4ubuntu5+really0.0.4-3ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import os, errno, time, socket

def _mkdir(*a, **kw):
    try:
        os.mkdir(*a, **kw)
    except OSError, e:
        if e.errno == errno.EEXIST:
            pass
        else:
            raise

def create(path):
    _mkdir(path)
    _mkdir(os.path.join(path, 'cur'), 0700)
    _mkdir(os.path.join(path, 'new'), 0700)
    _mkdir(os.path.join(path, 'tmp'), 0700)

def process(path, callback):
    for subdir in [os.path.join(path, 'new'),
                   os.path.join(path, 'cur')]:
        for filename in os.listdir(subdir):
            callback(subdir, filename)


def getTimeFromFilename(filename):
    """
    Extract the delivery timestamp from a maildir message filename.

    See http://cr.yp.to/proto/maildir.html for more information.
    (Yes, I know DJB doesn't want people parsing the filenames.)

    Also parses microseconds when available. Return type is float when
    subsecond precision is possible, int otherwise.
    """

    # strip off potential info
    filename = filename.split(':', 1)[0]

    try:
        time, delivery, hostname = filename.split('.', 2)
    except ValueError:
        return None

    try:
        seconds = int(time)
    except ValueError:
        return None

    if delivery and delivery[0] not in '012345679':
        # looks like a new-style delivery identifier
        try:
            i = delivery.index('M')
        except ValueError:
            pass
        else:
            rest = delivery[i+1:]
            s = ''
            while rest and rest[0] in '0123456789':
                s = s + rest[0]
                rest = rest[1:]
            if s:
                try:
                    microseconds = int(s)
                except ValueError:
                    pass
                else:
                    return string.atof("%s.%s" % (seconds, microseconds))

    return int(seconds)

def generateMaildirName():
    curtime = time.time()
    return '%s.M%sP%s.%s' % (
        int(curtime),
        int((curtime-int(curtime))*10e6),
        os.getpid(),
        socket.gethostname().replace('/', r'\057').replace(':', r'\072')
        )

def deliverToMaildir(path, source):
    create(path)
    filename = generateMaildirName()
    tmp = os.path.join(path, 'tmp', filename)
    f = file(tmp, 'w')

    while True:
        data = source.read(8192)
        if not data:
            break
        f.write(data)

    f.close()
    os.rename(tmp, os.path.join(path, 'new', filename))