* Finished most of the work for the Global Address Book.
authorArt Cancro <ajc@citadel.org>
Fri, 11 Jan 2002 04:59:01 +0000 (04:59 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 11 Jan 2002 04:59:01 +0000 (04:59 +0000)
citadel/ChangeLog
citadel/internet_addressing.c
citadel/msgbase.c
citadel/serv_smtp.c

index b42f4f9546f908b80a429c8c626348dea24c233b..d684d783ddb9cec3d540c15972e8536d34a2ea15 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 590.56  2002/01/11 04:59:00  ajc
+ * Finished most of the work for the Global Address Book.
+
  Revision 590.55  2002/01/11 04:37:03  ajc
  * More code for the Global Address Book
 
@@ -3133,4 +3136,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
-
index 4b803096c697db6c76fba1f587a49ac42714c2ac..f836319462234e09b11987b3899cbb4385489c4b 100644 (file)
@@ -654,6 +654,8 @@ void directory_key(char *key, char *addr) {
                }
        }
        key[keylen++] = 0;
+
+       lprintf(9, "Directory key is <%s>\n", key);
 }
 
 
@@ -669,11 +671,14 @@ int IsDirectory(char *addr) {
        striplt(domain);
 
        h = CtdlHostAlias(domain);
+       lprintf(9, "IsDirectory(%s)\n", domain);
 
        if ( (h == hostalias_localhost) || (h == hostalias_directory) ) {
+               lprintf(9, " ...yes\n");
                return(1);
        }
        else {
+               lprintf(9, " ...no\n");
                return(0);
        }
 }
@@ -724,6 +729,8 @@ int CtdlDirectoryLookup(char *target, char *internet_addr) {
        struct cdbdata *cdbrec;
        char key[SIZ];
 
+       lprintf(9, "CtdlDirectoryLookup(%s)\n", internet_addr);
+
        if (IsDirectory(internet_addr) == 0) return(-1);
 
        directory_key(key, internet_addr);
@@ -731,8 +738,10 @@ int CtdlDirectoryLookup(char *target, char *internet_addr) {
        if (cdbrec != NULL) {
                safestrncpy(target, cdbrec->ptr, SIZ);
                cdb_free(cdbrec);
+               lprintf(9, "Looked up as <%s>\n", target);
                return(0);
        }
 
+       lprintf(9, "Lookup failed\n");
        return(-1);
 }
index f13e75aac6fda049f025e04f5da6ed6769c3a758..3996618a83a171dab058ce764d0152fa9730f81d 100644 (file)
@@ -158,6 +158,12 @@ int alias(char *name)
                        strcpy(name, bbb);
        }
        fclose(fp);
+
+       /* Hit the Global Address Book */
+       if (CtdlDirectoryLookup(aaa, name) == 0) {
+               strcpy(name, aaa);
+       }
+
        lprintf(7, "Mail is being forwarded to %s\n", name);
 
        /* Change "user @ xxx" to "user" if xxx is an alias for this host */
@@ -170,11 +176,6 @@ int alias(char *name)
                }
        }
 
-       /* Hit the Global Address Book */
-       if (CtdlDirectoryLookup(aaa, name) == 0) {
-               strcpy(name, aaa);
-       }
-
        /* determine local or remote type, see citadel.h */
        at = haschar(name, '@');
        if (at == 0) return(MES_LOCAL);         /* no @'s - local address */
index b904208ed87b26b6b40537addca84d51c1898048..045d78a2dce82e8995b6d840cf9bf66df742120e 100644 (file)
@@ -414,8 +414,8 @@ void smtp_rcpt(char *argbuf) {
 
        strcpy(recp, &argbuf[3]);
        striplt(recp);
+       stripallbut(recp, '<', '>');
        alias(recp);
-
        cvt = convert_internet_address(user, node, recp);
        snprintf(recp, sizeof recp, "%s@%s", user, node);
        lprintf(9, "cvt=%d, citaddr=<%s@%s>\n", cvt, user, node);