MailBox¶
email_profile.clients.imap.mailbox.MailBox
¶
One IMAP mailbox addressed by its server-side name.
Source code in email_profile/clients/imap/mailbox.py
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 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | |
PATTERN = re.compile('\\((?P<flags>.*?)\\) "(?P<delimiter>.*)" (?P<name>.*)')
class-attribute
instance-attribute
¶
delimiter = delimiter
instance-attribute
¶
flags = flags or []
instance-attribute
¶
name = name.strip().strip('"')
instance-attribute
¶
__init__(*, client, name, delimiter='/', flags=None)
¶
Source code in email_profile/clients/imap/mailbox.py
63 64 65 66 67 68 69 70 71 72 73 74 | |
__repr__()
¶
Source code in email_profile/clients/imap/mailbox.py
212 213 | |
append(message, flags='', date=None)
¶
Upload one message into this mailbox via IMAP APPEND.
Returns the new AppendedUID when the server supports UIDPLUS
(RFC 4315). Returns None otherwise — the message is still saved.
Source code in email_profile/clients/imap/mailbox.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | |
copy(target, destination)
¶
Copy a message into another mailbox (UID COPY).
Source code in email_profile/clients/imap/mailbox.py
179 180 181 182 | |
create()
¶
Create this mailbox on the server.
Source code in email_profile/clients/imap/mailbox.py
199 200 201 | |
delete(target, expunge=False)
¶
Mark a message as deleted. Call :meth:expunge to commit.
Source code in email_profile/clients/imap/mailbox.py
164 165 166 167 168 | |
delete_mailbox()
¶
Delete this mailbox from the server.
Source code in email_profile/clients/imap/mailbox.py
203 204 205 | |
expunge()
¶
Permanently remove every message marked as \Deleted.
Source code in email_profile/clients/imap/mailbox.py
174 175 176 177 | |
flag(target)
¶
Flag a message (\Flagged).
Source code in email_profile/clients/imap/mailbox.py
156 157 158 | |
from_imap_detail(client, detail)
classmethod
¶
Parse one entry from IMAP.list().
Source code in email_profile/clients/imap/mailbox.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |
mark_seen(target)
¶
Mark a message as read (\Seen).
Source code in email_profile/clients/imap/mailbox.py
148 149 150 | |
mark_unseen(target)
¶
Mark a message as unread.
Source code in email_profile/clients/imap/mailbox.py
152 153 154 | |
move(target, destination)
¶
Move a message into another mailbox.
Prefers UID MOVE (RFC 6851). Falls back to copy + delete + expunge
when the server does not advertise the MOVE extension.
Source code in email_profile/clients/imap/mailbox.py
184 185 186 187 188 189 190 191 192 193 194 195 196 197 | |
rename_to(new_name)
¶
Rename this mailbox. Updates self.name in place.
Source code in email_profile/clients/imap/mailbox.py
207 208 209 210 | |
undelete(target)
¶
Unmark a message as deleted before the next expunge.
Source code in email_profile/clients/imap/mailbox.py
170 171 172 | |
unflag(target)
¶
Remove the \Flagged flag.
Source code in email_profile/clients/imap/mailbox.py
160 161 162 | |
where(query=None, **kwargs)
¶
Build a lazy search; pass a Query/Q/string OR filter kwargs.
Source code in email_profile/clients/imap/mailbox.py
94 95 96 97 98 99 100 101 102 103 104 105 | |