From bad715ecb7e094dfcf98cf896013ffeea53bb6a0 Mon Sep 17 00:00:00 2001 From: pfelt Date: Thu, 1 Nov 2007 05:29:33 +0000 Subject: [PATCH] -- this is alex's work on suggesting fixes to the aliasing. user level aliasing now takes precedence over domain level aliasing. -- also a minor fix for user level aliasing checking --- src/agents/queue/queued.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/agents/queue/queued.c b/src/agents/queue/queued.c index ae8e638..2b3dcba 100644 --- a/src/agents/queue/queued.c +++ b/src/agents/queue/queued.c @@ -147,14 +147,8 @@ BOOL aliasing(Connection *conn, char *addr, int *cnt) { i = BongoArrayFindSorted(Conf.aliasList, domain, (ArrayCompareFunc)aliasFindFunc); if (i > -1) { a = BongoArrayIndex(Conf.aliasList, struct _AliasStruct, i); - /* if there is a to domain use that instead */ - if (a.to) { - MemFree(domain); - domain = MemStrdup(a.to); - } - /* now i need to see if there is an alias for local within this domain */ - if (a.aliases) { + if (a.aliases && a.aliases->len) { i = BongoArrayFindSorted(a.aliases, local, (ArrayCompareFunc)aliasFindFunc); if (i > -1) { /* there is an alias for this local. recurse, as the destination might not be local */ @@ -162,6 +156,11 @@ BOOL aliasing(Connection *conn, char *addr, int *cnt) { b = BongoArrayIndex(a.aliases, struct _AliasStruct, i); result = aliasing(conn, b.to, cnt); } + } else if (a.to && a.to[0] != '\0') { + // this domain is aliased to another domain. + char new_addr[1000]; + snprintf(new_addr, 999, "%s@%s", local, a.to); + result = aliasing(conn, new_addr, cnt); } /* we haven't already handled this address during the recursion. it must be local */