diff -ruN dbmail-20030527/dbmailtypes.h dbmail-20030527-apop-statemachine-fix/dbmailtypes.h
--- dbmail-20030527/dbmailtypes.h	2003-05-23 00:38:10.000000000 -0600
+++ dbmail-20030527-apop-statemachine-fix/dbmailtypes.h	2003-05-27 08:56:22.000000000 -0600
@@ -58,7 +58,7 @@
 {
 	int error_count;		/* how many errors have occured? */
 	int state; 			/* what is the current pop state */
-	int cmdtype; 			/* index into commands array of last command issued */
+	int was_apop; 			/* session was apop (no plaintext password) */
 
 	int SessionResult;		/* what happened during the session */
 	
diff -ruN dbmail-20030527/pop3.c dbmail-20030527-apop-statemachine-fix/pop3.c
--- dbmail-20030527/pop3.c	2003-05-23 00:38:10.000000000 -0600
+++ dbmail-20030527-apop-statemachine-fix/pop3.c	2003-05-27 09:43:35.000000000 -0600
@@ -66,6 +66,7 @@
 
 	/* setting Session variables */
 	session.error_count = 0;
+	session.was_apop = 0;
 
 	session.username = NULL;
 	session.password = NULL;
@@ -169,8 +170,7 @@
 	my_free(session.apop_stamp);
 	session.apop_stamp = NULL;
 
-	/* there is no plaintext password for APOP (commandstype 11) */
-	if (session.username != NULL && (session.cmdtype == 11 || session.password != NULL))
+	if (session.username != NULL && (session.was_apop || session.password != NULL))
 	{
 		switch (session.SessionResult)
 		{
@@ -293,11 +293,11 @@
 
 	for (cmdtype = POP3_STRT; cmdtype < POP3_END; cmdtype ++)
 		if (strcasecmp(command, commands[cmdtype]) == 0) {
-			session->cmdtype = cmdtype;
+			session->was_apop = 1;
 			break;
 		}
 
-	trace (TRACE_DEBUG,"pop3(): command looked up as commandtype %d", session->cmdtype);
+	trace (TRACE_DEBUG,"pop3(): command looked up as commandtype %d", cmdtype);
 
 	/* commands that are allowed to have no arguments */
 	if ((value==NULL) && (cmdtype!=POP3_QUIT) && (cmdtype!=POP3_LIST) &&
