about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-12-22 21:42:15 -0500
committerJune McEnroe <june@causal.agency>2019-12-22 21:42:15 -0500
commit76ccd798143333a9c2cdc4dd1c2c0b6032aa7389 (patch)
tree021ca7340a9be28a3e5547fe1351c33bfcb827d0
parentUse sequence numbers rather than UIDs (diff)
downloadimbox-76ccd798143333a9c2cdc4dd1c2c0b6032aa7389.tar.gz
imbox-76ccd798143333a9c2cdc4dd1c2c0b6032aa7389.zip
Quote user, pass and mailbox
Diffstat (limited to '')
-rw-r--r--imbox.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/imbox.c b/imbox.c
index bdc8a16..eb611a2 100644
--- a/imbox.c
+++ b/imbox.c
@@ -308,11 +308,14 @@ int main(int argc, char *argv[]) {
 		switch (tag) {
 			break; case Untagged: {
 				if (login) break;
-				fprintf(imap, "%s LOGIN %s %s\r\n", Atoms[Login], user, pass);
+				fprintf(
+					imap, "%s LOGIN \"%s\" \"%s\"\r\n",
+					Atoms[Login], user, pass
+				);
 				login = true;
 			}
 			break; case Login: {
-				fprintf(imap, "%s EXAMINE %s\r\n", Atoms[Examine], mailbox);
+				fprintf(imap, "%s EXAMINE \"%s\"\r\n", Atoms[Examine], mailbox);
 			}
 			break; case Examine: {
 				fprintf(imap, "%s SEARCH CHARSET UTF-8", Atoms[Search]);