mod_spam_filter: Also log spam recipient
Also log the recipient of rejected stanzas, not just the sender.
This commit is contained in:
parent
6a877d7018
commit
e6249c41e2
|
@ -480,15 +480,17 @@ trim(S) ->
|
||||||
re:replace(S, <<"\\s+$">>, <<>>, [{return, binary}]).
|
re:replace(S, <<"\\s+$">>, <<>>, [{return, binary}]).
|
||||||
|
|
||||||
-spec reject(stanza()) -> ok.
|
-spec reject(stanza()) -> ok.
|
||||||
reject(#message{from = From, type = Type, lang = Lang} = Msg)
|
reject(#message{from = From, to = To, type = Type, lang = Lang} = Msg)
|
||||||
when Type /= groupchat,
|
when Type /= groupchat,
|
||||||
Type /= error ->
|
Type /= error ->
|
||||||
?INFO_MSG("Rejecting unsolicited message from ~s", [jid:encode(From)]),
|
?INFO_MSG("Rejecting unsolicited message from ~s to ~s",
|
||||||
|
[jid:encode(From), jid:encode(To)]),
|
||||||
Txt = <<"Your traffic is unsolicited">>,
|
Txt = <<"Your traffic is unsolicited">>,
|
||||||
Err = xmpp:err_policy_violation(Txt, Lang),
|
Err = xmpp:err_policy_violation(Txt, Lang),
|
||||||
ejabberd_router:route_error(Msg, Err);
|
ejabberd_router:route_error(Msg, Err);
|
||||||
reject(#presence{from = From}) ->
|
reject(#presence{from = From, to = To}) ->
|
||||||
?INFO_MSG("Rejecting unsolicited presence from ~s", [jid:encode(From)]);
|
?INFO_MSG("Rejecting unsolicited presence from ~s to ~s",
|
||||||
|
[jid:encode(From), jid:encode(To)]);
|
||||||
reject(_) ->
|
reject(_) ->
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue