masqmail

diff src/address.c @ 242:bc9d9cd9ee8e

made addr_isequal() and addr_isequal_parent() more flexible refactored various bits of this stuff. addr_isequal_alias() had become needless now and was removed. In fail_msg.c: postmaster is now matched caseless, like required by RFC.
author markus schnalke <meillo@marmaro.de>
date Mon, 25 Oct 2010 17:42:48 -0300
parents 4a3bc3a7afbe
children 55b7bde95d37
line diff
     1.1 --- a/src/address.c	Mon Oct 25 15:41:48 2010 -0300
     1.2 +++ b/src/address.c	Mon Oct 25 17:42:48 2010 -0300
     1.3 @@ -102,20 +102,20 @@
     1.4  }
     1.5  
     1.6  gboolean
     1.7 -addr_isequal(address * addr1, address * addr2)
     1.8 +addr_isequal(address * addr1, address * addr2, int (*cmpfunc) (const char*, const char*))
     1.9  {
    1.10 -	return (strcmp(addr1->local_part, addr2->local_part) == 0)
    1.11 +	return (cmpfunc(addr1->local_part, addr2->local_part) == 0)
    1.12  	       && (strcasecmp(addr1->domain, addr2->domain) == 0);
    1.13  }
    1.14  
    1.15  /* searches in ancestors of addr1 */
    1.16  gboolean
    1.17 -addr_isequal_parent(address * addr1, address * addr2)
    1.18 +addr_isequal_parent(address* addr1, address* addr2, int (*cmpfunc) (const char*, const char*))
    1.19  {
    1.20  	address *addr;
    1.21  
    1.22  	for (addr = addr1; addr; addr = addr->parent)
    1.23 -		if (addr_isequal(addr, addr2))
    1.24 +		if (addr_isequal(addr, addr2, cmpfunc))
    1.25  			return TRUE;
    1.26  
    1.27  	return FALSE;