Skip to content

Commit

Permalink
lib-sieve: Dropped lib-lda dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanbosch committed Oct 4, 2017
1 parent 418816c commit 3ac2b15
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
3 changes: 0 additions & 3 deletions src/lib-sieve/Makefile.am
Expand Up @@ -4,7 +4,6 @@ dovecot_pkglib_LTLIBRARIES = libdovecot-sieve.la

AM_CPPFLAGS = \
$(LIBDOVECOT_INCLUDE) \
$(LIBDOVECOT_LDA_INCLUDE) \
$(LIBDOVECOT_SERVICE_INCLUDE) \
-I$(top_srcdir)/src/lib-sieve/util \
-DMODULEDIR=\""$(dovecot_moduledir)"\"
Expand Down Expand Up @@ -87,14 +86,12 @@ libdovecot_sieve_la_DEPENDENCIES = \
$(storages) \
$(plugins) \
$(top_builddir)/src/lib-sieve/util/libsieve_util.la \
$(LIBDOVECOT_LDA_DEPS) \
$(LIBDOVECOT_STORAGE_DEPS) \
$(LIBDOVECOT_DEPS)
libdovecot_sieve_la_LIBADD = \
$(storages) \
$(plugins) \
$(top_builddir)/src/lib-sieve/util/libsieve_util.la \
$(LIBDOVECOT_LDA) \
$(LIBDOVECOT_STORAGE) \
$(LIBDOVECOT)

Expand Down
27 changes: 15 additions & 12 deletions src/lib-sieve/sieve-actions.c
Expand Up @@ -11,7 +11,6 @@
#include "istream.h"
#include "istream-header-filter.h"
#include "ostream.h"
#include "mail-deliver.h"
#include "mail-storage.h"
#include "message-date.h"
#include "message-size.h"
Expand Down Expand Up @@ -363,10 +362,13 @@ static bool act_store_mailbox_open
(const struct sieve_action_exec_env *aenv, const char *mailbox,
struct mailbox **box_r, enum mail_error *error_code_r, const char **error_r)
{
struct mailbox *box;
struct mail_storage **storage = &(aenv->exec_status->last_storage);
struct mail_deliver_save_open_context save_ctx;
enum mailbox_flags flags = 0;

*box_r = NULL;
*error_code_r = MAIL_ERROR_NONE;
*error_r = NULL;

if ( !uni_utf8_str_is_valid(mailbox) ) {
/* Just a precaution; already (supposed to be) checked at
Expand All @@ -377,17 +379,18 @@ static bool act_store_mailbox_open
return FALSE;
}

i_zero(&save_ctx);
save_ctx.user = aenv->scriptenv->user;
save_ctx.lda_mailbox_autocreate = aenv->scriptenv->mailbox_autocreate;
save_ctx.lda_mailbox_autosubscribe = aenv->scriptenv->mailbox_autosubscribe;
if (aenv->scriptenv->mailbox_autocreate)
flags |= MAILBOX_FLAG_AUTO_CREATE;
if (aenv->scriptenv->mailbox_autosubscribe)
flags |= MAILBOX_FLAG_AUTO_SUBSCRIBE;
*box_r = box = mailbox_alloc_delivery(
aenv->scriptenv->user, mailbox, flags);
*storage = mailbox_get_storage(box);

if ( mail_deliver_save_open
(&save_ctx, mailbox, box_r, error_code_r, error_r) < 0 )
return FALSE;

*storage = mailbox_get_storage(*box_r);
return TRUE;
if (mailbox_open(box) == 0)
return TRUE;
*error_r = mailbox_get_last_error(box, error_code_r);
return FALSE;
}

static int act_store_start
Expand Down
1 change: 0 additions & 1 deletion src/lib-sieve/sieve-result.c
Expand Up @@ -11,7 +11,6 @@
#include "var-expand.h"
#include "message-address.h"
#include "mail-storage.h"
#include "mail-deliver.h"

#include "sieve-common.h"
#include "sieve-limits.h"
Expand Down

0 comments on commit 3ac2b15

Please sign in to comment.