diff --git a/src/lib-sieve/ext-reject.c b/src/lib-sieve/ext-reject.c index 6e61f951fd9badc40b0e369704bd8a561fe532f9..2d3a2a044ff1b26e369a778381ac37df4f546092 100644 --- a/src/lib-sieve/ext-reject.c +++ b/src/lib-sieve/ext-reject.c @@ -33,6 +33,7 @@ #include "sieve-interpreter.h" #include "sieve-dump.h" #include "sieve-result.h" +#include "sieve-message.h" /* * Forward declarations @@ -319,7 +320,7 @@ static bool act_reject_send smtp_handle = senv->smtp_open(msgdata->return_path, NULL, &f); - new_msgid = sieve_get_new_message_id(senv); + new_msgid = sieve_message_get_new_id(senv); boundary = t_strdup_printf("%s/%s", my_pid, senv->hostname); rfc2822_header_field_write(f, "X-Sieve", SIEVE_IMPLEMENTATION); diff --git a/src/lib-sieve/plugins/enotify/ntfy-mailto.c b/src/lib-sieve/plugins/enotify/ntfy-mailto.c index 854cd29e4ba4a622e460d3a661ba40f868e1f586..e2871b7a88d7ae498783083c22ae02bd0b2a714f 100644 --- a/src/lib-sieve/plugins/enotify/ntfy-mailto.c +++ b/src/lib-sieve/plugins/enotify/ntfy-mailto.c @@ -1,6 +1,16 @@ /* Copyright (c) 2002-2008 Dovecot Sieve authors, see the included COPYING file */ +/* Notify method mailto + * -------------------- + * + * Authors: Stephan Bosch + * Specification: draft-ietf-sieve-notify-mailto-10.txt + * Implementation: almost full + * Status: under development + * + */ + #include "lib.h" #include "array.h" #include "str.h" @@ -11,15 +21,13 @@ #include "rfc2822.h" -#include "sieve-common.h" +#include "sieve-ext-enotify.h" #include "sieve-address.h" +#include "sieve-message.h" /* To be removed */ -#include "sieve-actions.h" #include "sieve-result.h" -#include "sieve-ext-enotify.h" - /* * Configuration */ @@ -449,7 +457,6 @@ static bool ntfy_mailto_parse_uri (const struct sieve_enotify_log *nlog, const char *uri_body, ARRAY_TYPE(recipients) *recipients_r, ARRAY_TYPE(headers) *headers_r, const char **body, const char **subject) - { const char *p = uri_body; @@ -491,14 +498,14 @@ static bool ntfy_mailto_parse_uri */ static bool ntfy_mailto_compile_check_uri - (const struct sieve_enotify_log *nlog, const char *uri, - const char *uri_body) +(const struct sieve_enotify_log *nlog, const char *uri ATTR_UNUSED, + const char *uri_body) { return ntfy_mailto_parse_uri(nlog, uri_body, NULL, NULL, NULL, NULL); } static bool ntfy_mailto_compile_check_from - (const struct sieve_enotify_log *nlog, string_t *from) +(const struct sieve_enotify_log *nlog, string_t *from) { const char *error; bool result = FALSE; @@ -721,7 +728,7 @@ static bool ntfy_mailto_send unsigned int h, hcount; smtp_handle = senv->smtp_open(recipients[i].normalized, from, &f); - outmsgid = sieve_get_new_message_id(senv); + outmsgid = sieve_message_get_new_id(senv); rfc2822_header_field_write(f, "X-Sieve", SIEVE_IMPLEMENTATION); rfc2822_header_field_write(f, "Message-ID", outmsgid); diff --git a/src/lib-sieve/plugins/vacation/cmd-vacation.c b/src/lib-sieve/plugins/vacation/cmd-vacation.c index 191b8ece101238d440d4eaa7386d89d64253aeb9..4f096ce55cba6426f520476de738da9cef4a4841 100644 --- a/src/lib-sieve/plugins/vacation/cmd-vacation.c +++ b/src/lib-sieve/plugins/vacation/cmd-vacation.c @@ -24,6 +24,7 @@ #include "sieve-interpreter.h" #include "sieve-dump.h" #include "sieve-result.h" +#include "sieve-message.h" #include "ext-vacation-common.h" @@ -832,7 +833,7 @@ static bool act_vacation_send /* Open smtp session */ smtp_handle = senv->smtp_open(msgdata->return_path, NULL, &f); - outmsgid = sieve_get_new_message_id(senv); + outmsgid = sieve_message_get_new_id(senv); /* Produce a proper reply */ diff --git a/src/lib-sieve/sieve-actions.c b/src/lib-sieve/sieve-actions.c index 39cf8dc19a064deaebf601749c3e8763dc04a873..bd5e1d26507cd06a6daaec2298a690c4457e2feb 100644 --- a/src/lib-sieve/sieve-actions.c +++ b/src/lib-sieve/sieve-actions.c @@ -3,7 +3,6 @@ #include "lib.h" #include "strfuncs.h" -#include "ioloop.h" #include "str-sanitize.h" #include "mail-storage.h" #include "mail-namespace.h" @@ -16,20 +15,6 @@ #include "sieve-result.h" #include "sieve-actions.h" -/* - * Message transmission (FIXME: place this somewhere more appropriate) - */ - -const char *sieve_get_new_message_id - (const struct sieve_script_env *senv) -{ - static int count = 0; - - return t_strdup_printf("<dovecot-sieve-%s-%s-%d@%s>", - dec2str(ioloop_timeval.tv_sec), dec2str(ioloop_timeval.tv_usec), - count++, senv->hostname); -} - /* * Action execution environment */ diff --git a/src/lib-sieve/sieve-actions.h b/src/lib-sieve/sieve-actions.h index 135414f2af9c50c21bf3357b4d41a4d38765cdc6..1e91dde9646b10dc30b3e44e662be5ac2cb93689 100644 --- a/src/lib-sieve/sieve-actions.h +++ b/src/lib-sieve/sieve-actions.h @@ -191,12 +191,5 @@ int sieve_act_store_add_to_result (const struct sieve_runtime_env *renv, struct sieve_side_effects_list *seffects, const char *folder, unsigned int source_line); - -/* - * Message transmission (FIXME: put this somewhere else) - */ - -const char *sieve_get_new_message_id - (const struct sieve_script_env *senv); - + #endif /* __SIEVE_ACTIONS_H */ diff --git a/src/lib-sieve/sieve-message.c b/src/lib-sieve/sieve-message.c index fab43b25c14506b35a94a45abd593ef8c732fd3f..61901e8fb38758305546e2540b5599aeac0dfc47 100644 --- a/src/lib-sieve/sieve-message.c +++ b/src/lib-sieve/sieve-message.c @@ -2,6 +2,7 @@ */ #include "lib.h" +#include "ioloop.h" #include "mempool.h" #include "array.h" @@ -9,6 +10,20 @@ #include "sieve-message.h" #include "sieve-extensions.h" +/* + * Message transmission + */ + +const char *sieve_message_get_new_id +(const struct sieve_script_env *senv) +{ + static int count = 0; + + return t_strdup_printf("<dovecot-sieve-%s-%s-%d@%s>", + dec2str(ioloop_timeval.tv_sec), dec2str(ioloop_timeval.tv_usec), + count++, senv->hostname); +} + /* * Message context */ @@ -70,9 +85,7 @@ pool_t sieve_message_context_pool(struct sieve_message_context *msgctx) return msgctx->pool; } -/* - * Extension support - */ +/* Extension support */ void sieve_message_context_extension_set (struct sieve_message_context *msgctx, const struct sieve_extension *ext, diff --git a/src/lib-sieve/sieve-message.h b/src/lib-sieve/sieve-message.h index 627a8a61cb18e66760183fb1d88d10af60eec625..aa0c8d7d6587fedb43f4c7695842d8ca46dca4d1 100644 --- a/src/lib-sieve/sieve-message.h +++ b/src/lib-sieve/sieve-message.h @@ -4,6 +4,13 @@ #ifndef __SIEVE_MESSAGE_H #define __SIEVE_MESSAGE_H +/* + * Message transmission + */ + +const char *sieve_message_get_new_id + (const struct sieve_script_env *senv); + /* * Message context */ @@ -19,9 +26,7 @@ void sieve_message_context_flush(struct sieve_message_context *msgctx); pool_t sieve_message_context_pool (struct sieve_message_context *msgctx); -/* - * Extension support - */ +/* Extension support */ void sieve_message_context_extension_set (struct sieve_message_context *msgctx, const struct sieve_extension *ext,