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

« back to all changes in this revision

Viewing changes to pigeonhole/src/managesieve-login/managesieve-proxy.c

  • 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:
82
82
}
83
83
 
84
84
static managesieve_response_t proxy_read_response
85
 
(struct managesieve_arg *args)
 
85
(const struct managesieve_arg *args)
86
86
{
87
 
        if ( args[0].type == MANAGESIEVE_ARG_ATOM ) {
88
 
                const char *response = MANAGESIEVE_ARG_STR(&(args[0]));
 
87
        const char *response;
 
88
 
 
89
        if ( managesieve_arg_get_atom(&args[0], &response) ) {
89
90
 
90
91
                if ( strcasecmp(response, "OK") == 0 ) {
91
92
                        /* Received OK response; greeting is finished */
111
112
{   
112
113
        struct istream *input;
113
114
        struct managesieve_parser *parser;
114
 
        struct managesieve_arg *args;
 
115
        const struct managesieve_arg *args;
 
116
        const char *capability;
115
117
        int ret;
116
118
        bool fatal = FALSE;
117
119
 
125
127
         */
126
128
        line = t_strconcat(line, "\r\n", NULL);
127
129
        input = i_stream_create_from_data(line, strlen(line));
128
 
        parser = managesieve_parser_create(input, NULL, MAX_MANAGESIEVE_LINE);
 
130
        parser = managesieve_parser_create(input, MAX_MANAGESIEVE_LINE);
129
131
        managesieve_parser_reset(parser);
130
132
 
131
133
        /* Parse input 
146
148
                
147
149
                                fatal = TRUE;
148
150
                        }
149
 
        } else if ( args[0].type == MANAGESIEVE_ARG_STRING ) {
150
 
                        const char *capability = MANAGESIEVE_ARG_STR(&(args[0]));
 
151
                } else if ( managesieve_arg_get_string(&args[0], &capability) ) {
 
152
                        if ( strcasecmp(capability, "SASL") == 0 ) {
 
153
                                const char *sasl_mechs;
151
154
 
152
 
                if ( strcasecmp(capability, "SASL") == 0 ) {
153
155
                                /* Check whether the server supports the SASL mechanism 
154
 
                         * we are going to use (currently only PLAIN supported). 
 
156
                                 * we are going to use (currently only PLAIN supported). 
155
157
                                 */
156
 
                                if ( ret == 2 && args[1].type == MANAGESIEVE_ARG_STRING ) {
157
 
                                        const char *const *mechs = 
158
 
                                                t_strsplit(MANAGESIEVE_ARG_STR(&(args[1])), " "); 
 
158
                                if ( ret == 2 && managesieve_arg_get_string(&args[1], &sasl_mechs) ) {
 
159
                                        const char *const *mechs = t_strsplit(sasl_mechs, " "); 
159
160
 
160
161
                                        if ( str_array_icase_find(mechs, "PLAIN") )
161
162
                                                client->proxy_sasl_plain = TRUE;
347
348
                 */
348
349
                client_send_no(client, AUTH_FAILED_MSG);
349
350
 
 
351
                client->proxy_auth_failed = TRUE;
350
352
                client_proxy_failed(client, FALSE);
351
353
                return -1;
352
354