diff --git a/exec/imapservice.js b/exec/imapservice.js
index 6b7ce3b279c41be030486216915d5c1e625bc95a..2aa3ec7cdd933d88589ec2e5bf5fbf6188baf606 100644
--- a/exec/imapservice.js
+++ b/exec/imapservice.js
@@ -716,6 +716,9 @@ function parse_command(line)
 				ret=client.socket.recv(len);
 				line=client.socket.recvline(10240, 1800);
 			}
+			else {
+				line = undefined;
+			}
 			return(ret);
 		}