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

« back to all changes in this revision

Viewing changes to .pc/mutf-7.patch/src/imap/cmd-status.c

  • Committer: Package Import Robot
  • Author(s): James Page, James Page, Ante Karamatic
  • Date: 2013-02-11 12:41:24 UTC
  • mfrom: (4.1.33 sid)
  • Revision ID: package-import@ubuntu.com-20130211124124-v7bdegzftlhw7yfr
Tags: 1:2.1.7-7ubuntu1
[ James Page ]
* Merge from Debian unstable (LP: #1117613, #1075456), 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.
  + 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.
* Dropped changes, included in Debian:
  + d/{control,rules}: enable PIE hardening.
  + d/control: Drop B-D on systemd.
* d/p/mail-stack-delivery.postinst: Updated to ensure that configured SSL
  cert and key locations are used when configuring postfix, sorted out
  formatting.
* d/p/dovecot-core.postinst: Create compat links to old style, existing
  SSL cert and key if found.
* d/rules: Don't pass hardening flags for DRAC plugin.
* d/dovecot-{pop3d,imapd}.prerm: Re-sync with Debian.
* d/dovecot-core.lintian-overrides: Drop override for DRAC plugin as not
  required in Ubuntu.
* d/01-mail-stack-delivery: Renamed 99-mail-stack-delivery to ensure that
  the mail-stack-delivery configuration overrides configuration options
  set elsewhere, updated with new cert/key file locations.

[ Ante Karamatic ]
* Change configuration file for LDA on new installs and upgrades
  (LP: #671065).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (c) 2002-2012 Dovecot authors, see the included COPYING file */
 
2
 
 
3
#include "imap-common.h"
 
4
#include "imap-resp-code.h"
 
5
#include "imap-commands.h"
 
6
#include "imap-sync.h"
 
7
#include "imap-status.h"
 
8
 
 
9
bool cmd_status(struct client_command_context *cmd)
 
10
{
 
11
        struct client *client = cmd->client;
 
12
        const struct imap_arg *args, *list_args;
 
13
        struct imap_status_items items;
 
14
        struct imap_status_result result;
 
15
        struct mail_namespace *ns;
 
16
        const char *mailbox, *error;
 
17
        bool selected_mailbox;
 
18
 
 
19
        /* <mailbox> <status items> */
 
20
        if (!client_read_args(cmd, 2, 0, &args))
 
21
                return FALSE;
 
22
 
 
23
        if (!imap_arg_get_astring(&args[0], &mailbox) ||
 
24
            !imap_arg_get_list(&args[1], &list_args)) {
 
25
                client_send_command_error(cmd, "Invalid arguments.");
 
26
                return TRUE;
 
27
        }
 
28
 
 
29
        /* get the items client wants */
 
30
        if (imap_status_parse_items(cmd, list_args, &items) < 0)
 
31
                return TRUE;
 
32
 
 
33
        ns = client_find_namespace(cmd, &mailbox);
 
34
        if (ns == NULL)
 
35
                return TRUE;
 
36
 
 
37
        selected_mailbox = client->mailbox != NULL &&
 
38
                mailbox_equals(client->mailbox, ns, mailbox);
 
39
        if (imap_status_get(cmd, ns, mailbox, &items,
 
40
                            &result, &error) < 0) {
 
41
                client_send_tagline(cmd, error);
 
42
                return TRUE;
 
43
        }
 
44
 
 
45
        imap_status_send(client, mailbox, &items, &result);
 
46
        if (!selected_mailbox)
 
47
                client_send_tagline(cmd, "OK Status completed.");
 
48
        else {
 
49
                client_send_tagline(cmd, "OK ["IMAP_RESP_CODE_CLIENTBUG"] "
 
50
                                    "Status on selected mailbox completed.");
 
51
        }
 
52
        return TRUE;
 
53
}