~ubuntu-dev/ubuntu/lucid/dovecot/lucid-201002101918

« back to all changes in this revision

Viewing changes to src/lib-storage/mailbox-list.h

  • Committer: Bazaar Package Importer
  • Author(s): CHuck Short, Chuck Short
  • Date: 2009-11-06 00:47:29 UTC
  • mfrom: (4.1.9 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091106004729-i39n7v9e7d4h51f6
Tags: 1:1.2.6-1ubuntu1
* Merge from debian testing, remaining changes:
  Add new binary pkg dovecot-postfix that integrates postfix and dovecot
  automatically: (LP: #164837)
  + debian/control:
    - add new binary with short description
    - set Architecture all for dovecot-postfix (LP: #329878)
  + debian/dovecot-postfix.postinst:
    - create initial certificate symlinks to snakeoil.
    - set up postfix with postconf to:
      - use Maildir/ as the default mailbox.
      - use dovecot as the sasl authentication server.
      - use dovecot LDA (deliver).
      - use tls for smtp{d} services.
    - fix certificates paths in postfix' main.cf
    - add reject_unauth_destination to postfix' recipient restrictions
    - add reject_unknown_sender_domain to postfix' sender restrictions
    - rename configuration name on remove, delete on purge
    - restart dovecot after linking certificates
    - handle use case when postfix is unconfigurated
   + debian/dovecot-postfix.dirs: create backup directory for postfix's configuration
   + restart postfix and dovecot.
   + debian/dovecot-postfix.postrm:
     - remove all dovecot related configuration from postfix.
     - restart postfix and dovecot.
   + debian/dovecot-common.init:
     - check if /etc/dovecot/dovecot-postfix.conf exists and use it
       as the configuration file if so.
   + debian/patches/warning-ubuntu-postfix.dpatch
     - add warning about dovecot-postfix.conf in dovecot default 
       configuration file
   + debian/patches/dovecot-postfix.conf.diff:
     - Ubuntu server custom changes to the default dovecot configuration for
       better interfation with postfix
     - enable sieve plugin
   + debian/patches/dovecot-postfix.conf.diff:
     + Ubuntu server custom changes to the default dovecot configuration for
       better integration with postfix:
       - enable imap, pop3, imaps, pop3s and managesieve by default.
       - enable dovecot LDA (deliver).
       - enable SASL auth socket in postfix private directory.
   + debian/rules:
     - copy, patch and install dovecot-postfix.conf in /etc/dovecot/.
     - build architecure independent packages too
   + Use Snakeoil SSL certificates by default.
     - debian/control: Depend on ssl-cert.
     - debian/patches/ssl-cert-snakeoil.dpatch: Change default SSL cert
       paths to snakeoil.
     - debian/dovecot-common.postinst: Relax grep for SSL_* a bit.
   + Add autopkgtest to debian/tests/*.
   + Fast TearDown: Update the lsb init header to not stop in level 6.
   + Add ufw integration:
     - Created debian/dovecot-common.ufw.profile.
     - debian/rules:
       + install profile
     - debian/control:
       + Suggest ufw
   + debian/{control,rules}: enable PIE hardening.
   + dovecot-imapd, dovecot-pop3: Replaces dovecot-common (<< 1:1.1). LP: #254721
   + debian/control:
     - Update Vcs-* headers.
   + debian/rules:
     - Create emtpy stamp.h.in files in dovecot-sieve/ and dovecot-managesieve/
       if they're not there since empty files are not included in the diff.gz 
       file.
   + Add SMTP-AUTH support for Outlook (login auth mechanism)
   + Dropped:
     - debian/patches/security-CVE-2009-3235: Applied upstream.
     - debian/patches/fix-pop3-assertion.dpatch: Applied upstream.
     - dovecot-sieve and dovecot-managesieve: Use the debian patches instead.

  [Chuck Short]
  - Updated dovecot-sieve to 0.1.13.
  - Updated dovecot-managesieve to 0.11.9.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
struct mailbox_list;
8
8
struct mailbox_list_iterate_context;
9
9
 
 
10
enum mailbox_list_properties {
 
11
        /* maildir_name must always be empty */
 
12
        MAILBOX_LIST_PROP_NO_MAILDIR_NAME       = 0x01
 
13
};
 
14
 
10
15
enum mailbox_list_flags {
11
16
        /* Print debugging information while initializing the driver */
12
17
        MAILBOX_LIST_FLAG_DEBUG                 = 0x01,
102
107
           If mailbox_name is "Maildir", you have a non-selectable mailbox
103
108
           "mail" and a selectable mailbox "mail/foo". */
104
109
        const char *maildir_name;
 
110
        /* if set, store mailboxes under root_dir/mailbox_dir_name/.
 
111
           this setting contains either "" or "dir/". */
 
112
        const char *mailbox_dir_name;
105
113
 
106
114
        /* If mailbox index is used, use these settings for it
107
115
           (pointers, so they're set to NULL after init is finished): */
111
119
 
112
120
struct mailbox_info {
113
121
        const char *name;
114
 
        enum mailbox_info_flags flags;
 
122
        enum mailbox_info_flags flags;
 
123
        struct mail_namespace *ns;
115
124
};
116
125
 
117
126
/* register all drivers */
128
137
                       enum mailbox_list_flags flags);
129
138
void mailbox_list_deinit(struct mailbox_list *list);
130
139
 
131
 
const char *mailbox_list_get_driver_name(struct mailbox_list *list);
132
 
char mailbox_list_get_hierarchy_sep(struct mailbox_list *list);
133
 
enum mailbox_list_flags mailbox_list_get_flags(struct mailbox_list *list);
134
 
struct mail_namespace *mailbox_list_get_namespace(struct mailbox_list *list);
 
140
const char *
 
141
mailbox_list_get_driver_name(const struct mailbox_list *list) ATTR_PURE;
 
142
char mailbox_list_get_hierarchy_sep(const struct mailbox_list *list) ATTR_PURE;
 
143
enum mailbox_list_flags
 
144
mailbox_list_get_flags(const struct mailbox_list *list) ATTR_PURE;
 
145
struct mail_namespace *
 
146
mailbox_list_get_namespace(const struct mailbox_list *list) ATTR_PURE;
135
147
 
136
 
/* Returns the mode and GID that should be used when creating new global files
137
 
   to the mailbox list root directories. (gid_t)-1 is returned if it's not
138
 
   necessary to change the default */
 
148
/* Returns the mode and GID that should be used when creating new files to
 
149
   the specified mailbox, or to mailbox list root if name is NULL. (gid_t)-1 is
 
150
   returned if it's not necessary to change the default gid. */
139
151
void mailbox_list_get_permissions(struct mailbox_list *list,
140
 
                                  mode_t *mode_r, gid_t *gid_r);
 
152
                                  const char *name,
 
153
                                  mode_t *mode_r, gid_t *gid_r,
 
154
                                  const char **gid_origin_r);
 
155
/* Like mailbox_list_get_permissions(), but add execute-bits for mode
 
156
   if either read or write bit is set (e.g. 0640 -> 0750). */
 
157
void mailbox_list_get_dir_permissions(struct mailbox_list *list,
 
158
                                      const char *name,
 
159
                                      mode_t *mode_r, gid_t *gid_r,
 
160
                                      const char **gid_origin_r);
 
161
/* Create path's parent directory with proper permissions. Since most
 
162
   directories are created lazily, this function can be used to easily create
 
163
   them whenever file creation fails with ENOENT. */
 
164
int mailbox_list_create_parent_dir(struct mailbox_list *list,
 
165
                                   const char *mailbox, const char *path);
141
166
 
142
167
/* Returns TRUE if the name doesn't contain any invalid characters.
143
168
   The create name check can be more strict. */
180
205
mailbox_list_iter_init_multiple(struct mailbox_list *list,
181
206
                                const char *const *patterns,
182
207
                                enum mailbox_list_iter_flags flags);
 
208
/* List mailbox_list_iter_init_multiple(), but list mailboxes from all the
 
209
   specified namespaces. */
 
210
struct mailbox_list_iterate_context *
 
211
mailbox_list_iter_init_namespaces(struct mail_namespace *namespaces,
 
212
                                  const char *const *patterns,
 
213
                                  enum mailbox_list_iter_flags flags);
183
214
/* Get next mailbox. Returns the mailbox name */
184
215
const struct mailbox_info *
185
216
mailbox_list_iter_next(struct mailbox_list_iterate_context *ctx);
186
 
/* Deinitialize mailbox list request. Returns FALSE if some error
 
217
/* Deinitialize mailbox list request. Returns -1 if some error
187
218
   occurred while listing. */
188
219
int mailbox_list_iter_deinit(struct mailbox_list_iterate_context **ctx);
 
220
/* List one mailbox. Returns 1 if info returned, 0 if mailbox doesn't exist,
 
221
   -1 if error. */
 
222
int mailbox_list_mailbox(struct mailbox_list *list, const char *name,
 
223
                         enum mailbox_info_flags *flags_r);
189
224
 
190
225
/* Subscribe/unsubscribe mailbox. There should be no error when
191
226
   subscribing to already subscribed mailbox. Subscribing to