Back to index

courier  0.68.2
maildirinfo.h
Go to the documentation of this file.
00001 #ifndef       maildir_maildirinfo_h
00002 #define       maildir_maildirinfo_h
00003 
00004 #include "config.h"
00005 
00006 #ifdef  __cplusplus
00007 extern "C" {
00008 #endif
00009 
00010 /*
00011 ** Copyright 2004 Double Precision, Inc.
00012 ** See COPYING for distribution information.
00013 */
00014 
00015 
00016 struct maildir_info {
00017        int mailbox_type;
00018        char *homedir;
00019        char *maildir;
00020        char *owner;
00021 };
00022 
00023 void maildir_info_destroy(struct maildir_info *); /* Deallocate memory */
00024 
00025 int maildir_info_imap_find(struct maildir_info *info, const char *path,
00026                         const char *myid);
00027 
00028 /*
00029 ** Initialize info based on path.  Returns 0 for success, -1 if path is
00030 ** syntactically invalid.  The mailbox may not actually exist.
00031 **
00032 ** 'myid' is my login id, used to initialize owner (see below) for INBOX
00033 ** folders.
00034 **
00035 ** homedir is set to the mailbox's homedir, which may not necessarily be
00036 ** "." if path points to #shared.user.folder.
00037 ** maildir is the local mailbox path, such as INBOX.folder
00038 **
00039 ** owner will be set to the mailbox's owner, for ACL purposes.
00040 **
00041 ** maildir will be NULL for a node in the legacy shared hierarchy.
00042 */
00043 
00044 #define MAILBOXTYPE_INBOX 0 /* Inbox maildir */
00045 #define MAILBOXTYPE_OLDSHARED 1    /* Legacy shared hierarchy */
00046 #define MAILBOXTYPE_NEWSHARED 2 /* #shared hierarchy */
00047 
00048 #define MAILBOXTYPE_IGNORE  255 /* Ignore this mailbox */
00049 
00050 /*
00051 ** The application must define the following callback function that returns
00052 ** non-zero if the filename refers to the current account's maildir, and
00053 ** should be suppressed from the shared folder hierarchy.
00054 */
00055 extern int maildir_info_suppress(const char *maildir);
00056 
00057 /*
00058 ** The SMAP version:
00059 */
00060 int maildir_info_smap_find(struct maildir_info *info, char **folder,
00061                         const char *myid);
00062 
00063 char **maildir_smapfn_fromutf7(const char *modutf7);
00064 void maildir_smapfn_free(char **fn);
00065 
00066 /*
00067 ** The shared index files use UTF-8.  Convenience function to convert
00068 ** names into IMAP-compatible modified-UTF7.
00069 */
00070 
00071 extern void maildir_info_munge_complex(int);
00072        /* If true, use "complex" munging */
00073 
00074 extern char *maildir_info_imapmunge(const char *name);
00075 
00076 #ifdef  __cplusplus
00077 }
00078 #endif
00079 
00080 #endif