Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 58282
Collapse All | Expand All

(-)exim-4.50/src/deliver.c (-4 / +21 lines)
Lines 859-864 Link Here
859
859
860
  if ((log_extra_selector & LX_sender_on_delivery) != 0)
860
  if ((log_extra_selector & LX_sender_on_delivery) != 0)
861
    s = string_append(s, &size, &ptr, 3, US" F=<", sender_address, US">");
861
    s = string_append(s, &size, &ptr, 3, US" F=<", sender_address, US">");
862
    
863
  #ifdef EXPERIMENTAL_SRS
864
  if(addr->p.srs_sender)
865
    s = string_append(s, &size, &ptr, 3, US" SRS=<", addr->p.srs_sender, US">");
866
  #endif
862
867
863
  /* You might think that the return path must always be set for a successful
868
  /* You might think that the return path must always be set for a successful
864
  delivery; indeed, I did for some time, until this statement crashed. The case
869
  delivery; indeed, I did for some time, until this statement crashed. The case
Lines 1516-1523 Link Here
1516
/* Set up the return path from the errors or sender address. If the transport
1521
/* Set up the return path from the errors or sender address. If the transport
1517
has its own return path setting, expand it and replace the existing value. */
1522
has its own return path setting, expand it and replace the existing value. */
1518
1523
1519
return_path = (addr->p.errors_address != NULL)?
1524
if(addr->p.errors_address != NULL)
1520
  addr->p.errors_address : sender_address;
1525
  return_path = addr->p.errors_address;
1526
#ifdef EXPERIMENTAL_SRS
1527
else if(addr->p.srs_sender != NULL)
1528
  return_path = addr->p.srs_sender;
1529
#endif
1530
else
1531
  return_path = sender_address;
