Mercurial > libervia-backend
annotate src/plugins/plugin_misc_imap.py @ 255:55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 17 Jan 2011 21:26:16 +0100 |
parents | 9fc32d1d9046 |
children | 012c38b56cdd |
rev | line source |
---|---|
253 | 1 #!/usr/bin/python |
2 # -*- coding: utf-8 -*- | |
3 | |
4 """ | |
5 SAT plugin for managing imap server | |
6 Copyright (C) 2011 Jérôme Poisson (goffi@goffi.org) | |
7 | |
8 This program is free software: you can redistribute it and/or modify | |
9 it under the terms of the GNU General Public License as published by | |
10 the Free Software Foundation, either version 3 of the License, or | |
11 (at your option) any later version. | |
12 | |
13 This program is distributed in the hope that it will be useful, | |
14 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 GNU General Public License for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
19 along with this program. If not, see <http://www.gnu.org/licenses/>. | |
20 """ | |
21 | |
22 from logging import debug, info, error | |
23 import warnings | |
24 from twisted.internet import protocol | |
25 from twisted.words.protocols.jabber import error as jab_error | |
26 from twisted.cred import portal,checkers | |
27 from twisted.mail import imap4 | |
28 from email.parser import Parser | |
29 import email.message | |
30 import os,os.path | |
31 from cStringIO import StringIO | |
32 from twisted.internet import reactor | |
33 import pdb | |
34 | |
35 | |
36 from zope.interface import implements | |
37 | |
38 | |
39 PLUGIN_INFO = { | |
40 "name": "IMAP server Plugin", | |
41 "import_name": "IMAP", | |
42 "type": "Misc", | |
43 "protocols": [], | |
44 "dependencies": ["Maildir"], | |
45 "main": "IMAP_server", | |
46 "handler": "no", | |
47 "description": _("""Create an Imap server that you can use to read your "normal" type messages""") | |
48 } | |
49 | |
50 class IMAP_server(): | |
51 | |
52 params = """ | |
53 <params> | |
54 <general> | |
55 <category name="IMAP Server"> | |
56 <param name="Port" value="10143" type="string" /> | |
57 </category> | |
58 </general> | |
59 </params> | |
60 """ | |
61 | |
62 def __init__(self, host): | |
63 info(_("Plugin Imap Server initialization")) | |
64 self.host = host | |
65 | |
66 #parameters | |
67 host.memory.importParams(self.params) | |
68 | |
69 port = int(self.host.memory.getParamA("Port", "IMAP Server")) | |
70 info(_("Launching IMAP server on port %d"), port) | |
71 | |
72 self.server_factory = ImapServerFactory(self.host) | |
73 reactor.listenTCP(port, self.server_factory) | |
74 | |
75 class Message(): | |
76 implements(imap4.IMessage) | |
77 | |
255
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
78 def __init__(self, uid, flags, mess_fp): |
253 | 79 debug('Message Init') |
80 self.uid=uid | |
255
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
81 self.flags=flags |
253 | 82 self.mess_fp=mess_fp |
83 self.message=Parser().parse(mess_fp) | |
84 | |
85 def getUID(self): | |
86 """Retrieve the unique identifier associated with this message. | |
87 """ | |
88 debug('getUID (message)') | |
254
9fc32d1d9046
Plugin IMAP, plugin MAILDIR: added IMAP's UID management, mailbox data persistence
Goffi <goffi@goffi.org>
parents:
253
diff
changeset
|
89 debug ('===>%i', self.uid) |
253 | 90 return self.uid |
91 | |
92 def getFlags(self): | |
93 """Retrieve the flags associated with this message. | |
94 @return: The flags, represented as strings. | |
95 """ | |
96 debug('getFlags') | |
255
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
97 return self.flags |
253 | 98 |
99 def getInternalDate(self): | |
100 """Retrieve the date internally associated with this message. | |
101 @return: An RFC822-formatted date string. | |
102 """ | |
103 debug('getInternalDate') | |
104 return self.message['Date'] | |
105 | |
106 | |
107 def getHeaders(self, negate, *names): | |
108 """Retrieve a group of message headers. | |
109 @param names: The names of the headers to retrieve or omit. | |
110 @param negate: If True, indicates that the headers listed in names | |
111 should be omitted from the return value, rather than included. | |
112 @return: A mapping of header field names to header field values | |
113 """ | |
114 debug('getHeaders %s - %s' % (negate, names)) | |
115 final_dict={} | |
116 to_check=[name.lower() for name in names] | |
117 for header in self.message.keys(): | |
118 if (negate and not header.lower() in to_check) or \ | |
119 (not negate and header.lower() in to_check): | |
120 final_dict[header]=self.message[header] | |
121 return final_dict | |
122 | |
123 def getBodyFile(self): | |
124 """Retrieve a file object containing only the body of this message. | |
125 """ | |
126 debug('getBodyFile') | |
127 return StringIO(self.message.get_payload()) | |
128 | |
129 def getSize(self): | |
130 """Retrieve the total size, in octets, of this message. | |
131 """ | |
132 debug('getSize') | |
133 self.mess_fp.seek(0,os.SEEK_END) | |
134 return self.mess_fp.tell() | |
135 | |
136 | |
137 def isMultipart(self): | |
138 """Indicate whether this message has subparts. | |
139 """ | |
140 debug('isMultipart') | |
141 return False | |
142 | |
143 def getSubPart(self,part): | |
144 """Retrieve a MIME sub-message | |
145 @param part: The number of the part to retrieve, indexed from 0. | |
146 @return: The specified sub-part. | |
147 """ | |
148 debug('getSubPart') | |
149 return TypeError | |
150 | |
151 | |
152 class SatMailbox: | |
153 implements(imap4.IMailbox) | |
154 | |
155 def __init__(self,host,name): | |
156 self.host = host | |
157 self.listeners=set() | |
158 debug ('Mailbox init (%s)', name) | |
159 if name!="INBOX": | |
160 raise imap4.MailboxException("Only INBOX is managed for the moment") | |
161 self.name=name | |
162 self.mailbox=self.host.plugins["Maildir"].accessMessageBox("INBOX",self.newMessage) | |
163 | |
164 def newMessage(self): | |
165 """Called when a new message is in the mailbox""" | |
166 debug ("newMessage signal received") | |
167 nb_messages=self.getMessageCount() | |
168 for listener in self.listeners: | |
169 listener.newMessages(nb_messages,None) | |
170 | |
171 def getUIDValidity(self): | |
172 """Return the unique validity identifier for this mailbox. | |
173 """ | |
174 debug ('getUIDValidity') | |
175 return 0 | |
176 | |
177 def getUIDNext(self): | |
178 """Return the likely UID for the next message added to this mailbox. | |
179 """ | |
180 debug ('getUIDNext') | |
254
9fc32d1d9046
Plugin IMAP, plugin MAILDIR: added IMAP's UID management, mailbox data persistence
Goffi <goffi@goffi.org>
parents:
253
diff
changeset
|
181 return self.mailbox.getNextUid() |
253 | 182 |
183 def getUID(self,message): | |
184 """Return the UID of a message in the mailbox | |
185 @param message: The message sequence number | |
186 @return: The UID of the message. | |
187 """ | |
255
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
188 debug ('getUID (%i)' % message) |
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
189 #return self.mailbox.getUid(message-1) #XXX: it seems that this method get uid and not message sequence number |
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
190 return message |
253 | 191 |
192 def getMessageCount(self): | |
193 """Return the number of messages in this mailbox. | |
194 """ | |
195 debug('getMessageCount') | |
196 ret = self.mailbox.getMessageCount() | |
197 debug("count = %i" % ret) | |
198 return ret | |
199 | |
200 def getRecentCount(self): | |
201 """Return the number of messages with the 'Recent' flag. | |
202 """ | |
203 debug('getRecentCount') | |
255
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
204 return len(self.mailbox.getMessageIdsWithFlag('\\Recent')) |
253 | 205 |
206 def getUnseenCount(self): | |
207 """Return the number of messages with the 'Unseen' flag. | |
208 """ | |
209 debug('getUnseenCount') | |
255
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
210 return self.getMessageCount()-len(self.mailbox.getMessageIdsWithFlag('\\Seen')) |
253 | 211 |
212 def isWriteable(self): | |
213 """Get the read/write status of the mailbox. | |
214 @return: A true value if write permission is allowed, a false value otherwise. | |
215 """ | |
216 debug('isWriteable') | |
217 return True | |
218 | |
219 def destroy(self): | |
220 """Called before this mailbox is deleted, permanently. | |
221 """ | |
222 debug('destroy') | |
223 | |
224 | |
225 def requestStatus(self, names): | |
226 """Return status information about this mailbox. | |
227 @param names: The status names to return information regarding. | |
228 The possible values for each name are: MESSAGES, RECENT, UIDNEXT, | |
229 UIDVALIDITY, UNSEEN. | |
230 @return: A dictionary containing status information about the | |
231 requested names is returned. If the process of looking this | |
232 information up would be costly, a deferred whose callback will | |
233 eventually be passed this dictionary is returned instead. | |
234 """ | |
235 debug('requestStatus') | |
236 return imap4.statusRequestHelper(self, names) | |
237 | |
238 def addListener(self, listener): | |
239 """Add a mailbox change listener | |
240 | |
241 @type listener: Any object which implements C{IMailboxListener} | |
242 @param listener: An object to add to the set of those which will | |
243 be notified when the contents of this mailbox change. | |
244 """ | |
245 debug('addListener %s' % listener) | |
246 self.listeners.add(listener) | |
247 | |
248 def removeListener(self, listener): | |
249 """Remove a mailbox change listener | |
250 | |
251 @type listener: Any object previously added to and not removed from | |
252 this mailbox as a listener. | |
253 @param listener: The object to remove from the set of listeners. | |
254 | |
255 @raise ValueError: Raised when the given object is not a listener for | |
256 this mailbox. | |
257 """ | |
258 debug('removeListener') | |
259 if listener in self.listeners: | |
260 self.listeners.remove(listener) | |
261 else: | |
262 raise imap4.MailboxException('Trying to remove an unknown listener') | |
263 | |
264 def addMessage(self, message, flags = (), date = None): | |
265 """Add the given message to this mailbox. | |
266 @param message: The RFC822 formatted message | |
267 @param flags: The flags to associate with this message | |
268 @param date: If specified, the date to associate with this | |
269 @return: A deferred whose callback is invoked with the message | |
270 id if the message is added successfully and whose errback is | |
271 invoked otherwise. | |
272 """ | |
273 debug('addMessage') | |
274 raise NotImplementedError | |
275 | |
276 def expunge(self): | |
277 """Remove all messages flagged \\Deleted. | |
278 @return: The list of message sequence numbers which were deleted, | |
279 or a Deferred whose callback will be invoked with such a list. | |
280 """ | |
281 debug('expunge') | |
255
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
282 self.mailbox.removeDeleted() |
253 | 283 |
284 def fetch(self, messages, uid): | |
285 """Retrieve one or more messages. | |
286 @param messages: The identifiers of messages to retrieve information | |
287 about | |
288 @param uid: If true, the IDs specified in the query are UIDs; | |
289 """ | |
290 debug('fetch (%s, %s)'%(messages,uid)) | |
254
9fc32d1d9046
Plugin IMAP, plugin MAILDIR: added IMAP's UID management, mailbox data persistence
Goffi <goffi@goffi.org>
parents:
253
diff
changeset
|
291 if uid: |
9fc32d1d9046
Plugin IMAP, plugin MAILDIR: added IMAP's UID management, mailbox data persistence
Goffi <goffi@goffi.org>
parents:
253
diff
changeset
|
292 messages.last = self.mailbox.getMaxUid() |
9fc32d1d9046
Plugin IMAP, plugin MAILDIR: added IMAP's UID management, mailbox data persistence
Goffi <goffi@goffi.org>
parents:
253
diff
changeset
|
293 messages.getnext = self.mailbox.getNextExistingUid |
9fc32d1d9046
Plugin IMAP, plugin MAILDIR: added IMAP's UID management, mailbox data persistence
Goffi <goffi@goffi.org>
parents:
253
diff
changeset
|
294 for mess_uid in messages: |
9fc32d1d9046
Plugin IMAP, plugin MAILDIR: added IMAP's UID management, mailbox data persistence
Goffi <goffi@goffi.org>
parents:
253
diff
changeset
|
295 if mess_uid == None: |
9fc32d1d9046
Plugin IMAP, plugin MAILDIR: added IMAP's UID management, mailbox data persistence
Goffi <goffi@goffi.org>
parents:
253
diff
changeset
|
296 debug ('stopping iteration') |
9fc32d1d9046
Plugin IMAP, plugin MAILDIR: added IMAP's UID management, mailbox data persistence
Goffi <goffi@goffi.org>
parents:
253
diff
changeset
|
297 raise StopIteration |
9fc32d1d9046
Plugin IMAP, plugin MAILDIR: added IMAP's UID management, mailbox data persistence
Goffi <goffi@goffi.org>
parents:
253
diff
changeset
|
298 try: |
255
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
299 yield (mess_uid,Message(mess_uid,self.mailbox.getFlagsUid(mess_uid), self.mailbox.getMessageUid(mess_uid))) |
254
9fc32d1d9046
Plugin IMAP, plugin MAILDIR: added IMAP's UID management, mailbox data persistence
Goffi <goffi@goffi.org>
parents:
253
diff
changeset
|
300 except IndexError: |
9fc32d1d9046
Plugin IMAP, plugin MAILDIR: added IMAP's UID management, mailbox data persistence
Goffi <goffi@goffi.org>
parents:
253
diff
changeset
|
301 continue |
9fc32d1d9046
Plugin IMAP, plugin MAILDIR: added IMAP's UID management, mailbox data persistence
Goffi <goffi@goffi.org>
parents:
253
diff
changeset
|
302 else: |
9fc32d1d9046
Plugin IMAP, plugin MAILDIR: added IMAP's UID management, mailbox data persistence
Goffi <goffi@goffi.org>
parents:
253
diff
changeset
|
303 messages.last = self.getMessageCount() |
9fc32d1d9046
Plugin IMAP, plugin MAILDIR: added IMAP's UID management, mailbox data persistence
Goffi <goffi@goffi.org>
parents:
253
diff
changeset
|
304 for mess_idx in messages: |
9fc32d1d9046
Plugin IMAP, plugin MAILDIR: added IMAP's UID management, mailbox data persistence
Goffi <goffi@goffi.org>
parents:
253
diff
changeset
|
305 if mess_idx>self.getMessageCount(): |
9fc32d1d9046
Plugin IMAP, plugin MAILDIR: added IMAP's UID management, mailbox data persistence
Goffi <goffi@goffi.org>
parents:
253
diff
changeset
|
306 raise StopIteration |
255
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
307 yield (mess_idx,Message(mess_idx,self.mailbox.getFlags(mess_idx),self.mailbox.getMessage(mess_idx-1))) |
253 | 308 |
309 def store(self, messages, flags, mode, uid): | |
310 """Set the flags of one or more messages. | |
311 @param messages: The identifiers of the messages to set the flags of. | |
312 @param flags: The flags to set, unset, or add. | |
313 @param mode: If mode is -1, these flags should be removed from the | |
314 specified messages. If mode is 1, these flags should be added to | |
315 the specified messages. If mode is 0, all existing flags should be | |
316 cleared and these flags should be added. | |
317 @param uid: If true, the IDs specified in the query are UIDs; | |
318 otherwise they are message sequence IDs. | |
319 @return: A dict mapping message sequence numbers to sequences of str | |
320 representing the flags set on the message after this operation has | |
321 been performed, or a Deferred whose callback will be invoked with | |
322 such a dict. | |
323 """ | |
324 debug('store') | |
255
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
325 |
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
326 def updateFlags(getF,setF): |
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
327 ret = {} |
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
328 for mess_id in messages: |
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
329 if (uid and mess_id == None) or (not uid and mess_id>self.getMessageCount()): |
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
330 break |
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
331 _flags=set(getF(mess_id) if mode else []) |
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
332 if mode==-1: |
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
333 _flags.difference_update(set(flags)) |
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
334 else: |
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
335 _flags.update(set(flags)) |
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
336 new_flags=list(_flags) |
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
337 setF(mess_id, new_flags) |
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
338 ret[mess_id] = new_flags |
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
339 return ret |
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
340 |
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
341 if uid: |
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
342 messages.last = self.mailbox.getMaxUid() |
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
343 messages.getnext = self.mailbox.getNextExistingUid |
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
344 return updateFlags(self.mailbox.getFlagsUid,self.mailbox.setFlagsUid) |
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
345 else: |
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
346 messages.last = self.getMessageCount() |
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
347 return updateFlags(self.mailbox.getFlags,self.mailbox.setFlags) |
253 | 348 |
349 def getFlags(self): | |
350 """Return the flags defined in this mailbox | |
351 Flags with the \\ prefix are reserved for use as system flags. | |
352 @return: A list of the flags that can be set on messages in this mailbox. | |
353 """ | |
354 debug('getFlags') | |
255
55b750017b71
plugin IMAP, plugin Maildir: added flag, IMAP's uid management
Goffi <goffi@goffi.org>
parents:
254
diff
changeset
|
355 return ['\Seen','\Answered','\Flagged','\Deleted','\Draft'] #TODO: add '\Recent' |
253 | 356 |
357 def getHierarchicalDelimiter(self): | |
358 """Get the character which delimits namespaces for in this mailbox. | |
359 """ | |
360 debug('getHierarchicalDelimiter') | |
361 return '.' | |
362 | |
363 | |
364 | |
365 class ImapAccount(imap4.MemoryAccount): | |
366 #implements(imap4.IAccount) | |
367 # Actually implement the interface here | |
368 | |
369 def __init__(self, host, name): | |
370 debug("ImapAccount init") | |
371 self.host=host | |
372 imap4.MemoryAccount.__init__(self,name) | |
373 self.addMailbox("Inbox") #We only manage Inbox for the moment | |
374 debug ('INBOX added') | |
375 | |
376 def _emptyMailbox(self, name, id): | |
377 return SatMailbox(self.host,name) | |
378 | |
379 | |
380 class ImapRealm: | |
381 implements(portal.IRealm) | |
382 | |
383 def __init__(self,host): | |
384 self.host = host | |
385 | |
386 def requestAvatar(self, avatarID, mind, *interfaces): | |
387 debug('requestAvatar') | |
388 if imap4.IAccount not in interfaces: | |
389 raise NotImplementedError | |
390 return imap4.IAccount, ImapAccount(self.host,avatarID), lambda:None | |
391 | |
392 class ImapServerFactory(protocol.ServerFactory): | |
393 protocol = imap4.IMAP4Server | |
394 | |
395 def __init__(self, host): | |
396 self.host=host | |
397 | |
398 def startedConnecting(self, connector): | |
399 debug (_("IMAP server connection started")) | |
400 | |
401 def clientConnectionLost(self, connector, reason): | |
402 debug (_("IMAP server connection lost (reason: %s)"), reason) | |
403 | |
404 def buildProtocol(self, addr): | |
405 debug ("Building protocole") | |
406 prot = protocol.ServerFactory.buildProtocol(self, addr) | |
407 prot.portal = portal.Portal(ImapRealm(self.host)) | |
408 prot.portal.registerChecker(checkers.InMemoryUsernamePasswordDatabaseDontUse(goffi="toto")) | |
409 return prot |