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

« back to all changes in this revision

Viewing changes to src/lib-imap-storage/imap-msgpart.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_MSGPART_H
 
2
#define IMAP_MSGPART_H
 
3
 
 
4
struct imap_msgpart;
 
5
 
 
6
struct imap_msgpart_open_result {
 
7
        /* message contents with CRLF linefeeds */
 
8
        struct istream *input;
 
9
        /* size of input */
 
10
        uoff_t size;
 
11
        /* if size was looked up using cache and it ends up being wrong,
 
12
           this field can be used to log about cache corruption */
 
13
        enum mail_fetch_field size_field;
 
14
        /* TRUE if BINARY decoded content contains NUL characters */
 
15
        bool binary_decoded_input_has_nuls;
 
16
};
 
17
 
 
18
struct imap_msgpart *imap_msgpart_full(void);
 
19
struct imap_msgpart *imap_msgpart_header(void);
 
20
struct imap_msgpart *imap_msgpart_body(void);
 
21
/* Parse section into imap_msgpart. Returns 0 and msgpart_r on success,
 
22
   -1 if the section isn't valid. The same imap_msgpart can be used to open
 
23
   multiple messages. */
 
24
int imap_msgpart_parse(const char *section, struct imap_msgpart **msgpart_r);
 
25
void imap_msgpart_free(struct imap_msgpart **msgpart);
 
26
 
 
27
/* Decode MIME parts with Content-Transfer-Encoding: base64/quoted-printable
 
28
   to binary data (IMAP BINARY extension). If something can't be decoded, fails
 
29
   with storage error set to MAIL_ERROR_CONVERSION. */
 
30
void imap_msgpart_set_decode_to_binary(struct imap_msgpart *msgpart);
 
31
 
 
32
/* Set the fetch to be partial. For unlimited size use (uoff_t)-1. */
 
33
void imap_msgpart_set_partial(struct imap_msgpart *msgpart,
 
34
                              uoff_t offset, uoff_t size);
 
35
uoff_t imap_msgpart_get_partial_offset(struct imap_msgpart *msgpart);
 
36
uoff_t imap_msgpart_get_partial_size(struct imap_msgpart *msgpart);
 
37
/* Return wanted_fields mask. */
 
38
enum mail_fetch_field imap_msgpart_get_fetch_data(struct imap_msgpart *msgpart);
 
39
 
 
40
/* Open message part refenced by IMAP section as istream. Returns 0 if
 
41
   successful, -1 if storage error. Returned istream is initially referenced,
 
42
   so i_stream_unref() must be called for it. */
 
43
int imap_msgpart_open(struct mail *mail, struct imap_msgpart *msgpart,
 
44
                      struct imap_msgpart_open_result *result_r);
 
45
/* Return msgpart's size without actually opening the stream (if possible). */
 
46
int imap_msgpart_size(struct mail *mail, struct imap_msgpart *msgpart,
 
47
                      uoff_t *size_r);
 
48
 
 
49
/* Return msgpart's IMAP BODYPARTSTRUCTURE */
 
50
int imap_msgpart_bodypartstructure(struct mail *mail,
 
51
                                   struct imap_msgpart *msgpart,
 
52
                                   const char **bpstruct_r);
 
53
 
 
54
/* Header context is automatically created by imap_msgpart_open() and destroyed
 
55
   by imap_msgpart_free(), but if you want to use the same imap_msgpart across
 
56
   multiple mailboxes, you need to close the part before closing the mailbox. */
 
57
void imap_msgpart_close_mailbox(struct imap_msgpart *msgpart);
 
58
 
 
59
#endif