1521
1532
1522
if (tp->return_path != NULL)
1533
if (tp->return_path != NULL)
1523
  {
1534
  {
Lines 3505-3512 Link Here
3505
  /* Compute the return path, expanding a new one if required. The old one
3516
  /* Compute the return path, expanding a new one if required. The old one
3506
  must be set first, as it might be referred to in the expansion. */
3517
  must be set first, as it might be referred to in the expansion. */
3507
3518
3508
  return_path = (addr->p.errors_address != NULL)?
3519
  if(addr->p.errors_address != NULL)
3509
    addr->p.errors_address : sender_address;
3520
    return_path = addr->p.errors_address;
3521
#ifdef EXPERIMENTAL_SRS
3522
  else if(addr->p.srs_sender != NULL)
3523
    return_path = addr->p.srs_sender;
3524
#endif
3525
  else
3526
    return_path = sender_address;
3510
3527
3511
  if (tp->return_path != NULL)
3528
  if (tp->return_path != NULL)
3512
    {
3529
    {
(-)exim-4.50/src/globals.c (+9 lines)
Lines 279-284 Link Here
279
    NULL,               /* errors_address */
279
    NULL,               /* errors_address */
280
    NULL,               /* extra_headers */
280
    NULL,               /* extra_headers */
281
    NULL,               /* remove_headers */
281
    NULL,               /* remove_headers */
282
#ifdef EXPERIMENTAL_SRS
283
    NULL,               /* srs_sender */
284
#endif
282
  }
285
  }
283
};
286
};
284
287
Lines 1031-1040 Link Here
1031
uschar *srs_config             = NULL;
1034
uschar *srs_config             = NULL;
1032
uschar *srs_db_address         = NULL;
1035
uschar *srs_db_address         = NULL;
1033
uschar *srs_db_key             = NULL;
1036
uschar *srs_db_key             = NULL;
1037
int     srs_hashlength         = 6;
1038
int     srs_hashmin            = -1;
1039
int     srs_maxage             = 31;
1034
uschar *srs_orig_recipient     = NULL;
1040
uschar *srs_orig_recipient     = NULL;
1035
uschar *srs_orig_sender        = NULL;
1041
uschar *srs_orig_sender        = NULL;
1036
uschar *srs_recipient          = NULL;
1042
uschar *srs_recipient          = NULL;
1043
uschar *srs_secrets            = NULL;
1037
uschar *srs_status             = NULL;
1044
uschar *srs_status             = NULL;
1045
BOOL    srs_usehash            = TRUE;
1046
BOOL    srs_usetimestamp       = TRUE;
1038
#endif
1047
#endif
1039
int     string_datestamp_offset= -1;
1048
int     string_datestamp_offset= -1;
1040
BOOL    strip_excess_angle_brackets = FALSE;
1049
BOOL    strip_excess_angle_brackets = FALSE;
(-)exim-4.50/src/globals.h (+6 lines)
Lines 634-643 Link Here
634
extern uschar *srs_config;             /* SRS config secret:max age:hash length:use timestamp:use hash */
634
extern uschar *srs_config;             /* SRS config secret:max age:hash length:use timestamp:use hash */
635
extern uschar *srs_db_address;         /* SRS db address */
635
extern uschar *srs_db_address;         /* SRS db address */
636
extern uschar *srs_db_key;             /* SRS db key */
636
extern uschar *srs_db_key;             /* SRS db key */
637
extern int     srs_hashlength;         /* SRS hash length */
638
extern int     srs_hashmin;            /* SRS minimum hash length */
639
extern int     srs_maxage;             /* SRS max age */
637
extern uschar *srs_orig_sender;        /* SRS original sender */
640
extern uschar *srs_orig_sender;        /* SRS original sender */
638
extern uschar *srs_orig_recipient;     /* SRS original recipient */
641
extern uschar *srs_orig_recipient;     /* SRS original recipient */
639
extern uschar *srs_recipient;          /* SRS recipient */
642
extern uschar *srs_recipient;          /* SRS recipient */
643
extern uschar *srs_secrets;            /* SRS secrets list */
640
extern uschar *srs_status;             /* SRS staus */
644
extern uschar *srs_status;             /* SRS staus */
645
extern BOOL    srs_usehash;            /* SRS use hash flag */
646
extern BOOL    srs_usetimestamp;       /* SRS use timestamp flag */
641
#endif
647
#endif
642
extern int     string_datestamp_offset;/* After insertion by string_format */
648
extern int     string_datestamp_offset;/* After insertion by string_format */
643
extern BOOL    strip_excess_angle_brackets; /* Surrounding route-addrs */
649
extern BOOL    strip_excess_angle_brackets; /* Surrounding route-addrs */
(-)exim-4.50/src/readconf.c (+6 lines)
Lines 334-339 Link Here
334
  { "spool_directory",          opt_stringptr,   &spool_directory },
334
  { "spool_directory",          opt_stringptr,   &spool_directory },
335
#ifdef EXPERIMENTAL_SRS
335
#ifdef EXPERIMENTAL_SRS
336
  { "srs_config",               opt_stringptr,   &srs_config },
336
  { "srs_config",               opt_stringptr,   &srs_config },
337
  { "srs_hashlength",           opt_int,         &srs_hashlength },
338
  { "srs_hashmin",              opt_int,         &srs_hashmin },
339
  { "srs_maxage",               opt_int,         &srs_maxage },
340
  { "srs_secrets",              opt_stringptr,   &srs_secrets },
341
  { "srs_usehash",              opt_bool,        &srs_usehash },
342
  { "srs_usetimestamp",         opt_bool,        &srs_usetimestamp },
337
#endif
343
#endif
338
  { "strip_excess_angle_brackets", opt_bool,     &strip_excess_angle_brackets },
344
  { "strip_excess_angle_brackets", opt_bool,     &strip_excess_angle_brackets },
339
  { "strip_trailing_dot",       opt_bool,        &strip_trailing_dot },
345
  { "strip_trailing_dot",       opt_bool,        &strip_trailing_dot },
(-)exim-4.50/src/routers/redirect.c (-48 / +78 lines)
Lines 108-115 Link Here
108
      (void *)offsetof(redirect_router_options_block, srs_alias) },
108
      (void *)offsetof(redirect_router_options_block, srs_alias) },
109
  { "srs_condition",      opt_stringptr,
109
  { "srs_condition",      opt_stringptr,
110
      (void *)offsetof(redirect_router_options_block, srs_condition) },
110
      (void *)offsetof(redirect_router_options_block, srs_condition) },
