Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

rspamd.lua 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. --[[
  2. Copyright (c) 2011-2015, Vsevolod Stakhov <vsevolod@highsecure.ru>
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. ]]--
  13. -- This is main lua config file for rspamd
  14. local util = require "rspamd_util"
  15. config['regexp'] = {}
  16. local reconf = config['regexp']
  17. local local_conf = rspamd_paths['CONFDIR']
  18. local local_rules = rspamd_paths['RULESDIR']
  19. dofile(local_rules .. '/regexp/headers.lua')
  20. dofile(local_rules .. '/regexp/lotto.lua')
  21. dofile(local_rules .. '/regexp/fraud.lua')
  22. dofile(local_rules .. '/regexp/drugs.lua')
  23. dofile(local_rules .. '/regexp/upstream_spam_filters.lua')
  24. dofile(local_rules .. '/html.lua')
  25. dofile(local_rules .. '/misc.lua')
  26. dofile(local_rules .. '/http_headers.lua')
  27. dofile(local_rules .. '/forwarding.lua')
  28. local function file_exists(filename)
  29. local file = io.open(filename)
  30. if file then
  31. io.close(file)
  32. return true
  33. else
  34. return false
  35. end
  36. end
  37. if file_exists(local_conf .. '/rspamd.local.lua') then
  38. dofile(local_conf .. '/rspamd.local.lua')
  39. else
  40. -- Legacy lua/rspamd.local.lua
  41. if file_exists(local_conf .. '/lua/rspamd.local.lua') then
  42. dofile(local_conf .. '/lua/rspamd.local.lua')
  43. end
  44. end
  45. if file_exists(local_rules .. '/rspamd.classifiers.lua') then
  46. dofile(local_rules .. '/rspamd.classifiers.lua')
  47. end