anchor.diff:  
       update_table(),
   
  +    % user event hooks
  +    ejabberd_hooks:add(remove_user, Host, ?MODULE, user_removed, 50),
  +    ejabberd_hooks:add(register_user, Host, ?MODULE, user_registered, 50),
  +
  +    % ad-hoc hooks
       ejabberd_hooks:add(adhoc_local_items, Host,
                          ?MODULE, private_email_items, 50),
       ejabberd_hooks:add(adhoc_local_commands, Host,
  
positive.code: 
  -spec set_email(#jid{}, string()) -> ok | {error, atom()}.
  set_email(JID, Email) ->
      #jid{luser = User, lserver = Server} = JID,
      F = fun() ->
          mnesia:write(#private_email{user = {User, Server}, email = Email})
      end,
      case mnesia:transaction(F) of
          {atomic, _} -> ok;
          {aborted, _Reason} ->
              ?ERROR_MSG("Couldnt set private Email '~p' for '~p': ~p",
                         [Email, JID, _Reason]),
              {error, aborted}
      end.
  
  -spec get_email(#jid{}) -> string() | {error, atom()}.
  
negative.code:     ok.
  
  stop(Host) ->
      % ad-hoc hooks
      ejabberd_hooks:delete(adhoc_local_commands, Host, ?MODULE,
                            private_email_commands, 50),
      ejabberd_hooks:delete(adhoc_local_items, Host,
                            ?MODULE, private_email_items, 50),
  
      % user event hooks
      ejabberd_hooks:delete(remove_user, Host, ?MODULE, user_removed, 50),
      ejabberd_hooks:delete(register_user, Host, ?MODULE, user_registered, 50),
  
      ok.
  
  