dovecot-2.0-pigeonhole: Removed spurious source file.
pigeonhole at rename-it.nl
pigeonhole at rename-it.nl
Mon Aug 30 04:16:05 EEST 2010
details: http://hg.rename-it.nl/dovecot-2.0-pigeonhole/rev/91b5289ac832
changeset: 1400:91b5289ac832
user: Stephan Bosch <stephan at rename-it.nl>
date: Mon Aug 30 03:15:57 2010 +0200
description:
Removed spurious source file.
diffstat:
src/lib-sieve/plugins/enotify/ntfy-mailto.c | 1106 --------------------------------
1 files changed, 0 insertions(+), 1106 deletions(-)
diffs (truncated from 1110 to 300 lines):
diff -r 66cf3c948718 -r 91b5289ac832 src/lib-sieve/plugins/enotify/ntfy-mailto.c
--- a/src/lib-sieve/plugins/enotify/ntfy-mailto.c Mon Aug 30 03:13:29 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1106 +0,0 @@
-/* Copyright (c) 2002-2010 Pigeonhole authors, see the included COPYING file
- */
-
-/* Notify method mailto
- * --------------------
- *
- * Authors: Stephan Bosch
- * Specification: RFC 5436
- * Implementation: full
- * Status: testing
- *
- */
-
-/* FIXME: URI syntax conforms to something somewhere in between RFC 2368 and
- * draft-duerst-mailto-bis-05.txt. Should fully migrate to new specification
- * when it matures. This requires modifications to the address parser (no
- * whitespace allowed within the address itself) and UTF-8 support will be
- * required in the URL.
- */
-
-#include "lib.h"
-#include "array.h"
-#include "str.h"
-#include "ioloop.h"
-#include "str-sanitize.h"
-#include "message-date.h"
-#include "mail-storage.h"
-
-#include "rfc2822.h"
-
-#include "sieve-ext-enotify.h"
-#include "sieve-address.h"
-#include "sieve-message.h"
-#include "sieve-smtp.h"
-
-/*
- * Configuration
- */
-
-#define NTFY_MAILTO_MAX_RECIPIENTS 8
-#define NTFY_MAILTO_MAX_HEADERS 16
-#define NTFY_MAILTO_MAX_SUBJECT 256
-
-/*
- * Types
- */
-
-struct ntfy_mailto_header_field {
- const char *name;
- const char *body;
-};
-
-struct ntfy_mailto_recipient {
- const char *full;
- const char *normalized;
- bool carbon_copy;
-};
-
-ARRAY_DEFINE_TYPE(recipients, struct ntfy_mailto_recipient);
-ARRAY_DEFINE_TYPE(headers, struct ntfy_mailto_header_field);
-
-/*
- * Mailto notification method
- */
-
-static bool ntfy_mailto_compile_check_uri
- (const struct sieve_enotify_log *nlog, const char *uri, const char *uri_body);
-static bool ntfy_mailto_compile_check_from
- (const struct sieve_enotify_log *nlog, string_t *from);
-
-static const char *ntfy_mailto_runtime_get_notify_capability
- (const struct sieve_enotify_log *nlog, const char *uri, const char *uri_body,
- const char *capability);
-static bool ntfy_mailto_runtime_check_uri
- (const struct sieve_enotify_log *nlog, const char *uri, const char *uri_body);
-static bool ntfy_mailto_runtime_check_operands
- (const struct sieve_enotify_log *nlog, const char *uri,const char *uri_body,
- string_t *message, string_t *from, pool_t context_pool,
- void **method_context);
-
-static int ntfy_mailto_action_check_duplicates
- (const struct sieve_enotify_log *nlog, void *method_ctx1, void *method_ctx2,
- const char *dupl_location);
-
-static void ntfy_mailto_action_print
- (const struct sieve_enotify_print_env *penv,
- const struct sieve_enotify_action *act);
-
-static bool ntfy_mailto_action_execute
- (const struct sieve_enotify_exec_env *nenv,
- const struct sieve_enotify_action *act);
-
-const struct sieve_enotify_method mailto_notify = {
- "mailto",
- ntfy_mailto_compile_check_uri,
- NULL,
- ntfy_mailto_compile_check_from,
- NULL,
- ntfy_mailto_runtime_check_uri,
- ntfy_mailto_runtime_get_notify_capability,
- ntfy_mailto_runtime_check_operands,
- NULL,
- ntfy_mailto_action_check_duplicates,
- ntfy_mailto_action_print,
- ntfy_mailto_action_execute
-};
-
-/*
- * Method context data
- */
-
-struct ntfy_mailto_context {
- ARRAY_TYPE(recipients) recipients;
- ARRAY_TYPE(headers) headers;
- const char *subject;
- const char *body;
- const char *from_normalized;
-};
-
-/*
- * Reserved headers
- */
-
-static const char *_reserved_headers[] = {
- "auto-submitted",
- "received",
- "message-id",
- "data",
- "bcc",
- "in-reply-to",
- "references",
- "resent-date",
- "resent-from",
- "resent-sender",
- "resent-to",
- "resent-cc",
- "resent-bcc",
- "resent-msg-id",
- "from",
- "sender",
- NULL
-};
-
-static const char *_unique_headers[] = {
- "reply-to",
- NULL
-};
-
-static inline bool _ntfy_mailto_header_allowed(const char *field_name)
-{
- const char **rhdr = _reserved_headers;
-
- /* Check whether it is reserved */
- while ( *rhdr != NULL ) {
- if ( strcasecmp(field_name, *rhdr) == 0 )
- return FALSE;
- rhdr++;
- }
-
- return TRUE;
-}
-
-static inline bool _ntfy_mailto_header_unique(const char *field_name)
-{
- const char **rhdr = _unique_headers;
-
- /* Check whether it is supposed to be unique */
- while ( *rhdr != NULL ) {
- if ( strcasecmp(field_name, *rhdr) == 0 )
- return TRUE;
- rhdr++;
- }
-
- return FALSE;
-}
-
-/*
- * Mailto URI parsing
- */
-
-/* Util functions */
-
-#define _uri_parse_error(LOG, ...) \
- sieve_enotify_error(LOG, "invalid mailto URI: " __VA_ARGS__ )
-
-#define _uri_parse_warning(LOG, ...) \
- sieve_enotify_warning(LOG, "mailto URI: " __VA_ARGS__ )
-
-/* FIXME: much of this implementation will be common to other URI schemes. This
- * should be merged into a common implementation.
- */
-
-static const char _qchar_lookup[256] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 00
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 10
- 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, // 20
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, // 30
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 40
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, // 50
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 60
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, // 70
-
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 80
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 90
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // A0
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // B0
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // C0
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // D0
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // E0
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // F0
-};
-
-static inline bool _is_qchar(unsigned char c)
-{
- return _qchar_lookup[c];
-}
-
-static inline int _decode_hex_digit(char digit)
-{
- switch ( digit ) {
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- return (int) digit - '0';
-
- case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
- return (int) digit - 'a' + 0x0a;
-
- case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
- return (int) digit - 'A' + 0x0A;
- }
-
- return -1;
-}
-
-static bool _parse_hex_value(const char **in, char *out)
-{
- char value;
-
- if ( **in == '\0' || (value=_decode_hex_digit(**in)) < 0 )
- return FALSE;
-
- *out = value << 4;
- (*in)++;
-
- if ( **in == '\0' || (value=_decode_hex_digit(**in)) < 0 )
- return FALSE;
-
- *out |= value;
- (*in)++;
- return (*out != '\0');
-}
-
-static bool _uri_add_valid_recipient
-(const struct sieve_enotify_log *nlog, ARRAY_TYPE(recipients) *recipients,
- string_t *recipient, bool cc)
-{
- const char *error;
- const char *normalized;
-
- /* Verify recipient */
- if ( (normalized=sieve_address_normalize(recipient, &error)) == NULL ) {
- _uri_parse_error(nlog, "invalid recipient '%s': %s",
- str_sanitize(str_c(recipient), 80), error);
- return FALSE;
- }
-
- /* Add recipient to the list */
- if ( recipients != NULL ) {
- struct ntfy_mailto_recipient *new_recipient;
- struct ntfy_mailto_recipient *rcpts;
- unsigned int count, i;
- pool_t pool;
-
- rcpts = array_get_modifiable(recipients, &count);
-
- /* Enforce limits */
- if ( count >= NTFY_MAILTO_MAX_RECIPIENTS ) {
- if ( count == NTFY_MAILTO_MAX_RECIPIENTS ) {
- _uri_parse_warning(nlog,
- "more than the maximum %u recipients specified; "
- "rest is discarded", NTFY_MAILTO_MAX_RECIPIENTS);
- }
- return TRUE;
- }
-
- /* Check for duplicate first */
- for ( i = 0; i < count; i++ ) {
- if ( sieve_address_compare(rcpts[i].normalized, normalized, TRUE) == 0 )
- {
- /* Upgrade existing Cc: recipient to a To: recipient if possible */
- rcpts[i].carbon_copy = ( rcpts[i].carbon_copy && cc );
-
- _uri_parse_warning(nlog, "ignored duplicate recipient '%s'",
- str_sanitize(str_c(recipient), 80));
- return TRUE;
- }
More information about the dovecot-cvs
mailing list