~ubuntu-branches/ubuntu/trusty/dovecot/trusty

« back to all changes in this revision

Viewing changes to src/lib-imap/imap-url.h

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-01-08 09:35:49 UTC
  • mfrom: (1.15.3) (96.1.1 trusty-proposed)
  • Revision ID: package-import@ubuntu.com-20140108093549-814nkqdcxfbvgktg
Tags: 1:2.2.9-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/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.
  + Use the autotools-dev dh addon to update config.guess/config.sub for
    arm64.
* Dropped changes, included in Debian:
  - Update Dovecot name to reflect distribution in login greeting.
  - Update Drac plugin for >= 2.0.0 support.
* d/control: Drop dovecot-postfix package as its no longer required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef IMAP_URL_H
 
2
#define IMAP_URL_H
 
3
 
 
4
struct imap_url {
 
5
        /* server */
 
6
        const char *host_name;
 
7
        struct ip_addr host_ip;
 
8
        in_port_t port;
 
9
 
 
10
        /* user */
 
11
        const char *userid;
 
12
        const char *auth_type;
 
13
 
 
14
        /* mailbox */
 
15
        const char *mailbox;
 
16
        uint32_t uidvalidity;  /* 0 if not set */
 
17
 
 
18
        /* message part */
 
19
        uint32_t uid;
 
20
        const char *section;
 
21
        uoff_t partial_offset;
 
22
        uoff_t partial_size; /* 0 if not set */
 
23
 
 
24
        /* message list (uid == 0) */
 
25
        const char *search_program;
 
26
 
 
27
        /* urlauth */
 
28
        const char *uauth_rumpurl;
 
29
        const char *uauth_access_application;
 
30
        const char *uauth_access_user;
 
31
        const char *uauth_mechanism;
 
32
        const unsigned char *uauth_token;
 
33
        size_t uauth_token_size;
 
34
        time_t uauth_expire; /* (time_t)-1 if not set */
 
35
 
 
36
        unsigned int have_host_ip:1; /* url uses IP address */
 
37
        unsigned int have_port:1;
 
38
        unsigned int have_partial:1;
 
39
};
 
40
 
 
41
/*
 
42
 * IMAP URL parsing
 
43
 */
 
44
 
 
45
enum imap_url_parse_flags {
 
46
        /* Scheme part 'imap:' is already parsed externally. This implies that
 
47
           this is an absolute IMAP URL. */
 
48
        IMAP_URL_PARSE_SCHEME_EXTERNAL  = 0x01,
 
49
        /* Require relative URL (omitting _both_ scheme and authority), e.g.
 
50
           /MAILBOX/;UID=uid or even ;UID=uid. This flag means that an absolute
 
51
           URL makes no sense in this context. Relative URLs are allowed once a
 
52
           base URL is provided to the parser. */
 
53
        IMAP_URL_PARSE_REQUIRE_RELATIVE = 0x02,
 
54
        /* Allow URLAUTH URL */
 
55
        IMAP_URL_PARSE_ALLOW_URLAUTH    = 0x04
 
56
};
 
57
 
 
58
/* Parses full IMAP URL. The returned URL is allocated from data stack. */
 
59
int imap_url_parse(const char *url, struct imap_url *base,
 
60
                   enum imap_url_parse_flags flags,
 
61
                   struct imap_url **url_r, const char **error_r);
 
62
 
 
63
/*
 
64
 * IMAP URL construction
 
65
 */
 
66
 
 
67
const char *imap_url_create(const struct imap_url *url);
 
68
 
 
69
const char *imap_url_add_urlauth(const char *rumpurl, const char *mechanism,
 
70
                                 const unsigned char *token, size_t token_len);
 
71
 
 
72
#endif