anchor.diff:  	imapd_util:send(#imap_resp{tag = Tag, status = no, info = "Failure: not authenticated"},State),
   	State;
   command(#imap_cmd{tag = Tag, cmd = unsubscribe = Command, data = MailBoxName},
  -	    #imapd_fsm{state = authenticated, user = User} = State) -> 
  +		#imapd_fsm{state = FSMState, user = User} = State) when FSMState =:= authenticated; FSMState =:= selected -> 
   	imapd_util:out(Command,MailBoxName,State),
   	Store = gen_store:lookup(mailbox_store, State),
   	case Store:select({MailBoxName,User#user.name}) of
  
positive.code: -export([command/1,command/2]).
  
  
  
  command(#imapd_fsm{line = Line} = State) -> 
  	io:format("Command Line: ~s~n",[State#imapd_fsm.line]),
  	command(imapd_util:parse(Line),State).
  
  %%%-------------------------
  %%% CAPABILITY - Any State
  %%%-------------------------
  
negative.code: 	imapd_util:send(#imap_resp{tag = Tag, status = no, info = "Failure: not authenticated"},State),
  	State;
  command(#imap_cmd{tag = Tag, cmd = subscribe = Command, data = MailBoxName},
  		#imapd_fsm{state = FSMState, user = User} = State) when FSMState =:= authenticated; FSMState =:= selected -> 
  	imapd_util:out(Command,MailBoxName,State),
  	Store = gen_store:lookup(mailbox_store, State),
  	case Store:select({MailBoxName,User#user.name}) of
  