~ubuntu-branches/ubuntu/wily/dovecot/wily

« back to all changes in this revision

Viewing changes to src/lib-storage/mail-user.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:
 
1
#ifndef MAIL_USER_H
 
2
#define MAIL_USER_H
 
3
 
 
4
struct mail_user;
 
5
 
 
6
struct mail_user_vfuncs {
 
7
        void (*deinit)(struct mail_user *user);
 
8
};
 
9
 
 
10
struct mail_user {
 
11
        pool_t pool;
 
12
        struct mail_user_vfuncs v;
 
13
        int refcount;
 
14
 
 
15
        const char *username;
 
16
        /* don't access the home directly. It may be set lazily. */
 
17
        const char *_home;
 
18
 
 
19
        struct mail_namespace *namespaces;
 
20
 
 
21
        /* Module-specific contexts. See mail_storage_module_id. */
 
22
        ARRAY_DEFINE(module_contexts, union mail_user_module_context *);
 
23
 
 
24
        /* Either home is set or there is no home for the user. */
 
25
        unsigned int home_looked_up:1;
 
26
        /* User is an administrator. Allow operations not normally allowed
 
27
           for other people. */
 
28
        unsigned int admin:1;
 
29
};
 
30
 
 
31
struct mail_user_module_register {
 
32
        unsigned int id;
 
33
};
 
34
 
 
35
union mail_user_module_context {
 
36
        struct mail_user_vfuncs super;
 
37
        struct mail_user_module_register *reg;
 
38
};
 
39
extern struct mail_user_module_register mail_user_module_register;
 
40
 
 
41
/* Called after user has been created */
 
42
extern void (*hook_mail_user_created)(struct mail_user *user);
 
43
 
 
44
void mail_users_init(const char *auth_socket_path, bool debug);
 
45
void mail_users_deinit(void);
 
46
 
 
47
struct mail_user *mail_user_init(const char *username);
 
48
void mail_user_ref(struct mail_user *user);
 
49
void mail_user_unref(struct mail_user **user);
 
50
 
 
51
/* Find another user from the given user's namespaces. */
 
52
struct mail_user *mail_user_find(struct mail_user *user, const char *name);
 
53
 
 
54
/* Specify the user's home directory. This should be called also when it's
 
55
   known that the user doesn't have a home directory to avoid the internal
 
56
   lookup. */
 
57
void mail_user_set_home(struct mail_user *user, const char *home);
 
58
/* Get the home directory for the user. Returns 1 if home directory looked up
 
59
   successfully, 0 if there is no home directory (either user doesn't exist or
 
60
   has no home directory) or -1 if lookup failed. */
 
61
int mail_user_get_home(struct mail_user *user, const char **home_r);
 
62
/* Returns path + file prefix for creating a temporary file. Uses home
 
63
   directory if possible, fallbacks to mail directory. */
 
64
const char *mail_user_get_temp_prefix(struct mail_user *user);
 
65
 
 
66
/* Add more namespaces to user's namespaces. The ->next pointers may be
 
67
   changed, so the namespaces pointer will be updated to user->namespaces. */
 
68
void mail_user_add_namespace(struct mail_user *user,
 
69
                             struct mail_namespace **namespaces);
 
70
/* Drop autocreated shared namespaces that don't have any "usable" mailboxes. */
 
71
void mail_user_drop_useless_namespaces(struct mail_user *user);
 
72
 
 
73
/* Replace ~/ at the beginning of the path with the user's home directory. */
 
74
const char *mail_user_home_expand(struct mail_user *user, const char *path);
 
75
/* Returns 0 if ok, -1 if home directory isn't set. */
 
76
int mail_user_try_home_expand(struct mail_user *user, const char **path);
 
77
 
 
78
#endif