~james-page/ubuntu/raring/dovecot/autopkgtest

« back to all changes in this revision

Viewing changes to src/dsync/dsync-data.h

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-06-11 11:11:54 UTC
  • mfrom: (1.15.2) (4.1.27 sid)
  • Revision ID: package-import@ubuntu.com-20120611111154-678cwbdj6ktgsv1h
Tags: 1:2.1.7-1ubuntu1
* Merge from Debian unstable, remaining changes:
  + Add mail-stack-delivery package:
    - Update d/rules
    - d/control: convert existing dovecot-postfix package to a dummy
      package and add new mail-stack-delivery package.
    - Update maintainer scripts.
    - Rename d/dovecot-postfix.* to debian/mail-stack-delivery.*
    - d/mail-stack-delivery.preinst: Move previously installed backups and
      config files to a new package namespace.
    - d/mail-stack-delivery.prerm: Added to handle downgrades.
  + Use Snakeoil SSL certificates by default:
    - d/control: Depend on ssl-cert.
    - d/dovecot-core.postinst: Relax grep for SSL_* a bit.
  + Add autopkgtest to debian/tests/*.
  + Add ufw integration:
    - d/dovecot-core.ufw.profile: new ufw profile.
    - d/rules: install profile in dovecot-core.
    - d/control: dovecot-core - suggest ufw.
  + d/{control,rules}: enable PIE hardening.
  + d/dovecot-core.dirs: Added usr/share/doc/dovecot-core
  + Add apport hook:
    - d/rules, d/source_dovecot.py
  + Add upstart job:
    - d/rules, d/dovecot-core.dovecot.upstart, d/control,
      d/dovecot-core.dirs, dovecot-imapd.{postrm, postinst, prerm},
      d/dovecot-pop3d.{postinst, postrm, prerm}.
      d/mail-stack-deliver.postinst: Convert init script to upstart.
  + d/control: Added Pre-Depends: dpkg (>= 1.15.6) to dovecot-dbg to support
    xz compression in Ubuntu.
  + d/control: Demote dovecot-common Recommends: to Suggests: to prevent
    install of extra packages on upgrade.
  + d/patches/dovecot-drac.patch: Updated with version for dovecot >= 2.0.0.
  + d/control: Drop B-D on systemd.
* Dropped changes:
  + d/patches/fix-racey-restart.patch: part of 2.1.x, no longer required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef DSYNC_DATA_H
2
 
#define DSYNC_DATA_H
3
 
 
4
 
#include "mail-storage.h"
5
 
 
6
 
typedef struct {
7
 
        uint8_t guid[MAIL_GUID_128_SIZE];
8
 
} mailbox_guid_t;
9
 
ARRAY_DEFINE_TYPE(mailbox_guid, mailbox_guid_t);
10
 
 
11
 
enum dsync_mailbox_flags {
12
 
        DSYNC_MAILBOX_FLAG_NOSELECT             = 0x01,
13
 
        DSYNC_MAILBOX_FLAG_DELETED_MAILBOX      = 0x02,
14
 
        DSYNC_MAILBOX_FLAG_DELETED_DIR          = 0x04
15
 
};
16
 
 
17
 
struct dsync_mailbox {
18
 
        const char *name;
19
 
        char name_sep;
20
 
        /* 128bit SHA1 sum of mailbox name */
21
 
        mailbox_guid_t name_sha1;
22
 
        /* Mailbox's GUID. Full of zero with \Noselect mailboxes. */
23
 
        mailbox_guid_t mailbox_guid;
24
 
 
25
 
        uint32_t uid_validity, uid_next, message_count, first_recent_uid;
26
 
        uint64_t highest_modseq;
27
 
        /* if mailbox is deleted, this is the deletion timestamp.
28
 
           otherwise it's the last rename timestamp. */
29
 
        time_t last_change;
30
 
        enum dsync_mailbox_flags flags;
31
 
        ARRAY_TYPE(const_string) cache_fields;
32
 
};
33
 
ARRAY_DEFINE_TYPE(dsync_mailbox, struct dsync_mailbox *);
34
 
#define dsync_mailbox_is_noselect(dsync_box) \
35
 
        (((dsync_box)->flags & DSYNC_MAILBOX_FLAG_NOSELECT) != 0)
36
 
 
37
 
/* dsync_worker_msg_iter_next() returns also all expunged messages from
38
 
   the end of mailbox with this flag set. The GUIDs are 128 bit GUIDs saved
39
 
   to transaction log (mail_generate_guid_128_hash()). */
40
 
#define DSYNC_MAIL_FLAG_EXPUNGED 0x10000000
41
 
 
42
 
struct dsync_message {
43
 
        const char *guid;
44
 
        uint32_t uid;
45
 
        enum mail_flags flags;
46
 
        /* keywords are sorted by name */
47
 
        const char *const *keywords;
48
 
        uint64_t modseq;
49
 
        time_t save_date;
50
 
};
51
 
 
52
 
struct dsync_msg_static_data {
53
 
        const char *pop3_uidl;
54
 
        time_t received_date;
55
 
        struct istream *input;
56
 
};
57
 
 
58
 
struct dsync_mailbox *
59
 
dsync_mailbox_dup(pool_t pool, const struct dsync_mailbox *box);
60
 
 
61
 
struct dsync_message *
62
 
dsync_message_dup(pool_t pool, const struct dsync_message *msg);
63
 
 
64
 
int dsync_mailbox_guid_cmp(const struct dsync_mailbox *box1,
65
 
                           const struct dsync_mailbox *box2);
66
 
int dsync_mailbox_p_guid_cmp(struct dsync_mailbox *const *box1,
67
 
                             struct dsync_mailbox *const *box2);
68
 
 
69
 
int dsync_mailbox_name_sha1_cmp(const struct dsync_mailbox *box1,
70
 
                                const struct dsync_mailbox *box2);
71
 
int dsync_mailbox_p_name_sha1_cmp(struct dsync_mailbox *const *box1,
72
 
                                  struct dsync_mailbox *const *box2);
73
 
 
74
 
bool dsync_keyword_list_equals(const char *const *k1, const char *const *k2);
75
 
 
76
 
bool dsync_guid_equals(const mailbox_guid_t *guid1,
77
 
                       const mailbox_guid_t *guid2);
78
 
int dsync_guid_cmp(const mailbox_guid_t *guid1, const mailbox_guid_t *guid2);
79
 
const char *dsync_guid_to_str(const mailbox_guid_t *guid);
80
 
const char *dsync_get_guid_128_str(const char *guid, unsigned char *dest,
81
 
                                   unsigned int dest_len);
82
 
void dsync_str_sha_to_guid(const char *str, mailbox_guid_t *guid);
83
 
 
84
 
#endif