~ubuntu-branches/ubuntu/utopic/dovecot/utopic-proposed

« back to all changes in this revision

Viewing changes to pigeonhole/src/testsuite/testsuite-mailstore.c

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-01-08 09:35:49 UTC
  • mfrom: (4.1.35 sid)
  • Revision ID: package-import@ubuntu.com-20140108093549-i72o93pux8p0dlaf
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
 
/* Copyright (c) 2002-2012 Pigeonhole authors, see the included COPYING file
 
1
/* Copyright (c) 2002-2013 Pigeonhole authors, see the included COPYING file
2
2
 */
3
3
 
4
4
#include "lib.h"
11
11
#include "mail-namespace.h"
12
12
#include "mail-storage.h"
13
13
 
14
 
#include "sieve-common.h" 
 
14
#include "sieve-common.h"
15
15
#include "sieve-error.h"
16
16
#include "sieve-interpreter.h"
17
 
 
 
17
 
18
18
#include "testsuite-message.h"
19
19
#include "testsuite-common.h"
20
20
#include "testsuite-smtp.h"
46
46
 */
47
47
 
48
48
void testsuite_mailstore_init(void)
49
 
{       
 
49
{
50
50
        testsuite_mailstore_tmp = i_strconcat
51
51
                (testsuite_tmp_dir_get(), "/mailstore", NULL);
52
52
 
53
53
        if ( mkdir(testsuite_mailstore_tmp, 0700) < 0 ) {
54
 
                i_fatal("failed to create temporary directory '%s': %m.", 
55
 
                        testsuite_mailstore_tmp);               
 
54
                i_fatal("failed to create temporary directory '%s': %m.",
 
55
                        testsuite_mailstore_tmp);
56
56
        }
57
57
 
58
58
        sieve_tool_init_mail_user
67
67
                i_warning("failed to remove temporary directory '%s': %m.",
68
68
                        testsuite_mailstore_tmp);
69
69
        }
70
 
        
71
 
        i_free(testsuite_mailstore_tmp);                
 
70
 
 
71
        i_free(testsuite_mailstore_tmp);
72
72
}
73
73
 
74
74
void testsuite_mailstore_reset(void)
105
105
 
106
106
        if ( testsuite_mailstore_trans != NULL )
107
107
                mailbox_transaction_rollback(&testsuite_mailstore_trans);
108
 
                
 
108
 
109
109
        if ( testsuite_mailstore_box != NULL )
110
110
                mailbox_free(&testsuite_mailstore_box);
111
111
 
124
124
 
125
125
        if ( testsuite_mailstore_mail == NULL ) {
126
126
                testsuite_mailstore_close();
127
 
        } else if ( testsuite_mailstore_folder != NULL 
 
127
        } else if ( testsuite_mailstore_folder != NULL
128
128
                && strcmp(folder, testsuite_mailstore_folder) != 0  ) {
129
 
                testsuite_mailstore_close();    
 
129
                testsuite_mailstore_close();
130
130
        } else {
131
131
                return testsuite_mailstore_mail;
132
132
        }
136
136
                sieve_sys_error(testsuite_sieve_instance,
137
137
                        "testsuite: failed to open mailbox '%s'", folder);
138
138
                mailbox_free(&box);
139
 
                return NULL;    
 
139
                return NULL;
140
140
        }
141
 
        
 
141
 
142
142
        /* Sync mailbox */
143
143
 
144
144
        if ( mailbox_sync(box, MAILBOX_SYNC_FLAG_FULL_READ) < 0 ) {