anchor.diff:  status(Pid,MailBox,StatusCodes) -> status(Pid,MailBox,StatusCodes,imapc_util:tag()).
   status(Pid,MailBox,StatusCodes,Tag) -> gen_fsm:sync_send_event(Pid,{status,Tag,MailBox,imapc_util:build_statuscodes(StatusCodes)}).
   
  -%%--------------------------------------------------------------------
  -%% Function: append(Pid,Mailbox,Message,Flags)
  -%%           Pid     = pid()
  -%%           Mailbox = String()
  -%%           Message = string()
  -%%           Flags   = term() - list of atoms
  -%% Descrip.: APPENDs message to Mailbox with listed Flags
  -%% Returns : ok
  -%%--------------------------------------------------------------------
  -
  -
  -append(Pid,Mailbox,Message) -> append(Pid,Mailbox,Message,imapc_util:tag()).
  -append(Pid,Mailbox,Message,[Atom|_Rest] = Flags) when is_atom(Atom) -> append(Pid,Mailbox,Message,Flags,imapc_util:tag());
  -append(Pid,Mailbox,Message,Tag) -> append(Pid,Mailbox,Message,[],Tag).
  -append(Pid,Mailbox,Message,Flags,Tag) ->
  -	gen_fsm:sync_send_event(Pid,{append,Tag,Mailbox,Message,imapc_util:build_flags(Flags)}).
  -
  -
  -%%--------------------------------------------------------------------
  -%% Function: check(Pid)
  -%%           Pid = pid()
  -%% Descrip.: Sends CHECK command to FSM
  -%% Returns : ok
  -%%--------------------------------------------------------------------
  -
  -check(Pid)     -> check(Pid,imapc_util:tag()).
  -check(Pid,Tag) -> gen_fsm:sync_send_event(Pid,{check,Tag}).
  -
  -%%--------------------------------------------------------------------
  -%% Function: close(Pid)
  -%%           Pid = pid()
  -%% Descrip.: Send CLOSE command, closes currently selected mailbox
  -%% Returns : ok
  -%%--------------------------------------------------------------------
  -
  -close(Pid)     -> close(Pid,imapc_util:tag()).
  -close(Pid,Tag) -> gen_fsm:sync_send_event(Pid,{close,Tag}).
  +
  +
  +
   
   %%--------------------------------------------------------------------
   %% Function: expunge(Pid)
  
positive.code: %%%----------------------------------------------------------------------
  %%% File        : imapc
  %%% Author      : Stuart Jackson <sjackson@simpleenigma.com> [http://www.simpleenigma.com]
  %%% Purpose     : IMAP Client API - Use these funcations instead of the FSM
  %%% Created     : 2006-11-04
  %%% Initial Rel : 0.0.1
  %%% Updated     : 2007-10-18
  %%%----------------------------------------------------------------------
  -module(imapc).
  -author('sjackson@simpleenigma.com').
  -include("../include/erlmail.hrl").
  -include("../include/imap.hrl").
  
  -export([connect/1,connect/2]).
  -export([login/3,logout/1,noop/1,authenticate/2,capability/1]).
  -export([select/1,select/2,close/1,examine/1,examine/2]).
  -export([create/2,delete/2,subscribe/2,unsubscribe/2,rename/3,list/3,lsub/3]).
  -export([append/3,append/4,check/1,store/4,uid/3]).
  -export([switch/2,copy/3,move/3,expunge/1,status/3,status/2,search/2,fetch/3,sort/3,sort/4]).
  -export([deletef/2,undeletef/2,draft/2,undraft/2,flag/2,unflag/2,seen/2,unseen/2]).
  -export([info/1,info/2]).
  -export([build/0,build/1]).
  
  %%--------------------------------------------------------------------
  %% Function: connect(IPAddress)
  %%         : connect(IPAddress,Port)
  %%           IPAddress = term() tuple, i.e {10,1,1,3}
  %%           Port      = integer(), Default 143  
  %% Descrip.: Connects to an IMAP server and starts a FSM
  %% Returns : {ok, Pid} | {error, Error}
  %%--------------------------------------------------------------------
  
  connect(IPAddress) -> connect(IPAddress,143).
  connect(IPAddress,Port) -> imapc_fsm:start_link(IPAddress,Port).
  
  %%--------------------------------------------------------------------
  %% Function: noop(Pid)
  %%           Pid = pid()
  %% Descrip.: Sends NOOP command to FSM: No Operation
  %% Returns : ok
  %%--------------------------------------------------------------------
  
  noop(Pid)     -> noop(Pid,imapc_util:tag()).
  noop(Pid,Tag) -> gen_fsm:sync_send_event(Pid,{noop,Tag}).
  
  %%--------------------------------------------------------------------
  %% Function: capability(Pid)
  %%           Pid = pid()
  %% Descrip.: Sends CAPABILITY command to FSM: No Operation
  %% Returns : List of Capabilities
  %%--------------------------------------------------------------------
  
  capability(Pid)     -> capability(Pid,imapc_util:tag()).
  capability(Pid,Tag) -> gen_fsm:sync_send_event(Pid,{capability,Tag}).
  
  %%--------------------------------------------------------------------
  %% Function: logout(Pid)
  
negative.code: login(Pid,UserName,Password)     -> login(Pid,UserName,Password,imapc_util:tag()).
  login(Pid,UserName,Password,Tag) -> gen_fsm:sync_send_event(Pid,{login,Tag,UserName,Password}).
  
  
  
  %%--------------------------------------------------------------------
  