anchor.diff:  %% @doc An imap connection
   -module(imap).
   -behaviour(gen_server).
  -
   -export([parse/1]).
  +
   %% Interface exports
   -export([start/1, start/2,
            start_link/1, start_link/2,
  
positive.code: %% @equiv step(State, Cmd) if there is a command the queue
  -spec step(#state{}) ->
      #state{}.
  step(#state{active=none, cmds=Cmds} = State) ->
      case queue:out(Cmds) of
          {empty, Cmds} ->
              State;
          {{value, Cmd}, Cmds2} ->
              send_cmd(State#state{cmds=Cmds2}, Cmd)
      end.
  
  
  %% @doc tag and send the cmd
  -spec send_cmd(#state{}, internal_cmd()) ->
      #state{}.
  send_cmd(#state{} = State, {cmd, _, {login, {plain, Username, Password}}} = Cmd) ->
      send_cmd(State, Cmd, intersperse(" ", ["LOGIN", Username, Password, "\r\n"])).
  
  -spec send_cmd(#state{}, internal_cmd(), iodata()) ->
      #state{}.
  send_cmd(#state{socket=Socket, tag=Tag} = State, Cmd, Data) ->
      CTag = <<$C, (integer_to_binary(Tag))/binary>>,
      ?LOG_DEBUG("SENDING: ~p", [Data]),
      ok = ssl:send(Socket, [CTag, " " | Data]),
      State#state{tag=Tag+1, active={CTag, Cmd}}.
  
  
  %% @doc intersperses the separator between list elements
  -spec intersperse(Sep :: iodata(), Xs :: iodata()) ->
      iodata().
  intersperse(_, []) ->
    [];
  intersperse(_, [X]) ->
  
negative.code:                     {ok, State};
                  _ ->
                      {ok, State#state{auth=Auth,
                                       cmds=queue:in({cmd, none, {login, Auth}},
                                                     State#state.cmds)}}
              end;
          {error, ssl_not_started} ->
              start_app(ssl);
  