111
  { "srs_db",             opt_stringptr,
111
  { "srs_dbinsert",       opt_stringptr,
112
      (void *)offsetof(redirect_router_options_block, srs_db) },
112
      (void *)offsetof(redirect_router_options_block, srs_dbinsert) },
113
  { "srs_dbselect",       opt_stringptr,
114
      (void *)offsetof(redirect_router_options_block, srs_dbselect) },
113
#endif
115
#endif
114
  { "syntax_errors_text", opt_stringptr,
116
  { "syntax_errors_text", opt_stringptr,
115
      (void *)offsetof(redirect_router_options_block, syntax_errors_text) },
117
      (void *)offsetof(redirect_router_options_block, syntax_errors_text) },
Lines 146-154 Link Here
146
  NULL,        /* owngroups */
148
  NULL,        /* owngroups */
147
#ifdef EXPERIMENTAL_SRS
149
#ifdef EXPERIMENTAL_SRS
148
  NULL,        /* srs */
150
  NULL,        /* srs */
149
  NULL,        /* srs_condition */
150
  NULL,        /* srs_db */
151
  NULL,        /* srs_alias */
151
  NULL,        /* srs_alias */
152
  NULL,        /* srs_condition */
153
  NULL,        /* srs_dbinsert */
154
  NULL,        /* srs_dbselect */
152
#endif
155
#endif
153
  022,         /* modemask */
156
  022,         /* modemask */
154
  RDO_REWRITE, /* bit_options */
157
  RDO_REWRITE, /* bit_options */
Lines 517-522 Link Here
517
addr_prop.extra_headers = NULL;
520
addr_prop.extra_headers = NULL;
518
addr_prop.remove_headers = NULL;
521
addr_prop.remove_headers = NULL;
519
522
523
#ifdef EXPERIMENTAL_SRS
524
addr_prop.srs_sender = NULL;
525
#endif
526
520
/* When verifying and testing addresses, the "logwrite" command in filters
527
/* When verifying and testing addresses, the "logwrite" command in filters
521
must be bypassed. */
528
must be bypassed. */
522
529
Lines 543-550 Link Here
543
  }
550
  }
544
551
545
#ifdef EXPERIMENTAL_SRS
552
#ifdef EXPERIMENTAL_SRS
546
  /* For reverse SRS, fill the srs_recipient expandsion variable,
553
  /* Perform SRS on recipient/return-path as required  */
547
  on failure, return decline/fail as relevant */
554
  
548
  if(ob->srs != NULL)
555
  if(ob->srs != NULL)
