exim4/4.69/memcache-support.patch
changeset 3 c1c63bcbc84f
child 4 5d6a10b5469c
equal deleted inserted replaced
2:21c93a4387f7 3:c1c63bcbc84f
       
     1 diff -r 2986669e93b0 -r c0445d21ca67 debian/EDITME.exim4-light.diff
       
     2 --- a/debian/EDITME.exim4-light.diff	Mon Aug 10 16:00:12 2009 +0200
       
     3 +++ b/debian/EDITME.exim4-light.diff	Mon Aug 10 16:01:25 2009 +0200
       
     4 @@ -1,5 +1,5 @@
       
     5 ---- /tmp/dpep-work.wG8120/trunk/build-tree/src/EDITME	2007-07-17 11:04:08.000000000 +0200
       
     6 -+++ EDITME.exim4-light	2007-07-17 11:04:27.000000000 +0200
       
     7 +--- /home/luser/src/debian-packages/exim4-4.69/build-tree/src/EDITME	2009-08-10 15:37:12.000000000 +0200
       
     8 ++++ EDITME.exim4-light	2009-08-10 15:45:37.000000000 +0200
       
     9  @@ -100,7 +100,7 @@
       
    10   # /usr/local/sbin. The installation script will try to create this directory,
       
    11   # and any superior directories, if they do not exist.
       
    12 @@ -196,9 +196,15 @@
       
    13   
       
    14   
       
    15   #------------------------------------------------------------------------------
       
    16 -@@ -1149,3 +1156,6 @@
       
    17 +@@ -1148,4 +1155,12 @@
       
    18 + 
       
    19   # ENABLE_DISABLE_FSYNC=yes
       
    20   
       
    21 ++#------------------------------------------------------------------------------
       
    22 ++# support storage/retrieval of values to and from memcache servers via
       
    23 ++# expansions
       
    24 ++SUPPORT_MEMCACHE=yes
       
    25 ++
       
    26   # End of EDITME for Exim 4.
       
    27  +
       
    28  +# enable IPv6 support
       
    29 diff -r 2986669e93b0 -r c0445d21ca67 debian/patches/00list
       
    30 --- a/debian/patches/00list	Mon Aug 10 16:00:12 2009 +0200
       
    31 +++ b/debian/patches/00list	Mon Aug 10 16:01:25 2009 +0200
       
    32 @@ -12,3 +12,4 @@
       
    33  60_convert4r4
       
    34  66_enlarge-dh-parameters-size
       
    35  70_remove_exim-users_references
       
    36 +80_memcache
       
    37 diff -r 2986669e93b0 -r c0445d21ca67 debian/patches/80_memcache.dpatch
       
    38 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
    39 +++ b/debian/patches/80_memcache.dpatch	Mon Aug 10 16:01:25 2009 +0200
       
    40 @@ -0,0 +1,442 @@
       
    41 +#! /bin/sh /usr/share/dpatch/dpatch-run
       
    42 +## 80_memcache.dpatch by  <luser@lenny.vbox.hurz.is.schlittermann.de>
       
    43 +##
       
    44 +## All lines beginning with `## DP:' are a description of the patch.
       
    45 +## DP: key/value storage/retrieval via memcache
       
    46 +
       
    47 +@DPATCH@
       
    48 +
       
    49 +diff -r 6c0f7fa36c53 OS/Makefile-Base
       
    50 +--- a/build-tree/OS/Makefile-Base	Wed Jul 29 15:15:06 2009 +0200
       
    51 ++++ b/build-tree/OS/Makefile-Base	Mon Aug 10 10:31:21 2009 +0200
       
    52 +@@ -543,7 +543,7 @@
       
    53 + dns.o:           $(HDRS) dns.c
       
    54 + enq.o:           $(HDRS) enq.c
       
    55 + exim.o:          $(HDRS) exim.c
       
    56 +-expand.o:        $(HDRS) expand.c
       
    57 ++expand.o:        $(HDRS) memcache.h expand.c
       
    58 + filter.o:        $(HDRS) filter.c
       
    59 + filtertest.o:    $(HDRS) filtertest.c
       
    60 + globals.o:       $(HDRS) globals.c
       
    61 +diff -r 6c0f7fa36c53 doc/OptionLists.txt
       
    62 +--- a/build-tree/doc/OptionLists.txt	Wed Jul 29 15:15:06 2009 +0200
       
    63 ++++ b/build-tree/doc/OptionLists.txt	Mon Aug 10 10:31:21 2009 +0200
       
    64 +@@ -11,7 +11,7 @@
       
    65 +   4. Those that can appear in the build time configuration for the Exim monitor
       
    66 +      (Local/eximon.conf).
       
    67 + 
       
    68 +-This file was last updated for Exim release 4.67.
       
    69 ++This file was last updated for Exim release 4.69.
       
    70 + 
       
    71 + 
       
    72 + 1. RUN TIME OPTIONS
       
    73 +@@ -887,6 +887,7 @@
       
    74 + SUPPORT_CRYPTEQ              optional     support crypteq (if no auths)
       
    75 + SUPPORT_MAILDIR              optional     support for maildir delivery
       
    76 + SUPPORT_MAILSTORE            optional     support for mailstore delivery
       
    77 ++SUPPORT_MEMCACHE             optional*    support for memcache storage and retrieval
       
    78 + SUPPORT_MBX                  optional     support for MBX delivery
       
    79 + SUPPORT_MOVE_FROZEN_MESSAGES optional*    support for frozen message moving
       
    80 + SUPPORT_PAM                  optional     support for PAM authentication
       
    81 +diff -r 6c0f7fa36c53 doc/memcache.txt
       
    82 +--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
    83 ++++ b/build-tree/doc/memcache.txt	Mon Aug 10 10:31:21 2009 +0200
       
    84 +@@ -0,0 +1,4 @@
       
    85 ++store some value under key (expands to 'true' if successful):
       
    86 ++${memcache{memcache_servers}{set}{namespace}{key}{value}{expiration}{timeout}}
       
    87 ++lookup the value of some key (expands to 'true' if the key has been found; stores the value in $value)
       
    88 ++${memcache{memcache_servers}{get}{namespace}{key}{$value}{timeout}}
       
    89 +diff -r 6c0f7fa36c53 scripts/MakeLinks
       
    90 +--- a/build-tree/scripts/MakeLinks	Wed Jul 29 15:15:06 2009 +0200
       
    91 ++++ b/build-tree/scripts/MakeLinks	Mon Aug 10 10:31:21 2009 +0200
       
    92 +@@ -200,6 +200,7 @@
       
    93 + ln -s ../src/globals.h         globals.h
       
    94 + ln -s ../src/local_scan.h      local_scan.h
       
    95 + ln -s ../src/macros.h          macros.h
       
    96 ++ln -s ../src/memcache.h        memcache.h
       
    97 + ln -s ../src/mytypes.h         mytypes.h
       
    98 + ln -s ../src/osfunctions.h     osfunctions.h
       
    99 + ln -s ../src/store.h           store.h
       
   100 +diff -r 6c0f7fa36c53 src/config.h.defaults
       
   101 +--- a/build-tree/src/config.h.defaults	Wed Jul 29 15:15:06 2009 +0200
       
   102 ++++ b/build-tree/src/config.h.defaults	Mon Aug 10 10:31:21 2009 +0200
       
   103 +@@ -120,6 +120,7 @@
       
   104 + #define SUPPORT_MAILDIR
       
   105 + #define SUPPORT_MAILSTORE
       
   106 + #define SUPPORT_MBX
       
   107 ++#define SUPPORT_MEMCACHE
       
   108 + #define SUPPORT_MOVE_FROZEN_MESSAGES
       
   109 + #define SUPPORT_PAM
       
   110 + #define SUPPORT_TLS
       
   111 +diff -r 6c0f7fa36c53 src/expand.c
       
   112 +--- a/build-tree/src/expand.c	Wed Jul 29 15:15:06 2009 +0200
       
   113 ++++ b/build-tree/src/expand.c	Mon Aug 10 10:31:21 2009 +0200
       
   114 +@@ -25,6 +25,10 @@
       
   115 + 
       
   116 + #ifdef LOOKUP_LDAP
       
   117 + #include "lookups/ldap.h"
       
   118 ++#endif
       
   119 ++
       
   120 ++#ifdef SUPPORT_MEMCACHE
       
   121 ++#include "memcache.h"
       
   122 + #endif
       
   123 + 
       
   124 + #ifdef SUPPORT_CRYPTEQ
       
   125 +@@ -113,6 +117,7 @@
       
   126 +   US"length",
       
   127 +   US"lookup",
       
   128 +   US"map",
       
   129 ++  US"memcache",
       
   130 +   US"nhash",
       
   131 +   US"perl",
       
   132 +   US"prvs",
       
   133 +@@ -135,6 +140,7 @@
       
   134 +   EITEM_LENGTH,
       
   135 +   EITEM_LOOKUP,
       
   136 +   EITEM_MAP,
       
   137 ++  EITEM_MEMCACHE,
       
   138 +   EITEM_NHASH,
       
   139 +   EITEM_PERL,
       
   140 +   EITEM_PRVS,
       
   141 +@@ -4980,6 +4986,229 @@
       
   142 +         }
       
   143 +       }
       
   144 +     #endif /* EXPAND_DLFUNC */
       
   145 ++
       
   146 ++    case EITEM_MEMCACHE:
       
   147 ++    #ifndef SUPPORT_MEMCACHE
       
   148 ++    expand_string_message = US"\"${memcache\" encountered, but this facility "
       
   149 ++      "is not included in this binary";
       
   150 ++    goto EXPAND_FAILED;
       
   151 ++
       
   152 ++    #else   /* SUPPORT_MEMCACHE */
       
   153 ++    /* we dont use flags right now - should we? */
       
   154 ++
       
   155 ++      {
       
   156 ++        uschar *memcache_timeout = US"0s";   /* with time unit postfix, fex 7d */
       
   157 ++        uschar *memcache_expiration = US"0"; /* in seconds */
       
   158 ++        int i_memcache_expiration = -1, i_memcache_timeout = -1;
       
   159 ++        int memcache_operation;
       
   160 ++        uschar *sub_arg[7];
       
   161 ++
       
   162 ++        uschar *memcache_servers[MEMCACHE_SERVERS_MAX];
       
   163 ++        tree_node *memcache_hosts_node;
       
   164 ++        uschar *memcache_hosts_string, *memcache_op_string;
       
   165 ++        uschar *memcache_host;
       
   166 ++        int memcache_hostlist_separator = 0;
       
   167 ++        int i_memcache_server = 0;
       
   168 ++        int n_memcache_servers = 0;
       
   169 ++
       
   170 ++        uschar *memcache_request;
       
   171 ++        int memcache_request_len;
       
   172 ++
       
   173 ++        uschar *memcache_readsocket_result;
       
   174 ++
       
   175 ++        if ((expand_forbid & RDO_MEMCACHE) != 0)
       
   176 ++          {
       
   177 ++          expand_string_message = US"memcache storage/retrieval are not permitted";
       
   178 ++          goto EXPAND_FAILED;
       
   179 ++          }
       
   180 ++
       
   181 ++        /* read up to 7 args */
       
   182 ++        switch(read_subs(sub_arg, 7, 5, &s, skipping, TRUE, US"memcache"))
       
   183 ++          {
       
   184 ++          case 1: goto EXPAND_FAILED_CURLY;
       
   185 ++          case 2:                             /* Won't occur: no end check */
       
   186 ++          case 3: goto EXPAND_FAILED;
       
   187 ++          }
       
   188 ++
       
   189 ++        /* validate operation and set argument indices */
       
   190 ++        memcache_op_string = string_sprintf(US"%S", sub_arg[1]);
       
   191 ++        if (Ustrcmp(memcache_op_string, US"set") == 0)
       
   192 ++          {
       
   193 ++          i_memcache_expiration = 5; i_memcache_timeout = 6; memcache_operation = MEMCACHE_OP_SET;
       
   194 ++          }
       
   195 ++        else if (Ustrcmp(memcache_op_string, US"get") == 0)
       
   196 ++          {
       
   197 ++          i_memcache_timeout = 5; memcache_operation = MEMCACHE_OP_GET;
       
   198 ++          }
       
   199 ++        else
       
   200 ++          {
       
   201 ++          expand_string_message = string_sprintf(US"invalid memcache operation '%s'",
       
   202 ++            sub_arg[1]);
       
   203 ++          goto EXPAND_FAILED;
       
   204 ++          }
       
   205 ++
       
   206 ++        /* expiration */
       
   207 ++        if (i_memcache_expiration >=0 && sub_arg[i_memcache_expiration] != NULL)
       
   208 ++          {
       
   209 ++          memcache_expiration = string_sprintf(US"%d", readconf_readtime(sub_arg[i_memcache_expiration], 0, FALSE));
       
   210 ++          if (memcache_expiration < 0)
       
   211 ++            {
       
   212 ++            expand_string_message = string_sprintf(US"bad time value %s",
       
   213 ++              sub_arg[i_memcache_expiration]);
       
   214 ++            goto EXPAND_FAILED;
       
   215 ++            }
       
   216 ++          }
       
   217 ++
       
   218 ++        /* now that we have an expiration time we should be able to build the request string */
       
   219 ++        if (memcache_operation == MEMCACHE_OP_SET)
       
   220 ++          {
       
   221 ++          uschar* data = sub_arg[4];
       
   222 ++          int data_len = Ustrlen(data);
       
   223 ++
       
   224 ++          /* writeop [namespace]key flags expiration size-in-bytes [noreply] */
       
   225 ++          uschar *cmd = string_sprintf(US"%s %s%s %d %s %d %s", 
       
   226 ++              US"set",
       
   227 ++              sub_arg[2],
       
   228 ++              sub_arg[3],
       
   229 ++              0,
       
   230 ++              memcache_expiration,
       
   231 ++              data_len,
       
   232 ++              US"");
       
   233 ++          int cmd_len = Ustrlen(cmd);
       
   234 ++
       
   235 ++          memcache_request = string_sprintf(US"%s\r\n%s\r\n", cmd, data);
       
   236 ++          memcache_request_len = Ustrlen(memcache_request);
       
   237 ++          }
       
   238 ++        else if (memcache_operation == MEMCACHE_OP_GET)
       
   239 ++          {
       
   240 ++          memcache_request = string_sprintf(US"%s %s%s\r\n", US"get", sub_arg[2], sub_arg[3]);
       
   241 ++          memcache_request_len = Ustrlen(memcache_request);
       
   242 ++          }
       
   243 ++        else
       
   244 ++          {
       
   245 ++          expand_string_message = string_sprintf(US"invalid memcache operation: '%s'", memcache_op_string);
       
   246 ++          goto EXPAND_FAILED;
       
   247 ++          }
       
   248 ++
       
   249 ++        /* memcache servers - we expect either a named list or just a list */
       
   250 ++        if (sub_arg[0][0] == '+')
       
   251 ++          {
       
   252 ++          if (NULL == (memcache_hosts_node = tree_search(hostlist_anchor, sub_arg[0] + sizeof(uschar))))
       
   253 ++            {
       
   254 ++            expand_string_message = string_sprintf(US"named list '%s' not found",
       
   255 ++              sub_arg[0]);
       
   256 ++            goto EXPAND_FAILED;
       
   257 ++            }
       
   258 ++            memcache_hosts_string = ((namedlist_block *) memcache_hosts_node->data.ptr)->string;
       
   259 ++          }
       
   260 ++        else
       
   261 ++          {
       
   262 ++            memcache_hosts_string = sub_arg[0];
       
   263 ++          }
       
   264 ++
       
   265 ++        while ((NULL != (memcache_host = string_nextinlist(&memcache_hosts_string, &memcache_hostlist_separator, NULL, 0))))
       
   266 ++          {
       
   267 ++          if (i_memcache_server >= MEMCACHE_SERVERS_MAX)
       
   268 ++            {
       
   269 ++            expand_string_message = string_sprintf(US"too many memcache servers, %d is max",
       
   270 ++              MEMCACHE_SERVERS_MAX);
       
   271 ++            goto EXPAND_FAILED;
       
   272 ++            }
       
   273 ++          memcache_servers[i_memcache_server] = memcache_host;
       
   274 ++          i_memcache_server++;
       
   275 ++          }
       
   276 ++        n_memcache_servers = i_memcache_server;
       
   277 ++
       
   278 ++        /* talk to server(s) unless we are skipping */
       
   279 ++        if (!skipping)
       
   280 ++          {
       
   281 ++          for (i_memcache_server = 0; i_memcache_server < n_memcache_servers; 
       
   282 ++                 i_memcache_server++)
       
   283 ++            {
       
   284 ++
       
   285 ++            uschar *memcache_server_name = memcache_servers[i_memcache_server];
       
   286 ++            uschar *memcache_port_name = Ustrrchr(memcache_server_name, ':');
       
   287 ++            uschar *memcache_default_port_name = US"11211";
       
   288 ++
       
   289 ++            /* Sort out the port */
       
   290 ++            if (memcache_port_name == NULL)
       
   291 ++              {
       
   292 ++              memcache_port_name = memcache_default_port_name;
       
   293 ++              }
       
   294 ++            else
       
   295 ++              {
       
   296 ++              *memcache_port_name++ = 0;           /* Terminate server name */
       
   297 ++              }
       
   298 ++
       
   299 ++            uschar *memcache_server_readsocket =
       
   300 ++              string_sprintf(US"${readsocket{inet:%s:%s}{%s}{%s}}",
       
   301 ++              memcache_server_name,
       
   302 ++              memcache_port_name,
       
   303 ++              memcache_request,
       
   304 ++              sub_arg[i_memcache_timeout] == NULL ? memcache_timeout : sub_arg[i_memcache_timeout]);
       
   305 ++            DEBUG(D_memcache)
       
   306 ++              {
       
   307 ++              debug_printf("readsocket expansion item: '%s'\n", memcache_server_readsocket);
       
   308 ++              }
       
   309 ++            memcache_readsocket_result = expand_string(memcache_server_readsocket);
       
   310 ++            if (memcache_readsocket_result != NULL) 
       
   311 ++              {
       
   312 ++              if (memcache_operation == MEMCACHE_OP_GET
       
   313 ++                  && 0 == Ustrncmp(memcache_readsocket_result, US"VALUE ", Ustrlen(US"VALUE ")))
       
   314 ++                {
       
   315 ++                /* we tried to use expand_gettokened but it segfaults and we
       
   316 ++                   didnt find out why */
       
   317 ++                uschar *memcache_value_size = memcache_readsocket_result;
       
   318 ++                int i;
       
   319 ++                for (i = 0; i < 3; i++) { memcache_value_size = Ustrchr(memcache_value_size, ' ') + 1; }
       
   320 ++
       
   321 ++                lookup_value = strstr(memcache_readsocket_result, "\r\n") + Ustrlen("\r\n");
       
   322 ++                lookup_value[
       
   323 ++                  Ustrtol(memcache_value_size,
       
   324 ++                      NULL,
       
   325 ++                      0)] = 0;
       
   326 ++
       
   327 ++                DEBUG(D_memcache) { debug_printf("lookup_value: '%s'\n", lookup_value); }
       
   328 ++
       
   329 ++                }
       
   330 ++              else if (memcache_operation == MEMCACHE_OP_SET
       
   331 ++                  && 0 == Ustrcmp(memcache_readsocket_result, US"STORED\r\n"))
       
   332 ++                {
       
   333 ++                }
       
   334 ++              else
       
   335 ++                {
       
   336 ++                /* something went wrong - try something else */
       
   337 ++                DEBUG(D_memcache)
       
   338 ++                  {
       
   339 ++                  debug_printf("memcache operation '%s' failed: '%s'\n",
       
   340 ++                      memcache_op_string,
       
   341 ++                      memcache_readsocket_result);
       
   342 ++                  }
       
   343 ++                continue;
       
   344 ++                }
       
   345 ++
       
   346 ++              yield = string_cat(yield,
       
   347 ++                &size,
       
   348 ++                &ptr,
       
   349 ++                US"yes",
       
   350 ++                Ustrlen(US"yes"));
       
   351 ++              break; 
       
   352 ++              }
       
   353 ++
       
   354 ++            }
       
   355 ++
       
   356 ++            if (memcache_readsocket_result == NULL) 
       
   357 ++              {
       
   358 ++              /* every try failed if we come here */
       
   359 ++              expand_string_message = 
       
   360 ++                string_sprintf(US"all memcache servers failed - last error was: '%s'",
       
   361 ++                expand_string_message);
       
   362 ++              goto EXPAND_FAILED;
       
   363 ++              }
       
   364 ++          }
       
   365 ++        continue;
       
   366 ++      }
       
   367 ++    #endif /* SUPPORT_MEMCACHE */
       
   368 +     }
       
   369 + 
       
   370 +   /* Control reaches here if the name is not recognized as one of the more
       
   371 +diff -r 6c0f7fa36c53 src/globals.c
       
   372 +--- a/build-tree/src/globals.c	Wed Jul 29 15:15:06 2009 +0200
       
   373 ++++ b/build-tree/src/globals.c	Mon Aug 10 10:31:21 2009 +0200
       
   374 +@@ -448,6 +448,7 @@
       
   375 +   { US"load",           D_load },
       
   376 +   { US"local_scan",     D_local_scan },
       
   377 +   { US"lookup",         D_lookup },
       
   378 ++  { US"memcache",       D_memcache },
       
   379 +   { US"memory",         D_memory },
       
   380 +   { US"pid",            D_pid },
       
   381 +   { US"process_info",   D_process_info },
       
   382 +diff -r 6c0f7fa36c53 src/macros.h
       
   383 +--- a/build-tree/src/macros.h	Wed Jul 29 15:15:06 2009 +0200
       
   384 ++++ b/build-tree/src/macros.h	Mon Aug 10 10:31:21 2009 +0200
       
   385 +@@ -313,19 +313,20 @@
       
   386 + #define D_load                       0x00008000
       
   387 + #define D_lookup                     0x00010000
       
   388 + #define D_memory                     0x00020000
       
   389 +-#define D_pid                        0x00040000
       
   390 +-#define D_process_info               0x00080000
       
   391 +-#define D_queue_run                  0x00100000
       
   392 +-#define D_receive                    0x00200000
       
   393 +-#define D_resolver                   0x00400000
       
   394 +-#define D_retry                      0x00800000
       
   395 +-#define D_rewrite                    0x01000000
       
   396 +-#define D_route                      0x02000000
       
   397 +-#define D_timestamp                  0x04000000
       
   398 +-#define D_tls                        0x08000000
       
   399 +-#define D_transport                  0x10000000
       
   400 +-#define D_uid                        0x20000000
       
   401 +-#define D_verify                     0x40000000
       
   402 ++#define D_memcache                   0x00040000
       
   403 ++#define D_pid                        0x00080000
       
   404 ++#define D_process_info               0x00100000
       
   405 ++#define D_queue_run                  0x00200000
       
   406 ++#define D_receive                    0x00400000
       
   407 ++#define D_resolver                   0x00800000
       
   408 ++#define D_retry                      0x01000000
       
   409 ++#define D_rewrite                    0x02000000
       
   410 ++#define D_route                      0x04000000
       
   411 ++#define D_timestamp                  0x08000000
       
   412 ++#define D_tls                        0x10000000
       
   413 ++#define D_transport                  0x20000000
       
   414 ++#define D_uid                        0x40000000
       
   415 ++#define D_verify                     0x80000000
       
   416 + 
       
   417 + /* The D_all value must always have all bits set, as it is recognized specially
       
   418 + by the function that decodes debug and log selectors. This is to enable it to
       
   419 +@@ -515,21 +516,21 @@
       
   420 + #define RDO_INCLUDE      0x00000100  /* Forbid :include: */
       
   421 + #define RDO_LOG          0x00000200  /* Forbid "log" */
       
   422 + #define RDO_LOOKUP       0x00000400  /* Forbid "lookup" in expansion in filter */
       
   423 +-#define RDO_PERL         0x00000800  /* Forbid "perl" in expansion in filter */
       
   424 +-#define RDO_READFILE     0x00001000  /* Forbid "readfile" in exp in filter */
       
   425 +-#define RDO_READSOCK     0x00002000  /* Forbid "readsocket" in exp in filter */
       
   426 +-#define RDO_RUN          0x00004000  /* Forbid "run" in expansion in filter */
       
   427 +-#define RDO_DLFUNC       0x00008000  /* Forbid "dlfunc" in expansion in filter */
       
   428 +-#define RDO_REALLOG      0x00010000  /* Really do log (not testing/verifying) */
       
   429 +-#define RDO_REWRITE      0x00020000  /* Rewrite generated addresses */
       
   430 +-#define RDO_EXIM_FILTER  0x00040000  /* Forbid Exim filters */
       
   431 +-#define RDO_SIEVE_FILTER 0x00080000  /* Forbid Sieve filters */
       
   432 +-#define RDO_PREPEND_HOME 0x00100000  /* Prepend $home to relative paths in Exim filter save commands */
       
   433 +-
       
   434 ++#define RDO_MEMCACHE     0x00000800  /* Forbid "memcache" in expansion in filter */
       
   435 ++#define RDO_PERL         0x00001000  /* Forbid "perl" in expansion in filter */
       
   436 ++#define RDO_READFILE     0x00002000  /* Forbid "readfile" in exp in filter */
       
   437 ++#define RDO_READSOCK     0x00004000  /* Forbid "readsocket" in exp in filter */
       
   438 ++#define RDO_RUN          0x00008000  /* Forbid "run" in expansion in filter */
       
   439 ++#define RDO_DLFUNC       0x00010000  /* Forbid "dlfunc" in expansion in filter */
       
   440 ++#define RDO_REALLOG      0x00020000  /* Really do log (not testing/verifying) */
       
   441 ++#define RDO_REWRITE      0x00040000  /* Rewrite generated addresses */
       
   442 ++#define RDO_EXIM_FILTER  0x00080000  /* Forbid Exim filters */
       
   443 ++#define RDO_SIEVE_FILTER 0x00100000  /* Forbid Sieve filters */
       
   444 ++#define RDO_PREPEND_HOME 0x00200000  /* Prepend $home to relative paths in Exim filter save commands */
       
   445 + /* This is the set that apply to expansions in filters */
       
   446 + 
       
   447 + #define RDO_FILTER_EXPANSIONS \
       
   448 +-  (RDO_EXISTS|RDO_LOOKUP|RDO_PERL|RDO_READFILE|RDO_READSOCK|RDO_RUN|RDO_DLFUNC)
       
   449 ++  (RDO_EXISTS|RDO_LOOKUP|RDO_MEMCACHE|RDO_PERL|RDO_READFILE|RDO_READSOCK|RDO_RUN|RDO_DLFUNC)
       
   450 + 
       
   451 + /* As well as the RDO bits themselves, we need the bit numbers in order to
       
   452 + access (most of) the individual bits as separate options. This could be
       
   453 +@@ -537,8 +538,9 @@
       
   454 + 
       
   455 + enum { RDON_BLACKHOLE, RDON_DEFER, RDON_EACCES, RDON_ENOTDIR, RDON_EXISTS,
       
   456 +   RDON_FAIL, RDON_FILTER, RDON_FREEZE, RDON_INCLUDE, RDON_LOG, RDON_LOOKUP,
       
   457 +-  RDON_PERL, RDON_READFILE, RDON_READSOCK, RDON_RUN, RDON_DLFUNC, RDON_REALLOG,
       
   458 +-  RDON_REWRITE, RDON_EXIM_FILTER, RDON_SIEVE_FILTER, RDON_PREPEND_HOME };
       
   459 ++  RDON_MEMCACHE, RDON_PERL, RDON_READFILE, RDON_READSOCK, RDON_RUN,
       
   460 ++  RDON_DLFUNC, RDON_REALLOG, RDON_REWRITE, RDON_EXIM_FILTER, RDON_SIEVE_FILTER,
       
   461 ++  RDON_PREPEND_HOME };
       
   462 + 
       
   463 + /* Results of filter or forward file processing. Some are only from a filter;
       
   464 + some are only from a forward file. */
       
   465 +diff -r 6c0f7fa36c53 src/memcache.h
       
   466 +--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
   467 ++++ b/build-tree/src/memcache.h	Mon Aug 10 10:31:21 2009 +0200
       
   468 +@@ -0,0 +1,14 @@
       
   469 ++#ifndef MEMCACHE_H
       
   470 ++
       
   471 ++#define MEMCACHE_SERVERS_MAX 16
       
   472 ++#define MEMCACHE_OP_SET 0
       
   473 ++#define MEMCACHE_OP_GET 1
       
   474 ++
       
   475 ++/*
       
   476 ++extern void memcache_addhost(uschar *, uschar *, void *);
       
   477 ++*/
       
   478 ++/* host list */
       
   479 ++
       
   480 ++/* put declarations before */
       
   481 ++#define MEMCACHE_H
       
   482 ++#endif