#define MAILBOX_HEADER_MAGIC "\241\002\213\015Cyrus mailbox header\n\"The best thing about this system was that it had lots of goals.\"\n\t--Jim Morris on Andrew\n"
#define MAILBOX_FORMAT_NORMAL 0
#define MAILBOX_FORMAT_NETNEWS 1
#define MAILBOX_MINOR_VERSION 2
#define FNAME_HEADER "/cyrus.header"
#define FNAME_INDEX "/cyrus.index"
#define FNAME_CACHE "/cyrus.cache"
#define FNAME_QUOTADIR "/quota/"
#define FNAME_LOGDIR "/log/"
#define QUOTA_UNITS (1024)
structquota{
intfd;
intlock_count;
char*root;
/* Information in quota file */
unsignedlongused;
intlimit;/* in QUOTA_UNITS */
};
structmailbox{
intheader_fd;
intindex_fd;
intcache_fd;
constchar*header_base;
unsignedlongheader_len;
constchar*index_base;
unsignedlongindex_len;
constchar*cache_base;
unsignedlongcache_len;
intheader_lock_count;
intindex_lock_count;
intseen_lock_count;
intpop_lock_count;
longheader_ino;
time_tindex_mtime;
longindex_ino;
/* Information in mailbox list */
char*name;
char*path;
char*acl;
longmyrights;
/* Information in header */
/* quota.root */
char*flagname[MAX_USER_FLAGS];
/* Information in index file */
bit32generation_no;
intformat;
intminor_version;
unsignedlongstart_offset;
unsignedlongrecord_size;
unsignedlongexists;
time_tlast_appenddate;
unsignedlonglast_uid;
unsignedlongquota_mailbox_used;
unsignedlongpop3_last_login;
unsignedlonguidvalidity;
structquotaquota;
};
structindex_record{
unsignedlonguid;
time_tinternaldate;
time_tsentdate;
unsignedlongsize;
unsignedlongheader_size;
unsignedlongcontent_offset;
unsignedlongcache_offset;
time_tlast_updated;
bit32system_flags;
bit32user_flags[MAX_USER_FLAGS/32];
};
/* Offsets of index header fields */
#define OFFSET_GENERATION_NO 0
#define OFFSET_FORMAT 4
#define OFFSET_MINOR_VERSION 8
#define OFFSET_START_OFFSET 12
#define OFFSET_RECORD_SIZE 16
#define OFFSET_EXISTS 20
#define OFFSET_LAST_APPENDDATE 24
#define OFFSET_LAST_UID 28
#define OFFSET_QUOTA_MAILBOX_USED 32
#define OFFSET_POP3_LAST_LOGIN 36
#define OFFSET_UIDVALIDITY 40
/* Offsets of index_record fields in index file */