}
public void execute(Pop3Connection conn, Pop3State state,
String cmd) {
try {
MailFolder inbox = state.getFolder();
String[] cmdLine = cmd.split(" ");
List messages;
if (cmdLine.length > 1) {
String msgNumStr = cmdLine[1];
List msgList = inbox.getMessages(new MsgRangeFilter(msgNumStr, false));
if (msgList.size() != 1) {
conn.println("-ERR no such message");
return;
}
SimpleStoredMessage msg = (SimpleStoredMessage) msgList.get(0);
conn.println("+OK " + msgNumStr + " " + msg.getUid());
} else {
messages = inbox.getNonDeletedMessages();
conn.println("+OK");
for (Iterator i = messages.iterator(); i.hasNext();) {
SimpleStoredMessage msg = (SimpleStoredMessage) i.next();
conn.println(inbox.getMsn(msg.getUid()) + " " + msg.getUid());
}
conn.println(".");
}
} catch (FolderException me) {