anchor.diff:      end.
   
   
  -%% Function: get_forwards_for_users/1
  -%% Description: Return a list of all forwards for a list of users.
  -%%              Uses the next function, get_forward_for_user/1.
  -%% Returns: ForwardList
  +%%--------------------------------------------------------------------
  +%% Function: get_forwards_for_users(In)
  +%%           In = list() of string(), list of usernames
  +%% Descrip.: Return a list of all forwards for a list of users.
  +%%           Uses the next function, get_forward_for_user/1.
  +%% Returns : Forwards, list() of string()
   %%--------------------------------------------------------------------
   get_forwards_for_users(In) ->
       get_forwards_for_users2(In, []).
  
positive.code:     lists:usort(Res);
  get_addresses_for_users2([H | T], Res) ->
      case get_addresses_for_user(H) of
  	A when list(A) ->
  	    get_addresses_for_users2(T, lists:append(Res, A));
  	_ ->
  	    get_addresses_for_users2(T, Res)
      end.
  
  
  %% Function: get_addresses_for_user/1
  %% Description: Get all possible addresses of a user. Both configured
  %%              ones, and implcit ones. Used for example to check if a
  %%              request from a user has an acceptable From: header.
  %% Returns: ListOfAddresses |
  %%          nomatch         |
  %%          error
  %%--------------------------------------------------------------------
  get_addresses_for_user(Username) ->
      case get_user(Username) of
  	nomatch ->
  	    logger:log(debug, "userdb-file: No such user ~p", [Username]),
  	    [];
  	User when record(User, user) ->
  	    collect_addresses(get_addresses_using_user(User));
  	Unknown ->
  	    logger:log(error, "userdb-file: Unexpected result from get_user(), user ~p result : ~p",
  
negative.code:     collect_usernames2(T, Res).
  
  
  %%--------------------------------------------------------------------
  %% Function: collect_addresses(In)
  %%           In = list() of address record()
  %% Descrip.: Collect and return a list of all addresses from a
  %%           set of address records.
  %% Returns : list() of string(), list of addresses in string format
  %%--------------------------------------------------------------------
  collect_addresses(In) ->
      collect_addresses2(In, []).
  