Kordkandi
Kordkandi

Reputation: 149

How to escape white space charachter in imap command line?

My problem is that I want to login to yahoo imap server using my user/pass.
The problem is that my password contains a space charachter, so how do I escape it, i used '^]' but it did not work, this is the code:

$user = "[email protected]";
$pass = "hey you!";

Command:

 mohsen LOGIN ".$user." ".$pass

it gives this error,
mohsen BAD [CLIENTBUG] Invalid command or arguments

Thank you,

Upvotes: 0

Views: 1267

Answers (2)

Jan Kundrát
Jan Kundrát

Reputation: 3816

Read RFC3501 and find out the syntax for passing strings around. Take a look at what options you have available (atom, quoted-string, literal) and what implications for escaping/formatting they bring.

Why don't you use some IMAP library given that you apparently do not know the pretty low-level building blocks which IMAP consists of?

Upvotes: 2

Max
Max

Reputation: 10985

Just wrap them in quotes:

A LOGIN "[email protected]" "hey you!"

You don't have a closing quote in your example.

Upvotes: 3

Related Questions