we always want to DOTLOCK mboxes.
[apps/madmutt.git] / pop / mx_pop.c
1 /*
2  * This file is part of mutt-ng, see http://www.muttng.org/.
3  * It's licensed under the GNU General Public License,
4  * please see the file GPL in the top level source directory.
5  */
6
7 #include <lib-lib/lib-lib.h>
8
9 #include "mutt.h"
10 #include "pop.h"
11 #include "mx.h"
12 #include "mx_pop.h"
13
14 static int pop_is_magic (const char* path, struct stat* st __attribute__ ((unused))) {
15   url_scheme_t s = url_check_scheme (NONULL (path));
16   return ((s == U_POP || s == U_POPS) ? M_POP : -1);
17 }
18
19 static int acl_check_pop (CONTEXT* ctx __attribute__ ((unused)), int bit) {
20   switch (bit) {
21     case ACL_INSERT:    /* editing messages */
22     case ACL_WRITE:     /* change importance */
23       return (0);
24     case ACL_DELETE:    /* (un)deletion */
25     case ACL_SEEN:      /* mark as read */
26       return (1);
27     default:
28       return (0);
29   }
30 }
31
32 mx_t const pop_mx = {
33     M_POP,
34     0,
35     pop_is_magic,
36     NULL,
37     NULL,
38     pop_open_mailbox,
39     NULL,
40     acl_check_pop,
41     pop_check_mailbox,
42     pop_close_mailbox,
43     pop_sync_mailbox,
44     NULL,
45 };