Skip to content

Commit

Permalink
signature of dovecot mailbox_transaction_begin function changed for
Browse files Browse the repository at this point in the history
dovecot 2.3.x
  • Loading branch information
jrse committed Sep 25, 2017
1 parent 0c0f101 commit 379151f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
7 changes: 7 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ AC_CHECK_MEMBER([struct mail_storage_vfuncs.list_index_corrupted],
#include "mail-storage-private.h"
]])


AC_MSG_CHECKING([for HAVE_MAIL_STORAGE_TRANSACTION_OLD_SIGNATURE])
AS_IF([$GREP -A 1 'mailbox_transaction_begin(struct mailbox \*box' $dovecot_pkgincludedir/mail-storage.h | grep 'enum mailbox_transaction_flags flags);'], [AC_MSG_RESULT(yes) AC_DEFINE([HAVE_MAIL_STORAGE_TRANSACTION_OLD_SIGNATURE],,[HAVE_MAIL_STORAGE_TRANSACTION_OLD_SIGNATURE supported])],[AC_MSG_RESULT(no)])




AC_CONFIG_HEADERS([config-local.h])
AX_PREFIX_CONFIG_H([$PACKAGE-config.h], [$PACKAGE], [config-local.h])

Expand Down
19 changes: 18 additions & 1 deletion src/tests/storage-mock-rbox/test_storage_mock_rbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ extern "C" {

#include "libdict-rados-plugin.h"
}
#include "dovecot-ceph-plugin-config.h"

#include "rbox-storage.hpp"
#include "../mocks/mock_test.h"

Expand Down Expand Up @@ -70,8 +72,13 @@ TEST_F(StorageTest, mail_save_to_inbox_storage_mock_no_rados_available) {
"body\n";

struct istream *input = i_stream_create_from_data(message, strlen(message));

#ifdef DOVECOT_CEPH_PLUGIN_HAVE_MAIL_STORAGE_TRANSACTION_OLD_SIGNATURE
struct mailbox_transaction_context *trans = mailbox_transaction_begin(box, MAILBOX_TRANSACTION_FLAG_EXTERNAL);
#else
char reason[256];
struct mailbox_transaction_context *trans = mailbox_transaction_begin(box, MAILBOX_TRANSACTION_FLAG_EXTERNAL, reason);
#endif

struct mail_save_context *save_ctx = mailbox_save_alloc(trans);

// set the Mock storage
Expand Down Expand Up @@ -146,7 +153,12 @@ TEST_F(StorageTest, exec_write_op_fails) {

struct istream *input = i_stream_create_from_data(message, strlen(message));

#ifdef DOVECOT_CEPH_PLUGIN_HAVE_MAIL_STORAGE_TRANSACTION_OLD_SIGNATURE
struct mailbox_transaction_context *trans = mailbox_transaction_begin(box, MAILBOX_TRANSACTION_FLAG_EXTERNAL);
#else
char reason[256];
struct mailbox_transaction_context *trans = mailbox_transaction_begin(box, MAILBOX_TRANSACTION_FLAG_EXTERNAL, reason);
#endif
struct mail_save_context *save_ctx = mailbox_save_alloc(trans);

// set the Mock storage
Expand Down Expand Up @@ -224,7 +236,12 @@ TEST_F(StorageTest, write_op_fails) {

struct istream *input = i_stream_create_from_data(message, strlen(message));

#ifdef DOVECOT_CEPH_PLUGIN_HAVE_MAIL_STORAGE_TRANSACTION_OLD_SIGNATURE
struct mailbox_transaction_context *trans = mailbox_transaction_begin(box, MAILBOX_TRANSACTION_FLAG_EXTERNAL);
#else
char reason[256];
struct mailbox_transaction_context *trans = mailbox_transaction_begin(box, MAILBOX_TRANSACTION_FLAG_EXTERNAL, reason);
#endif
struct mail_save_context *save_ctx = mailbox_save_alloc(trans);

// set the Mock storage
Expand Down

0 comments on commit 379151f

Please sign in to comment.