-/* $Cambridge: exim/src/src/routers/redirect.c,v 1.11 2005/05/24 08:15:02 tom Exp $ */
+/* $Cambridge: exim/src/src/routers/redirect.c,v 1.15 2006/02/07 11:19:02 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) University of Cambridge 1995 - 2005 */
+/* Copyright (c) University of Cambridge 1995 - 2006 */
/* See the file NOTICE for conditions of use and distribution. */
Arguments:
rblock the router control block
addr the address being routed
- verify true if verifying
+ verify v_none/v_recipient/v_sender/v_expn
addr_prop point to the propagated block, which is where the
new values are to be placed
static int
sort_errors_and_headers(router_instance *rblock, address_item *addr,
- BOOL verify, address_item_propagated *addr_prop)
+ int verify, address_item_propagated *addr_prop)
{
int frc = rf_get_errors_address(addr, rblock, verify,
&(addr_prop->errors_address));
router_instance *rblock, /* data for this instantiation */
address_item *addr, /* address we are working on */
struct passwd *pw, /* passwd entry after check_local_user */
- BOOL verify, /* TRUE when verifying */
+ int verify, /* v_none/v_recipient/v_sender/v_expn */
address_item **addr_local, /* add it to this if it's local */
address_item **addr_remote, /* add it to this if it's remote */
address_item **addr_new, /* put new addresses on here */
/* When verifying and testing addresses, the "logwrite" command in filters
must be bypassed. */
-if (!verify && !address_test_mode) options |= RDO_REALLOG;
+if (verify == v_none && !address_test_mode) options |= RDO_REALLOG;
/* Sort out the fixed or dynamic uid/gid. This uid is used (a) for reading the
file (and interpreting a filter) and (b) for running the transports for
if(usesrs)
{
- int srs_action, n_srs;
+ int srs_action = 0, n_srs;
uschar *res;
uschar *usedomain;
eximsrs_init();
if(ob->srs_dbselect)
eximsrs_db_set(TRUE, ob->srs_dbselect);
-// Comment this out for now...
+/* Comment this out for now...
// else
// eximsrs_db_set(TRUE, NULL);
+*/
if((n_srs = eximsrs_reverse(&res, addr->address)) == OK)
{
/* 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))
+ if((srs_action & 1) && verify == v_none &&
+ (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...
+/* 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 (eblock != NULL)
{
if (!moan_skipped_syntax_errors(
- rblock->name, /* For message content */
- eblock, /* Ditto */
- (verify || address_test_mode)?
- NULL : ob->syntax_errors_to, /* Who to mail */
- generated != NULL, /* True if not all failed */
- ob->syntax_errors_text)) /* Custom message */
+ rblock->name, /* For message content */
+ eblock, /* Ditto */
+ (verify != v_none || address_test_mode)?
+ NULL : ob->syntax_errors_to, /* Who to mail */
+ generated != NULL, /* True if not all failed */
+ ob->syntax_errors_text)) /* Custom message */
return DEFER;
if (filtertype != FILTER_FORWARD || generated == NULL)
if (frc == FF_DELIVERED)
{
- if (generated == NULL && !verify && !address_test_mode)
+ if (generated == NULL && verify == v_none && !address_test_mode)
{
log_write(0, LOG_MAIN, "=> %s <%s> R=%s", discarded, addr->address,
rblock->name);