acl-mailbox.c revision 7fb70daba4e571eab5b64f496d20b9e37e31141b
/* 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 "mail-storage-private.h"
#include "acl-api-private.h"
#include "acl-plugin.h"
#define ACL_CONTEXT(obj) \
struct acl_mailbox {
struct mailbox_vfuncs super;
struct acl_object *aclobj;
unsigned int save_hack:1;
};
struct acl_mail {
struct mail_vfuncs super;
};
{
}
{
int ret;
if (ret > 0)
return 1;
if (ret < 0)
return -1;
return 0;
}
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 1;
}
static int
enum mail_flags flags)
{
int ret;
&acl_flag_del);
if (ret < 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)
{
struct mail_private *mail;
return _mail;
}
static int
acl_save_init(struct mailbox_transaction_context *t,
{
return -1;
}
static int
{
return -1;
}
{
struct acl_mailbox *abox;
return box;
}