mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-26 12:27:52 +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:
parent
9943ad2700
commit
e6088bcfe2
13
src/mail.c
13
src/mail.c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user