+#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);
+ }
+ }
+#endif
+