1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-26 04:17:33 +00:00

Support imap passwords with strange characters (sf.net #3402448)

conky now sends the password using the length + string format, which should not need any quoting
of special characters. Hopefully, we won't find a server which does not support this encoding.

bug reported by Brent
This commit is contained in:
Pavel Labath 2011-09-16 21:56:05 +02:00
parent 9943ad2700
commit e6088bcfe2

View File

@ -745,11 +745,14 @@ static void *imap_thread(void *arg)
has_idle = 1;
}
strncpy(sendbuf, "a1 login ", MAXDATASIZE);
strncat(sendbuf, mail->user, MAXDATASIZE - strlen(sendbuf) - 1);
strncat(sendbuf, " ", MAXDATASIZE - strlen(sendbuf) - 1);
strncat(sendbuf, mail->pass, MAXDATASIZE - strlen(sendbuf) - 1);
strncat(sendbuf, "\r\n", MAXDATASIZE - strlen(sendbuf) - 1);
snprintf(sendbuf, sizeof sendbuf, "a1 login %s {%d}\r\n",
mail->user, strlen(mail->pass));
if (imap_command(sockfd, sendbuf, recvbuf, "+ OK")) {
fail++;
break;
}
snprintf(sendbuf, sizeof sendbuf, "%s\r\n", mail->pass);
if (imap_command(sockfd, sendbuf, recvbuf, "a1 OK")) {
fail++;
break;