549
  {
556
  {
550
    BOOL usesrs = TRUE;
557
    BOOL usesrs = TRUE;
Lines 553-574 Link Here
553
      usesrs = expand_check_condition(ob->srs_condition, "srs_condition expansion failed", NULL);
560
      usesrs = expand_check_condition(ob->srs_condition, "srs_condition expansion failed", NULL);
554
561
555
    if(usesrs)
562
    if(usesrs)
556
      if(Ustrcmp(ob->srs, "reverse") == 0 || Ustrcmp(ob->srs, "reverseandforward") == 0)
563
    {
564
      int srs_action, n_srs;
565
      uschar *res;
566
      uschar *usedomain;
567
568
      /* What are we doing? */      
569
      if(Ustrcmp(ob->srs, "forward") == 0)
570
        srs_action = 1;
571
      else if(Ustrcmp(ob->srs, "reverseandforward") == 0)
557
      {
572
      {
558
        uschar *res;
573
        srs_action = 3;
559
        int n_srs;
560
574
575
        if((ob->srs_dbinsert == NULL) ^ (ob->srs_dbselect == NULL))
576
          return DEFER;
577
      }
578
      else if(Ustrcmp(ob->srs, "reverse") == 0)
579
        srs_action = 2;
580
      
581
      /* Reverse SRS */
582
      if(srs_action & 2)
583
      {
561
        srs_orig_recipient = addr->address;
584
        srs_orig_recipient = addr->address;
585
        
562
        eximsrs_init();
586
        eximsrs_init();
563
        if(ob->srs_db)
587
        if(ob->srs_dbselect)
564
          eximsrs_db_set(TRUE, ob->srs_db);
588
          eximsrs_db_set(TRUE, ob->srs_dbselect);
565
        if((n_srs = eximsrs_reverse(&res, addr->address)) != OK)
589
// Comment this out for now...
590
//        else
591
//          eximsrs_db_set(TRUE, NULL);
592
          
593
        if((n_srs = eximsrs_reverse(&res, addr->address)) == OK)
594
        {
595
          srs_recipient = res;
596
          DEBUG(D_any)
597
            debug_printf("SRS (reverse): Recipient '%s' rewritten to '%s'\n", srs_orig_recipient, srs_recipient);
598
        }
599
        
600
        eximsrs_done();
601
        
602
        if(n_srs != OK)
566
          return n_srs;
603
          return n_srs;
567
        srs_recipient = res;
604
      }
605
606
      /* Forward SRS */
607
      /* No point in actually performing SRS if we are just verifying a recipient */
608
      if((srs_action & 1) && !verify && (sender_address ? sender_address[0] != 0 : FALSE))
609
      {
610
611
        srs_orig_sender = sender_address;
612
        eximsrs_init();
613
        if(ob->srs_dbinsert)
614
          eximsrs_db_set(FALSE, ob->srs_dbinsert);
615
// Comment this out for now...
616
//        else
617
//          eximsrs_db_set(FALSE, NULL);
618
619
        if(ob->srs_alias != NULL ? (usedomain = expand_string(ob->srs_alias)) == NULL : 1)
620
          usedomain = deliver_domain;
621
622
        if((n_srs = eximsrs_forward(&res, sender_address, usedomain)) == OK)
623
        {
624
          addr_prop.srs_sender = res;
625
          DEBUG(D_any)
626
            debug_printf("SRS (forward): Sender '%s' rewritten to '%s'\n", srs_orig_sender, res);
627
        }
628
        
568
        eximsrs_done();
629
        eximsrs_done();
569
        DEBUG(D_any)
630
        
570
          debug_printf("SRS: Recipient '%s' rewritten to '%s'\n", srs_orig_recipient, srs_recipient);
631
        if(n_srs != OK)
632
          return n_srs;
571
      }
633
      }
634
    }
572
  }
635
  }
573
#endif
636
#endif
574
637
Lines 795-833 Link Here
795
    (addr_prop.errors_address != NULL)? "\n" : "");
858
    (addr_prop.errors_address != NULL)? "\n" : "");
796
  }
859
  }
797
860
798
#ifdef EXPERIMENTAL_SRS
799
  /* On successful redirection, check for SRS forwarding and adjust sender */
800
  if(ob->srs != NULL)
801
  {
802
    BOOL usesrs = TRUE;
803
804
    if(ob->srs_condition != NULL)
805
      usesrs = expand_check_condition(ob->srs_condition, "srs_condition expansion failed", NULL);
806
807
    if(usesrs)
808
      if((Ustrcmp(ob->srs, "forward") == 0 || Ustrcmp(ob->srs, "reverseandforward") == 0) && !verify)
809
      {
810
        uschar *res;
811
        uschar *usedomain;
812
        int n_srs;
813
814
        srs_orig_sender = sender_address;
815
        eximsrs_init();
816
        if(ob->srs_db)
817
          eximsrs_db_set(FALSE, ob->srs_db);
818
819
        if(ob->srs_alias != NULL ? (usedomain = expand_string(ob->srs_alias)) == NULL : 1)
820
          usedomain = deliver_domain;
821
822
        if((n_srs = eximsrs_forward(&res, sender_address, usedomain)) != OK)
823
          return n_srs;
824
        sender_address = res;
825
        DEBUG(D_any)
826
          debug_printf("SRS: Sender '%s' rewritten to '%s'\n", srs_orig_sender, sender_address);
827
    }
828
  }
829
#endif
830
831
/* Control gets here only when the address has been completely handled. Put the
861
/* Control gets here only when the address has been completely handled. Put the
832
original address onto the succeed queue so that any retry items that get
862
original address onto the succeed queue so that any retry items that get
833
attached to it get processed. */
863
attached to it get processed. */
(-)exim-4.50/src/routers/redirect.h (-2 / +3 lines)
Lines 35-43 Link Here
35
35
36
#ifdef EXPERIMENTAL_SRS
36
#ifdef EXPERIMENTAL_SRS
37
  uschar *srs;
