]> code.citadel.org Git - citadel.git/blobdiff - citadel/msgbase.c
* Changed the comments at the beginning of each file to a consistent format
[citadel.git] / citadel / msgbase.c
index 8b3fac01db3de576cb7a2d8964caacddd3f78c09..086ca77e63b2aeaaf4d4fd49757677e714b630d6 100644 (file)
@@ -1,4 +1,9 @@
-/* $Id$ */
+/* 
+ * $Id$
+ *
+ * Implements the message store.
+ *
+ */
 
 #include "sysdep.h"
 #include <stdlib.h>
@@ -104,13 +109,16 @@ int alias(char *name)
        int a, b;
        char aaa[300], bbb[300];
 
+       TRACE;
        remove_any_whitespace_to_the_left_or_right_of_at_symbol(name);
+       TRACE;
 
        fp = fopen("network/mail.aliases", "r");
        if (fp == NULL)
                fp = fopen("/dev/null", "r");
        if (fp == NULL)
                return (MES_ERROR);
+       TRACE;
        strcpy(aaa, "");
        strcpy(bbb, "");
        while (fgets(aaa, sizeof aaa, fp) != NULL) {
@@ -127,6 +135,7 @@ int alias(char *name)
                if (!strcasecmp(name, aaa))
                        strcpy(name, bbb);
        }
+       TRACE;
        fclose(fp);
        lprintf(7, "Mail is being forwarded to %s\n", name);
 
@@ -141,15 +150,18 @@ int alias(char *name)
        }
 
        /* determine local or remote type, see citadel.h */
+       TRACE;
        for (a = 0; a < strlen(name); ++a)
                if (name[a] == '!')
                        return (MES_INTERNET);
+       TRACE;
        for (a = 0; a < strlen(name); ++a)
                if (name[a] == '@')
                        for (b = a; b < strlen(name); ++b)
                                if (name[b] == '.')
                                        return (MES_INTERNET);
        b = 0;
+       TRACE;
        for (a = 0; a < strlen(name); ++a)
                if (name[a] == '@')
                        ++b;
@@ -169,6 +181,7 @@ int alias(char *name)
 GETSN:         do {
                        a = getstring(fp, aaa);
                } while ((a >= 0) && (strcasecmp(aaa, bbb)));
+               TRACE;
                a = getstring(fp, aaa);
                if (!strncmp(aaa, "use ", 4)) {
                        strcpy(bbb, &aaa[4]);
@@ -176,6 +189,7 @@ GETSN:              do {
                        goto GETSN;
                }
                fclose(fp);
+               TRACE;
                if (!strncmp(aaa, "uum", 3)) {
                        strcpy(bbb, name);
                        for (a = 0; a < strlen(bbb); ++a) {
@@ -209,6 +223,7 @@ GETSN:              do {
                }
                return (MES_ERROR);
        }
+       TRACE;
        lprintf(9, "returning MES_LOCAL\n");
        return (MES_LOCAL);
 }