acl-mailbox.c revision 11fec79522fc0cebe7321d1a9206568d22ddc1c0
/* Copyright (C) 2006 Timo Sirainen */
should still be stored temporarily for this session. However most clients
don't care and it's a huge job, so I currently this isn't done. The same
problem actually exists when opening read-only mailboxes. */
#include "lib.h"
#include "array.h"
#include "istream.h"
#include "mailbox-list-private.h"
#include "acl-api-private.h"
#include "acl-plugin.h"
#define ACL_MAIL_CONTEXT(obj) \
struct acl_mailbox {
union mailbox_module_context module_ctx;
struct acl_object *aclobj;
unsigned int save_hack:1;
};
{
int ret;
if (ret > 0)
return 1;
if (ret < 0) {
return -1;
}
return 0;
}
{
return TRUE;
return FALSE;
return FALSE;
/* Next up is the "shared flag rights" */
return FALSE;
return FALSE;
return FALSE;
return TRUE;
}
{
return FALSE;
}
{
}
enum mailbox_status_items items,
struct mailbox_status *status)
{
int ret;
if (ret < 0)
return -1;
if (ret == 0) {
/* No read rights. APPEND however wants to lookup keywords
and we don't want to fail that lookup. We could fail or
return empty keywords if user had no INSERT+WRITE rights,
but don't bother. */
if (items != STATUS_KEYWORDS)
return -1;
}
}
static int
{
int ret;
if (ret < 0)
return -1;
if (ret < 0)
return -1;
*flag_seen_r = ret > 0;
if (ret < 0)
return -1;
*flag_del_r = ret > 0;
return 0;
}
static int
enum mail_flags flags)
{
&acl_flag_del) < 0)
return -1;
if (modify_type != MODIFY_REPLACE) {
flags from the mask. */
if (!acl_flags)
if (!acl_flag_seen)
if (!acl_flag_del)
flags &= ~MAIL_DELETED;
/* we don't have permission to replace all the flags. */
/* no flag changes allowed. ignore silently. */
return 0;
}
/* handle this by first removing the allowed flags and
then adding the allowed flags */
~flags) < 0)
return -1;
}
}
static int
struct mail_keywords *keywords)
{
int ret;
if (ret <= 0) {
/* if we don't have permission, just silently return success. */
return ret;
}
}
{
int ret;
if (ret <= 0) {
/* if we don't have permission, silently return success so
users won't see annoying error messages in case their
clients try automatic expunging. */
return ret;
}
}
static struct mail *
acl_mail_alloc(struct mailbox_transaction_context *t,
struct mailbox_header_lookup_ctx *wanted_headers)
{
union mail_module_context *amail;
struct mail_private *mail;
return _mail;
}
struct mail_keywords **keywords)
{
&acl_flag_del) < 0)
return -1;
if (!acl_flag_seen)
if (!acl_flag_del)
*flags &= ~MAIL_DELETED;
if (!acl_flags) {
}
return 0;
}
static int
acl_save_init(struct mailbox_transaction_context *t,
{
return -1;
return -1;
}
static int
{
return -1;
return -1;
}
{
struct acl_mailbox *abox;
return box;
}