]> code.citadel.org Git - citadel.git/commitdiff
* use another buffer so we don't overwrite the mailfrom.
authorWilfried Göesgens <willi@citadel.org>
Wed, 18 Apr 2007 18:17:09 +0000 (18:17 +0000)
committerWilfried Göesgens <willi@citadel.org>
Wed, 18 Apr 2007 18:17:09 +0000 (18:17 +0000)
citadel/serv_smtp.c

index e8fcf69bc56074c294cfa13cc4a71149651e0bbb..56376305b09dceffdbbc2f95c22f30a01319de15 100644 (file)
@@ -1190,9 +1190,10 @@ void smtp_try(const char *key, const char *addr, int *status,
 
        /* Do an AUTH command if necessary */
        if (strlen(mx_user) > 0) {
+               char encoded[1024];
                sprintf(buf, "%s%c%s%c%s", mx_user, '\0', mx_user, '\0', mx_pass);
-               CtdlEncodeBase64(mailfrom, buf, strlen(mx_user) + strlen(mx_user) + strlen(mx_pass) + 2);
-               snprintf(buf, sizeof buf, "AUTH PLAIN %s\r\n", mailfrom);
+               CtdlEncodeBase64(encoded, buf, strlen(mx_user) + strlen(mx_user) + strlen(mx_pass) + 2);
+               snprintf(buf, sizeof buf, "AUTH PLAIN %s\r\n", encoded);
                lprintf(CTDL_DEBUG, ">%s", buf);
                sock_write(sock, buf, strlen(buf));
                if (ml_sock_gets(sock, buf) < 0) {