]> code.citadel.org Git - citadel.git/blobdiff - citadel/msgbase.c
* IMAP date strings. More stupidity.
[citadel.git] / citadel / msgbase.c
index d5cae708470e5727971a7ede9f73c32dc73c3ff1..2ef26071149cd0a162bebd24d2f2440b9f9c591e 100644 (file)
@@ -85,17 +85,18 @@ void remove_any_whitespace_to_the_left_or_right_of_at_symbol(char *name)
 {
        int i;
 
-       for (i = 0; i < strlen(name); ++i)
+stov:  for (i = 0; i < strlen(name); ++i) {
                if (name[i] == '@') {
                        if (i > 0)
                                if (isspace(name[i - 1])) {
                                        strcpy(&name[i - 1], &name[i]);
-                                       i = 0;
+                                       goto stov; /* start over */
                                }
                        while (isspace(name[i + 1])) {
                                strcpy(&name[i + 1], &name[i + 2]);
                        }
                }
+       }
 }
 
 
@@ -109,16 +110,13 @@ 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) {
@@ -135,7 +133,6 @@ int alias(char *name)
                if (!strcasecmp(name, aaa))
                        strcpy(name, bbb);
        }
-       TRACE;
        fclose(fp);
        lprintf(7, "Mail is being forwarded to %s\n", name);
 
@@ -150,18 +147,15 @@ 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;
@@ -181,7 +175,6 @@ 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]);
@@ -189,7 +182,6 @@ GETSN:              do {
                        goto GETSN;
                }
                fclose(fp);
-               TRACE;
                if (!strncmp(aaa, "uum", 3)) {
                        strcpy(bbb, name);
                        for (a = 0; a < strlen(bbb); ++a) {
@@ -223,7 +215,6 @@ GETSN:              do {
                }
                return (MES_ERROR);
        }
-       TRACE;
        lprintf(9, "returning MES_LOCAL\n");
        return (MES_LOCAL);
 }
@@ -976,8 +967,8 @@ int CtdlOutputMsg(long msg_num,             /* message number (local) to fetch */
                                else if (i == 'R')
                                        cprintf("To: %s%s", mptr, nl);
                                else if (i == 'T') {
-                                       generate_rfc822_datestamp(datestamp,
-                                                               atol(mptr) );
+                                       datestring(datestamp, atol(mptr),
+                                               DATESTRING_RFC822 );
                                        cprintf("Date: %s%s", datestamp, nl);
                                }
                        }
@@ -1201,7 +1192,7 @@ void cmd_opna(char *cmdbuf)
 {
        long msgid;
 
-       CtdlAllocUserData(SYM_DESIRED_SECTION, 64);
+       CtdlAllocUserData(SYM_DESIRED_SECTION, 256);
 
        msgid = extract_long(cmdbuf, 0);
        extract(desired_section, cmdbuf, 1);