File: mail.py

package info (click to toggle)
pypaperless 5.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,440 kB
  • sloc: python: 5,607; sh: 26; makefile: 3
file content (105 lines) | stat: -rw-r--r-- 2,756 bytes parent folder | download
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
94
95
96
97
98
99
100
101
102
103
104
105
"""Mail snapshots."""

# mypy: ignore-errors

DATA_MAIL_ACCOUNTS = {
    "count": 1,
    "next": None,
    "previous": None,
    "all": [1],
    "results": [
        {
            "id": 1,
            "name": "Test Account",
            "imap_server": "imap.omega.net",
            "imap_port": 1337,
            "imap_security": 2,
            "username": "omega-weapon",
            "password": "********************",
            "character_set": "UTF-8",
            "is_token": False,
            "owner": 1,
            "user_can_change": True,
        }
    ],
}

DATA_MAIL_RULES = {
    "count": 1,
    "next": None,
    "previous": None,
    "all": [1],
    "results": [
        {
            "id": 1,
            "name": "Test",
            "account": 1,
            "folder": "INBOX",
            "filter_from": None,
            "filter_to": None,
            "filter_subject": None,
            "filter_body": None,
            "filter_attachment_filename_include": None,
            "filter_attachment_filename_exclude": None,
            "maximum_age": 3,
            "action": 3,
            "action_parameter": None,
            "assign_title_from": 1,
            "assign_tags": [],
            "assign_correspondent_from": 1,
            "assign_correspondent": None,
            "assign_document_type": None,
            "assign_owner_from_rule": True,
            "order": 1,
            "attachment_type": 1,
            "consumption_scope": 1,
            "owner": 1,
            "user_can_change": True,
        }
    ],
}

DATA_PROCESSED_MAIL = {
    "count": 3,
    "next": None,
    "previous": None,
    "all": [1, 2, 3],
    "results": [
        {
            "id": 1,
            "owner": 1,
            "rule": 1,
            "folder": "INBOX",
            "uid": "abcdef",
            "subject": "Invoice #1",
            "received": "2025-11-16T08:18:25+01:00",
            "processed": "2025-11-16T11:00:17.838202+01:00",
            "status": "SUCCESS",
            "error": None,
        },
        {
            "id": 2,
            "owner": 1,
            "rule": 1,
            "folder": "INBOX",
            "uid": "fedcba",
            "subject": "Invoice #2",
            "received": "2025-11-16T07:56:16+01:00",
            "processed": "2025-11-16T08:00:17.660439+01:00",
            "status": "SUCCESS",
            "error": None,
        },
        {
            "id": 3,
            "owner": 1,
            "rule": 1,
            "folder": "INBOX",
            "uid": "123456",
            "subject": "Invoice #3",
            "received": "2025-11-16T13:54:23+01:00",
            "processed": "2025-11-16T14:00:17.846562+01:00",
            "status": "SUCCESS",
            "error": None,
        },
    ],
}