aboutsummaryrefslogtreecommitdiff
path: root/mail/exim
diff options
context:
space:
mode:
authorKirill Ponomarev <krion@FreeBSD.org>2005-07-27 09:17:29 +0000
committerKirill Ponomarev <krion@FreeBSD.org>2005-07-27 09:17:29 +0000
commit2878cc16914f4095e1a0ba1e4bc4b7b254011123 (patch)
tree982d3bdea44bf61b42475e93929f0853bb29f82d /mail/exim
parentba126dafe65a04e24153cf3c9f1a04fb6a5d014a (diff)
downloadports-2878cc16914f4095e1a0ba1e4bc4b7b254011123.tar.gz
ports-2878cc16914f4095e1a0ba1e4bc4b7b254011123.zip
Notes
Diffstat (limited to 'mail/exim')
-rw-r--r--mail/exim/Makefile2
-rw-r--r--mail/exim/distinfo4
-rw-r--r--mail/exim/files/patch-OS::Makefile-FreeBSD14
-rw-r--r--mail/exim/files/patch-doc::spec.txt19
-rw-r--r--mail/exim/files/patch-src_globals.c13
-rw-r--r--mail/exim/files/patch-src_globals.h18
-rw-r--r--mail/exim/files/patch-src_readconf.c13
-rw-r--r--mail/exim/files/patch-src_routers_redirect.c175
-rw-r--r--mail/exim/files/patch-src_routers_redirect.h7
-rw-r--r--mail/exim/files/patch-src_srs.c127
-rw-r--r--mail/exim/files/patch-src_srs.h2
11 files changed, 237 insertions, 157 deletions
diff --git a/mail/exim/Makefile b/mail/exim/Makefile
index b06126caf1c8..bb3a77a22ae0 100644
--- a/mail/exim/Makefile
+++ b/mail/exim/Makefile
@@ -28,7 +28,7 @@ MASTER_SITE_SUBDIR+= sa-exim/:sa_exim
DISTFILES+= sa-exim-${SA_EXIM_VERSION}.tar.gz:sa_exim
.endif
-EXIM_VERSION= 4.51
+EXIM_VERSION= 4.52
SA_EXIM_VERSION=4.2
IGNOREFILES= FAQ.txt.bz2
diff --git a/mail/exim/distinfo b/mail/exim/distinfo
index 00f32549144d..9da9135f2b55 100644
--- a/mail/exim/distinfo
+++ b/mail/exim/distinfo
@@ -1,5 +1,5 @@
-MD5 (exim/exim-4.51.tar.bz2) = 36c0c005e012d13beb7edfd8d124c049
-SIZE (exim/exim-4.51.tar.bz2) = 1462114
+MD5 (exim/exim-4.52.tar.bz2) = 89601650f3b854d469451f30b369622b
+SIZE (exim/exim-4.52.tar.bz2) = 1535866
MD5 (exim/sa-exim-4.2.tar.gz) = ad76f73c6b3d01caa88078e3e622745a
SIZE (exim/sa-exim-4.2.tar.gz) = 66575
MD5 (exim/FAQ.txt.bz2) = IGNORE
diff --git a/mail/exim/files/patch-OS::Makefile-FreeBSD b/mail/exim/files/patch-OS::Makefile-FreeBSD
index b5f198f0c177..bbbc0209a3ee 100644
--- a/mail/exim/files/patch-OS::Makefile-FreeBSD
+++ b/mail/exim/files/patch-OS::Makefile-FreeBSD
@@ -1,6 +1,9 @@
---- OS/Makefile-FreeBSD.orig Tue Aug 12 17:39:51 2003
-+++ OS/Makefile-FreeBSD Thu Aug 14 12:10:46 2003
-@@ -5,11 +5,12 @@
+
+$FreeBSD$
+
+--- OS/Makefile-FreeBSD.orig
++++ OS/Makefile-FreeBSD
+@@ -7,6 +7,7 @@
PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aout
CHOWN_COMMAND=/usr/sbin/chown
@@ -8,8 +11,3 @@
HAVE_SA_LEN=YES
- # crypt() is in a separate library
- LIBS=-lcrypt
-
- # FreeBSD always ships with Berkeley DB
- USE_DB=yes
diff --git a/mail/exim/files/patch-doc::spec.txt b/mail/exim/files/patch-doc::spec.txt
index 0c7d97e9d11e..28281ec779a9 100644
--- a/mail/exim/files/patch-doc::spec.txt
+++ b/mail/exim/files/patch-doc::spec.txt
@@ -1,8 +1,11 @@
---- doc/spec.txt.orig Wed May 5 12:08:37 2004
-+++ doc/spec.txt Wed May 5 15:10:17 2004
-@@ -14962,6 +14962,19 @@
- message_prefix = "\1\1\1\1\n"
- message_suffix = "\1\1\1\1\n"
+
+$FreeBSD$
+
+--- doc/spec.txt.orig
++++ doc/spec.txt
+@@ -15622,6 +15622,19 @@
+ message_prefix = "\1\1\1\1\n"
+ message_suffix = "\1\1\1\1\n"
+However, many clients require that the certificate presented by Exim be a user
+(also called "leaf" or "site") certificate, and not a self-signed certificate.
@@ -17,6 +20,6 @@
+
+ http://ospkibook.sourceforge.net/
+
-
- create_directory Type: boolean Default: true
-
+ +-----------------------------------------------------------------------------+
+ |create_directory | Use: appendfile | Type: boolean | Default: true|
+ +-----------------------------------------------------------------------------+
diff --git a/mail/exim/files/patch-src_globals.c b/mail/exim/files/patch-src_globals.c
index 914e28e718c2..2b2bbbb397a0 100644
--- a/mail/exim/files/patch-src_globals.c
+++ b/mail/exim/files/patch-src_globals.c
@@ -3,7 +3,7 @@ $FreeBSD$
--- src/globals.c.orig
+++ src/globals.c
-@@ -1028,9 +1028,12 @@
+@@ -1056,9 +1056,7 @@
uschar *spool_directory = US SPOOL_DIRECTORY
"\0<--------------Space to patch spool_directory->";
#ifdef EXPERIMENTAL_SRS
@@ -11,11 +11,6 @@ $FreeBSD$
-uschar *srs_db_address = NULL;
-uschar *srs_db_key = NULL;
+BOOL srs_alwaysrewrite = FALSE;
-+int srs_hashlength = -1;
-+int srs_hashmin = -1;
-+int srs_maxage = -1;
-+uschar *srs_secrets = NULL;
-+uschar *srs_separator = NULL;
- uschar *srs_orig_recipient = NULL;
- uschar *srs_orig_sender = NULL;
- uschar *srs_recipient = NULL;
+ int srs_hashlength = 6;
+ int srs_hashmin = -1;
+ int srs_maxage = 31;
diff --git a/mail/exim/files/patch-src_globals.h b/mail/exim/files/patch-src_globals.h
index 76519037157b..07857d01ffd3 100644
--- a/mail/exim/files/patch-src_globals.h
+++ b/mail/exim/files/patch-src_globals.h
@@ -3,7 +3,7 @@ $FreeBSD$
--- src/globals.h.orig
+++ src/globals.h
-@@ -631,13 +631,16 @@
+@@ -659,9 +659,7 @@
extern BOOL split_spool_directory; /* TRUE to use multiple subdirs */
extern uschar *spool_directory; /* Name of spool directory */
#ifdef EXPERIMENTAL_SRS
@@ -11,16 +11,6 @@ $FreeBSD$
-extern uschar *srs_db_address; /* SRS db address */
-extern uschar *srs_db_key; /* SRS db key */
+extern BOOL srs_alwaysrewrite; /* Rewrite for all domains */
-+extern int srs_hashlength; /* Hash length to generate */
-+extern int srs_hashmin; /* Hash length to check */
-+extern int srs_maxage; /* Max age for SRS address */
-+extern uschar *srs_secrets; /* List of SRS secrets */
-+extern uschar *srs_separator; /* Separator for SRS addresses */
- extern uschar *srs_orig_sender; /* SRS original sender */
- extern uschar *srs_orig_recipient; /* SRS original recipient */
- extern uschar *srs_recipient; /* SRS recipient */
--extern uschar *srs_status; /* SRS staus */
-+extern uschar *srs_status; /* SRS status */
- #endif
- extern int string_datestamp_offset;/* After insertion by string_format */
- extern BOOL strip_excess_angle_brackets; /* Surrounding route-addrs */
+ extern int srs_hashlength; /* SRS hash length */
+ extern int srs_hashmin; /* SRS minimum hash length */
+ extern int srs_maxage; /* SRS max age */
diff --git a/mail/exim/files/patch-src_readconf.c b/mail/exim/files/patch-src_readconf.c
index ae494ae8d8bc..a630c8023e95 100644
--- a/mail/exim/files/patch-src_readconf.c
+++ b/mail/exim/files/patch-src_readconf.c
@@ -3,17 +3,12 @@ $FreeBSD$
--- src/readconf.c.orig
+++ src/readconf.c
-@@ -333,7 +333,12 @@
+@@ -340,7 +340,7 @@
{ "split_spool_directory", opt_bool, &split_spool_directory },
{ "spool_directory", opt_stringptr, &spool_directory },
#ifdef EXPERIMENTAL_SRS
- { "srs_config", opt_stringptr, &srs_config },
+ { "srs_alwaysrewrite", opt_bool, &srs_alwaysrewrite },
-+ { "srs_hashlength", opt_int, &srs_hashlength },
-+ { "srs_hashmin", opt_int, &srs_hashmin },
-+ { "srs_maxage", opt_int, &srs_maxage },
-+ { "srs_secrets", opt_stringptr, &srs_secrets },
-+ { "srs_separator", opt_stringptr, &srs_separator },
- #endif
- { "strip_excess_angle_brackets", opt_bool, &strip_excess_angle_brackets },
- { "strip_trailing_dot", opt_bool, &strip_trailing_dot },
+ { "srs_hashlength", opt_int, &srs_hashlength },
+ { "srs_hashmin", opt_int, &srs_hashmin },
+ { "srs_maxage", opt_int, &srs_maxage },
diff --git a/mail/exim/files/patch-src_routers_redirect.c b/mail/exim/files/patch-src_routers_redirect.c
index 8013f2929410..35ea407059ce 100644
--- a/mail/exim/files/patch-src_routers_redirect.c
+++ b/mail/exim/files/patch-src_routers_redirect.c
@@ -3,7 +3,13 @@ $FreeBSD$
--- src/routers/redirect.c.orig
+++ src/routers/redirect.c
-@@ -104,12 +104,6 @@
+@@ -1,4 +1,4 @@
+-/* $Cambridge: exim/exim-src/src/routers/redirect.c,v 1.13 2005/06/27 15:11:04 tom Exp $ */
++/* $Cambridge: exim/exim-src/src/routers/redirect.c,v 1.10 2005/04/28 13:06:32 ph10 Exp $ */
+
+ /*************************************************
+ * Exim - an Internet mail transport agent *
+@@ -108,14 +108,6 @@
#ifdef EXPERIMENTAL_SRS
{ "srs", opt_stringptr,
(void *)offsetof(redirect_router_options_block, srs) },
@@ -11,26 +17,44 @@ $FreeBSD$
- (void *)offsetof(redirect_router_options_block, srs_alias) },
- { "srs_condition", opt_stringptr,
- (void *)offsetof(redirect_router_options_block, srs_condition) },
-- { "srs_db", opt_stringptr,
-- (void *)offsetof(redirect_router_options_block, srs_db) },
+- { "srs_dbinsert", opt_stringptr,
+- (void *)offsetof(redirect_router_options_block, srs_dbinsert) },
+- { "srs_dbselect", opt_stringptr,
+- (void *)offsetof(redirect_router_options_block, srs_dbselect) },
#endif
{ "syntax_errors_text", opt_stringptr,
(void *)offsetof(redirect_router_options_block, syntax_errors_text) },
-@@ -146,9 +140,6 @@
+@@ -154,10 +146,6 @@
NULL, /* owngroups */
#ifdef EXPERIMENTAL_SRS
NULL, /* srs */
-- NULL, /* srs_condition */
-- NULL, /* srs_db */
- NULL, /* srs_alias */
+- NULL, /* srs_condition */
+- NULL, /* srs_dbinsert */
+- NULL, /* srs_dbselect */
#endif
022, /* modemask */
RDO_REWRITE, /* bit_options */
-@@ -545,30 +536,26 @@
+@@ -532,10 +520,6 @@
+ addr_prop.extra_headers = NULL;
+ addr_prop.remove_headers = NULL;
+
+-#ifdef EXPERIMENTAL_SRS
+-addr_prop.srs_sender = NULL;
+-#endif
+-
+ /* When verifying and testing addresses, the "logwrite" command in filters
+ must be bypassed. */
+
+@@ -562,90 +546,28 @@
+ }
+
#ifdef EXPERIMENTAL_SRS
- /* For reverse SRS, fill the srs_recipient expandsion variable,
- on failure, return decline/fail as relevant */
+- /* Perform SRS on recipient/return-path as required */
+-
- if(ob->srs != NULL)
++ /* For reverse SRS, fill the srs_recipient expandsion variable,
++ on failure, return decline/fail as relevant */
+if(ob->srs != NULL)
{
- BOOL usesrs = TRUE;
@@ -39,28 +63,85 @@ $FreeBSD$
- usesrs = expand_check_condition(ob->srs_condition, "srs_condition expansion failed", NULL);
-
- if(usesrs)
-- if(Ustrcmp(ob->srs, "reverse") == 0 || Ustrcmp(ob->srs, "reverseandforward") == 0)
-- {
-- uschar *res;
-- int n_srs;
+ if (Ustrcmp(ob->srs, "reverse") == 0 || Ustrcmp(ob->srs, "reverseandforward") == 0)
-+ {
+ {
+- int srs_action = 0, n_srs;
+- uschar *res;
+- uschar *usedomain;
+-
+- /* What are we doing? */
+- if(Ustrcmp(ob->srs, "forward") == 0)
+- srs_action = 1;
+- else if(Ustrcmp(ob->srs, "reverseandforward") == 0)
+- {
+- srs_action = 3;
+-
+- if((ob->srs_dbinsert == NULL) ^ (ob->srs_dbselect == NULL))
+- return DEFER;
+- }
+- else if(Ustrcmp(ob->srs, "reverse") == 0)
+- srs_action = 2;
+-
+- /* Reverse SRS */
+- if(srs_action & 2)
+- {
+- srs_orig_recipient = addr->address;
+-
+- eximsrs_init();
+- if(ob->srs_dbselect)
+- eximsrs_db_set(TRUE, ob->srs_dbselect);
+-/* Comment this out for now...
+-// else
+-// eximsrs_db_set(TRUE, NULL);
+-*/
+-
+- if((n_srs = eximsrs_reverse(&res, addr->address)) == OK)
+- {
+- srs_recipient = res;
+- DEBUG(D_any)
+- debug_printf("SRS (reverse): Recipient '%s' rewritten to '%s'\n", srs_orig_recipient, srs_recipient);
+- }
+-
+- eximsrs_done();
+-
+- if(n_srs != OK)
+- return n_srs;
+- }
+-
+- /* Forward SRS */
+- /* No point in actually performing SRS if we are just verifying a recipient */
+- if((srs_action & 1) && !verify && (sender_address ? sender_address[0] != 0 : FALSE))
+- {
+-
+- srs_orig_sender = sender_address;
+- eximsrs_init();
+- if(ob->srs_dbinsert)
+- eximsrs_db_set(FALSE, ob->srs_dbinsert);
+-/* Comment this out for now...
+-// else
+-// eximsrs_db_set(FALSE, NULL);
+-*/
+-
+- if(ob->srs_alias != NULL ? (usedomain = expand_string(ob->srs_alias)) == NULL : 1)
+- usedomain = deliver_domain;
+-
+- if((n_srs = eximsrs_forward(&res, sender_address, usedomain)) == OK)
+- {
+- addr_prop.srs_sender = res;
+- DEBUG(D_any)
+- debug_printf("SRS (forward): Sender '%s' rewritten to '%s'\n", srs_orig_sender, res);
+- }
+-
+- eximsrs_done();
+ uschar *res;
+ int ret;
+ DEBUG(D_route)
+ debug_printf("SRS: (Forward) \n");
-- srs_orig_recipient = addr->address;
-- eximsrs_init();
-- if(ob->srs_db)
-- eximsrs_db_set(TRUE, ob->srs_db);
-- if((n_srs = eximsrs_reverse(&res, addr->address)) != OK)
+- if(n_srs != OK)
- return n_srs;
-- srs_recipient = res;
-- eximsrs_done();
-- DEBUG(D_any)
-- debug_printf("SRS: Recipient '%s' rewritten to '%s'\n", srs_orig_recipient, srs_recipient);
- }
+- }
+ srs_orig_recipient = addr->address;
+ eximsrs_init();
+ ret = eximsrs_reverse(&res, addr->address);
@@ -75,38 +156,15 @@ $FreeBSD$
}
#endif
-@@ -797,33 +784,23 @@
-
- #ifdef EXPERIMENTAL_SRS
- /* On successful redirection, check for SRS forwarding and adjust sender */
-- if(ob->srs != NULL)
+@@ -877,6 +799,29 @@
+ (addr_prop.errors_address != NULL)? addr_prop.errors_address : US"",
+ (addr_prop.errors_address != NULL)? "\n" : "");
+ }
++
++#ifdef EXPERIMENTAL_SRS
++ /* On successful redirection, check for SRS forwarding and adjust sender */
+if(ob->srs != NULL)
- {
-- BOOL usesrs = TRUE;
--
-- if(ob->srs_condition != NULL)
-- usesrs = expand_check_condition(ob->srs_condition, "srs_condition expansion failed", NULL);
--
-- if(usesrs)
-- if((Ustrcmp(ob->srs, "forward") == 0 || Ustrcmp(ob->srs, "reverseandforward") == 0) && !verify)
-- {
-- uschar *res;
-- uschar *usedomain;
-- int n_srs;
--
-- srs_orig_sender = sender_address;
-- eximsrs_init();
-- if(ob->srs_db)
-- eximsrs_db_set(FALSE, ob->srs_db);
--
-- if(ob->srs_alias != NULL ? (usedomain = expand_string(ob->srs_alias)) == NULL : 1)
-- usedomain = deliver_domain;
--
-- if((n_srs = eximsrs_forward(&res, sender_address, usedomain)) != OK)
-- return n_srs;
-- sender_address = res;
-- DEBUG(D_any)
-- debug_printf("SRS: Sender '%s' rewritten to '%s'\n", srs_orig_sender, sender_address);
++ {
+ if ((Ustrcmp(ob->srs, "forward") == 0 || Ustrcmp(ob->srs, "reverseandforward") == 0) && !verify )
+ {
+ uschar *res;
@@ -122,6 +180,9 @@ $FreeBSD$
+ DEBUG(D_route)
+ debug_printf("SRS: Sender '%s' rewritten to '%s'\n",
+ srs_orig_sender, sender_address);
- }
- }
- #endif
++ }
++ }
++#endif
+
+ /* Control gets here only when the address has been completely handled. Put the
+ original address onto the succeed queue so that any retry items that get
diff --git a/mail/exim/files/patch-src_routers_redirect.h b/mail/exim/files/patch-src_routers_redirect.h
index 38c653a5803f..7138438236ec 100644
--- a/mail/exim/files/patch-src_routers_redirect.h
+++ b/mail/exim/files/patch-src_routers_redirect.h
@@ -3,13 +3,14 @@ $FreeBSD$
--- src/routers/redirect.h.orig
+++ src/routers/redirect.h
-@@ -35,9 +35,6 @@
+@@ -37,10 +37,6 @@
#ifdef EXPERIMENTAL_SRS
uschar *srs;
-- uschar *srs_condition;
-- uschar *srs_db;
- uschar *srs_alias;
+- uschar *srs_condition;
+- uschar *srs_dbinsert;
+- uschar *srs_dbselect;
#endif
int modemask;
diff --git a/mail/exim/files/patch-src_srs.c b/mail/exim/files/patch-src_srs.c
index 34d92e4c897f..430010abe716 100644
--- a/mail/exim/files/patch-src_srs.c
+++ b/mail/exim/files/patch-src_srs.c
@@ -3,7 +3,22 @@ $FreeBSD$
--- src/srs.c.orig
+++ src/srs.c
-@@ -11,196 +11,116 @@
+@@ -1,231 +1,126 @@
+-/* $Cambridge: exim/exim-src/src/srs.c,v 1.8 2005/06/27 18:10:30 tom Exp $ */
++/* $Cambridge: exim/exim-src/src/srs.c,v 1.4 2005/02/17 11:58:26 ph10 Exp $ */
+
+ /*************************************************
+ * Exim - an Internet mail transport agent *
+ *************************************************/
+
+ /* SRS - Sender rewriting scheme support
+- (C)2004 Miles Wilton <miles@mirtol.com>
+-
+- SRS Support Version: 1.0a
+-
++ ©2004 Miles Wilton <miles@mirtol.com>
+ License: GPL */
+
#include "exim.h"
#ifdef EXPERIMENTAL_SRS
@@ -28,72 +43,87 @@ $FreeBSD$
-int eximsrs_init()
-{
-- int co;
- uschar *list = srs_config;
-- char secret_buf[SRS_MAX_SECRET_LENGTH];
-- char *secret;
-- char sbuf[4];
-- char *sbufp;
-- int hashlen, maxage;
--
+- uschar secret_buf[SRS_MAX_SECRET_LENGTH];
+- uschar *secret = NULL;
+- uschar sbuf[4];
+- uschar *sbufp;
-
-- if(!srs)
+- /* Check if this instance of Exim has not initialized SRS */
+- if(srs == NULL)
- {
-- /* Check config */
-- if(!srs_config)
+- int co = 0;
+- int hashlen, maxage;
+- BOOL usetimestamp, usehash;
+-
+- /* Copy config vars */
+- hashlen = srs_hashlength;
+- maxage = srs_maxage;
+- usetimestamp = srs_usetimestamp;
+- usehash = srs_usehash;
+-
+- /* Pass srs_config var (overrides new config vars) */
+- co = 0;
+- if(srs_config != NULL)
- {
-- log_write(0, LOG_MAIN | LOG_PANIC,
-- "SRS Configuration Error");
-- return DEFER;
+- secret = string_nextinlist(&list, &co, secret_buf, SRS_MAX_SECRET_LENGTH);
+-
+- if((sbufp = string_nextinlist(&list, &co, sbuf, sizeof(sbuf))) != NULL)
+- maxage = atoi(sbuf);
+-
+- if((sbufp = string_nextinlist(&list, &co, sbuf, sizeof(sbuf))) != NULL)
+- hashlen = atoi(sbuf);
+-
+- if((sbufp = string_nextinlist(&list, &co, sbuf, sizeof(sbuf))) != NULL)
+- usetimestamp = atoi(sbuf);
+-
+- if((sbufp = string_nextinlist(&list, &co, sbuf, sizeof(sbuf))) != NULL)
+- usehash = atoi(sbuf);
- }
-
-- /* Get config */
+- if(srs_hashmin == -1)
+- srs_hashmin = hashlen;
+-
+- /* First secret specified in secrets? */
- co = 0;
-- if((secret = string_nextinlist(&list, &co, secret_buf,
-- SRS_MAX_SECRET_LENGTH)) == NULL)
+- list = srs_secrets;
+- if(secret == NULL || *secret == '\0')
- {
-- log_write(0, LOG_MAIN | LOG_PANIC,
-- "SRS Configuration Error: No secret specified");
-- return DEFER;
+- if((secret = string_nextinlist(&list, &co, secret_buf, SRS_MAX_SECRET_LENGTH)) == NULL)
+- {
+- log_write(0, LOG_MAIN | LOG_PANIC,
+- "SRS Configuration Error: No secret specified");
+- return DEFER;
+- }
- }
-
-- if((sbufp = string_nextinlist(&list, &co, sbuf, sizeof(sbuf))) == NULL)
-- maxage = 31;
-- else
-- maxage = atoi(sbuf);
+- /* Check config */
- if(maxage < 0 || maxage > 365)
- {
- log_write(0, LOG_MAIN | LOG_PANIC,
- "SRS Configuration Error: Invalid maximum timestamp age");
- return DEFER;
- }
--
-- if((sbufp = string_nextinlist(&list, &co, sbuf, sizeof(sbuf))) == NULL)
-- hashlen = 6;
-- else
-- hashlen = atoi(sbuf);
-- if(hashlen < 1 || hashlen > 20)
+- if(hashlen < 1 || hashlen > 20 || srs_hashmin < 1 || srs_hashmin > 20)
- {
- log_write(0, LOG_MAIN | LOG_PANIC,
- "SRS Configuration Error: Invalid hash length");
- return DEFER;
- }
-
--
-- if((srs = srs_open(secret, strnlen(secret, SRS_MAX_SECRET_LENGTH),
-- maxage, hashlen, hashlen)) == NULL)
+- if((srs = srs_open(secret, Ustrlen(secret), maxage, hashlen, srs_hashmin)) == NULL)
- {
- log_write(0, LOG_MAIN | LOG_PANIC,
- "Failed to allocate SRS memory");
- return DEFER;
- }
-
+- srs_set_option(srs, SRS_OPTION_USETIMESTAMP, usetimestamp);
+- srs_set_option(srs, SRS_OPTION_USEHASH, usehash);
-
-- if((sbufp = string_nextinlist(&list, &co, sbuf, sizeof(sbuf))) != NULL)
-- srs_set_option(srs, SRS_OPTION_USETIMESTAMP, atoi(sbuf));
--
-- if((sbufp = string_nextinlist(&list, &co, sbuf, sizeof(sbuf))) != NULL)
-- srs_set_option(srs, SRS_OPTION_USEHASH, atoi(sbuf));
+- /* Extra secrets? */
+- while((secret = string_nextinlist(&list, &co, secret_buf, SRS_MAX_SECRET_LENGTH)) != NULL)
+- srs_add_secret(srs, secret, (Ustrlen(secret) > SRS_MAX_SECRET_LENGTH) ? SRS_MAX_SECRET_LENGTH : Ustrlen(secret));
-
- DEBUG(D_any)
- debug_printf("SRS initialized\n");
@@ -107,7 +137,7 @@ $FreeBSD$
+int
+eximsrs_init()
{
-- if(srs)
+- if(srs != NULL)
- srs_close(srs);
-
- srs = NULL;
@@ -190,11 +220,12 @@ $FreeBSD$
+eximsrs_done()
{
- if(reverse)
-- srs_db_reverse = string_copy(srs_db);
+- srs_db_reverse = (srs_db == NULL ? NULL : string_copy(srs_db));
- else
-- srs_db_forward = string_copy(srs_db);
+- srs_db_forward = (srs_db == NULL ? NULL : string_copy(srs_db));
-
-- if(srs_set_db_functions(srs, eximsrs_db_insert, eximsrs_db_lookup) * SRS_RESULT_FAIL)
+- if(srs_set_db_functions(srs, (srs_db_forward ? eximsrs_db_insert : NULL),
+- (srs_db_reverse ? eximsrs_db_lookup : NULL)) & SRS_RESULT_FAIL)
- return DEFER;
-
- return OK;
@@ -210,11 +241,14 @@ $FreeBSD$
+eximsrs_forward(uschar **result, uschar *sender, uschar *domain)
{
- uschar *res;
-- char buf[64];
+- uschar buf[64];
+-
+- if(srs_db_forward == NULL)
+- return SRS_RESULT_DBERROR;
-
- srs_db_address = string_copyn(data, data_len);
- if(srs_generate_unique_id(srs, srs_db_address, buf, 64) & SRS_RESULT_FAIL)
-- return DEFER;
+- return SRS_RESULT_DBERROR;
-
- srs_db_key = string_copyn(buf, 16);
-
@@ -226,7 +260,7 @@ $FreeBSD$
+ char res[1024];
+ int ret;
-- strncpy(result, srs_db_key, result_len);
+- Ustrncpy(result, srs_db_key, result_len);
+ ret = srs_forward(srs, res, sizeof(res), sender, domain);
+ if (ret != SRS_SUCCESS) {
+ DEBUG(D_any)
@@ -247,6 +281,9 @@ $FreeBSD$
{
- uschar *res;
-
+- if(srs_db_reverse == NULL)
+- return SRS_RESULT_DBERROR;
+-
- srs_db_key = string_copyn(data, data_len);
- if((res = expand_string(srs_db_reverse)) == NULL)
- return SRS_RESULT_DBERROR;
diff --git a/mail/exim/files/patch-src_srs.h b/mail/exim/files/patch-src_srs.h
index 890cfc7c5edf..a40755249d89 100644
--- a/mail/exim/files/patch-src_srs.h
+++ b/mail/exim/files/patch-src_srs.h
@@ -20,7 +20,7 @@ $FreeBSD$
int eximsrs_done();
int eximsrs_forward(uschar **result, uschar *orig_sender, uschar *domain);
int eximsrs_reverse(uschar **result, uschar *address);
--int eximsrs_db(BOOL reverse, uschar *srs_db);
+-int eximsrs_db_set(BOOL reverse, uschar *srs_db);
-
-srs_result eximsrs_db_insert(srs_t *srs, char *data, uint data_len, char *result, uint result_len);
-srs_result eximsrs_db_lookup(srs_t *srs, char *data, uint data_len, char *result, uint result_len);