37
  uschar *srs;
38
  uschar *srs_condition;
39
  uschar *srs_db;
40
  uschar *srs_alias;
38
  uschar *srs_alias;
39
  uschar *srs_condition;
40
  uschar *srs_dbinsert;
41
  uschar *srs_dbselect;
41
#endif
42
#endif
42
43
43
  int   modemask;
44
  int   modemask;
(-)exim-4.50/src/srs.c (-39 / +63 lines)
Lines 1-11 Link Here
1
/* $Cambridge: exim/exim-src/src/srs.c,v 1.4 2005/02/17 11:58:26 ph10 Exp $ */
2
3
/*************************************************
1
/*************************************************
4
*     Exim - an Internet mail transport agent    *
2
*     Exim - an Internet mail transport agent    *
5
*************************************************/
3
*************************************************/
6
4
7
/* SRS - Sender rewriting scheme support
5
/* SRS - Sender rewriting scheme support
8
  ©2004 Miles Wilton <miles@mirtol.com>
6
  (C)2004 Miles Wilton <miles@mirtol.com>
7
8
  SRS Support Version: 1.0
9
9
  License: GPL */
10
  License: GPL */
10
11
11
#include "exim.h"
12
#include "exim.h"
Lines 24-95 Link Here
24
25
25
int eximsrs_init()
26
int eximsrs_init()
26
{
27
{
27
  int co;
28
  uschar *list = srs_config;
28
  uschar *list = srs_config;
29
  char secret_buf[SRS_MAX_SECRET_LENGTH];
29
  char secret_buf[SRS_MAX_SECRET_LENGTH];
30
  char *secret;
30
  char *secret;
31
  char sbuf[4];
31
  char sbuf[4];
32
  char *sbufp;
32
  char *sbufp;
33
  int hashlen, maxage;
34
35
33
34
  // Check if this instance of Exim has not initialized SRS
36
  if(!srs)
35
  if(!srs)
37
  {
36
  {
38
    /* Check config */
37
    int co = 0;
39
    if(!srs_config)
38
    int hashlen, maxage;
39
    BOOL usetimestamp, usehash;
40
41
    /* Copy config vars */
42
    hashlen = srs_hashlength;
43
    maxage = srs_maxage;
44
    usetimestamp = srs_usetimestamp;
45
    usehash = srs_usehash;
46
47
    /* Pass srs_config var (overrides new config vars) */
48
    co = 0;
49
    if(srs_config)
40
    {
50
    {
41
      log_write(0, LOG_MAIN | LOG_PANIC,
51
      secret = string_nextinlist(&list, &co, secret_buf, SRS_MAX_SECRET_LENGTH);
42
          "SRS Configuration Error");
52
43
      return DEFER;
53
      if((sbufp = string_nextinlist(&list, &co, sbuf, sizeof(sbuf))) != NULL)
54
        maxage = atoi(sbuf);
55
56
      if((sbufp = string_nextinlist(&list, &co, sbuf, sizeof(sbuf))) != NULL)
57
        hashlen = atoi(sbuf);
58
59
      if((sbufp = string_nextinlist(&list, &co, sbuf, sizeof(sbuf))) != NULL)
60
        usetimestamp = atoi(sbuf);
61
62
      if((sbufp = string_nextinlist(&list, &co, sbuf, sizeof(sbuf))) != NULL)
63
        usehash = atoi(sbuf);
44
    }
64
    }
65
    
66
    if(srs_hashmin == -1)
67
      srs_hashmin = hashlen;
45
68
46
    /* Get config */
69
    /* First secret specified in secrets? */
47
    co = 0;
70
    co = 0;
48
    if((secret = string_nextinlist(&list, &co, secret_buf,
71
    list = srs_secrets;
49
                                   SRS_MAX_SECRET_LENGTH)) == NULL)
72
    if(secret == NULL)
50
    {
73
    {
51
      log_write(0, LOG_MAIN | LOG_PANIC,
74
      if((secret = string_nextinlist(&list, &co, secret_buf, SRS_MAX_SECRET_LENGTH)) == NULL)
52
          "SRS Configuration Error: No secret specified");
75
      {
53
      return DEFER;
76
        log_write(0, LOG_MAIN | LOG_PANIC,
77
            "SRS Configuration Error: No secret specified");
78
        return DEFER;
79
      }
54
    }
80
    }
55
81
   
56
    if((sbufp = string_nextinlist(&list, &co, sbuf, sizeof(sbuf))) == NULL)
82
    /* Check config */
57
      maxage = 31;
58
    else
59
      maxage = atoi(sbuf);
60
    if(maxage < 0 || maxage > 365)
83
    if(maxage < 0 || maxage > 365)
61
    {
84
    {
62
      log_write(0, LOG_MAIN | LOG_PANIC,
85
      log_write(0, LOG_MAIN | LOG_PANIC,
63
          "SRS Configuration Error: Invalid maximum timestamp age");
86
          "SRS Configuration Error: Invalid maximum timestamp age");
64
      return DEFER;
87
      return DEFER;
65
    }
88
    }
66
89
    if(hashlen < 1 || hashlen > 20 || srs_hashmin < 1 || srs_hashmin > 20)
67
    if((sbufp = string_nextinlist(&list, &co, sbuf, sizeof(sbuf))) == NULL)
68
      hashlen = 6;
69
    else
70
      hashlen = atoi(sbuf);
71
    if(hashlen < 1 || hashlen > 20)
72
    {
90
    {
73
      log_write(0, LOG_MAIN | LOG_PANIC,
91
      log_write(0, LOG_MAIN | LOG_PANIC,
74
          "SRS Configuration Error: Invalid hash length");
92
          "SRS Configuration Error: Invalid hash length");
75
      return DEFER;
93
      return DEFER;
76
    }
94
    }
77
95
78
79
    if((srs = srs_open(secret, strnlen(secret, SRS_MAX_SECRET_LENGTH),
96
    if((srs = srs_open(secret, strnlen(secret, SRS_MAX_SECRET_LENGTH),
80
                      maxage, hashlen, hashlen)) == NULL)
97
                        maxage, hashlen, srs_hashmin)) == NULL)
81
    {
98
    {
82
      log_write(0, LOG_MAIN | LOG_PANIC,
99
      log_write(0, LOG_MAIN | LOG_PANIC,
83
          "Failed to allocate SRS memory");
100
          "Failed to allocate SRS memory");
84
      return DEFER;
101
      return DEFER;
85
    }
102
    }
86
103
104
    srs_set_option(srs, SRS_OPTION_USETIMESTAMP, usetimestamp);
105
    srs_set_option(srs, SRS_OPTION_USEHASH, usehash);
87
106
88
    if((sbufp = string_nextinlist(&list, &co, sbuf, sizeof(sbuf))) != NULL)
107
    /* Extra secrets? */
89
      srs_set_option(srs, SRS_OPTION_USETIMESTAMP, atoi(sbuf));
108
    while((secret = string_nextinlist(&list, &co, secret_buf, SRS_MAX_SECRET_LENGTH)) != NULL)
90
109
        srs_add_secret(srs, secret, strnlen(secret, SRS_MAX_SECRET_LENGTH));
91
    if((sbufp = string_nextinlist(&list, &co, sbuf, sizeof(sbuf))) != NULL)
92
      srs_set_option(srs, SRS_OPTION_USEHASH, atoi(sbuf));
93
110
94
    DEBUG(D_any)
111
    DEBUG(D_any)
95
      debug_printf("SRS initialized\n");
112
      debug_printf("SRS initialized\n");
Lines 151-161 Link Here
151
int eximsrs_db_set(BOOL reverse, uschar *srs_db)
168
int eximsrs_db_set(BOOL reverse, uschar *srs_db)
152
{
169
{
153
  if(reverse)
170
  if(reverse)
154
    srs_db_reverse = string_copy(srs_db);
171
    srs_db_reverse = (srs_db == NULL ? NULL : string_copy(srs_db));
155
  else
172
  else
156
    srs_db_forward = string_copy(srs_db);
173
    srs_db_forward = (srs_db == NULL ? NULL : string_copy(srs_db));
157
174
158
  if(srs_set_db_functions(srs, eximsrs_db_insert, eximsrs_db_lookup) * SRS_RESULT_FAIL)
175
  if(srs_set_db_functions(srs, (srs_db_forward ? eximsrs_db_insert : NULL),
176
                               (srs_db_reverse ? eximsrs_db_lookup : NULL)) & SRS_RESULT_FAIL)
159
    return DEFER;
177
    return DEFER;
160
178
161
  return OK;
179
  return OK;
Lines 167-175 Link Here
167
  uschar *res;
185
  uschar *res;
168
  char buf[64];
186
  char buf[64];
169
187
188
  if(!srs_db_forward)
189
    return SRS_RESULT_DBERROR;
190
170
  srs_db_address = string_copyn(data, data_len);
191
  srs_db_address = string_copyn(data, data_len);
171
  if(srs_generate_unique_id(srs, srs_db_address, buf, 64) & SRS_RESULT_FAIL)
192
  if(srs_generate_unique_id(srs, srs_db_address, buf, 64) & SRS_RESULT_FAIL)
172
    return DEFER;
193
    return SRS_RESULT_DBERROR;
173
194
174
  srs_db_key = string_copyn(buf, 16);
195
  srs_db_key = string_copyn(buf, 16);
175
196
Lines 188-193 Link Here
188
srs_result eximsrs_db_lookup(srs_t *srs, char *data, uint data_len, char *result, uint result_len)
209
srs_result eximsrs_db_lookup(srs_t *srs, char *data, uint data_len, char *result, uint result_len)
189
{
210
{
190
  uschar *res;
211
  uschar *res;
212
  
213
  if(!srs_db_reverse)
214
    return SRS_RESULT_DBERROR;
191
215
192
  srs_db_key = string_copyn(data, data_len);
216
  srs_db_key = string_copyn(data, data_len);
193
  if((res = expand_string(srs_db_reverse)) == NULL)
217
  if((res = expand_string(srs_db_reverse)) == NULL)
(-)exim-4.50/src/structs.h (-1 / +5 lines)
Lines 469-474 Link Here
469
  uschar *errors_address;         /* where to send errors (NULL => sender) */
469
  uschar *errors_address;         /* where to send errors (NULL => sender) */
470
  header_line *extra_headers;     /* additional headers */
470
  header_line *extra_headers;     /* additional headers */
471
  uschar *remove_headers;         /* list of those to remove */
471
  uschar *remove_headers;         /* list of those to remove */
472
473
  #ifdef EXPERIMENTAL_SRS
474
  uschar *srs_sender;             /* Change return path when delivering */
475
  #endif
472
} address_item_propagated;
476
} address_item_propagated;
473
477
474
/* Bits for the flags field below */
478
/* Bits for the flags field below */
Lines 551-557 Link Here
551
  uschar *cipher;                 /* Cipher used for transport */
555
  uschar *cipher;                 /* Cipher used for transport */
552
  uschar *peerdn;                 /* DN of server's certificate */
556
  uschar *peerdn;                 /* DN of server's certificate */
553
  #endif
557
  #endif
554
558
  
555
  uid_t   uid;                    /* uid for transporting */
559
  uid_t   uid;                    /* uid for transporting */
556
  gid_t   gid;                    /* gid for transporting */
560
  gid_t   gid;                    /* gid for transporting */
557
561
(-)exim-4.50/src/verify.c (+4 lines)
Lines 1228-1233 Link Here
1228
    addr_list = addr->next;
1228
    addr_list = addr->next;
1229
1229
1230
    fprintf(f, "%s", CS addr->address);
1230
    fprintf(f, "%s", CS addr->address);
1231
#ifdef EXPERIMENTAL_SRS
1232
    if(addr->p.srs_sender)
1233
      fprintf(f, "    [srs = %s]", addr->p.srs_sender);
1234
#endif
1231
    while (p != NULL)
1235
    while (p != NULL)
1232
      {
1236
      {
1233
      fprintf(f, "\n    <-- %s", p->address);
1237
      fprintf(f, "\n    <-- %s", p->address);

Return to bug 58282