The options section defines basic Rspamd behaviour. Options are global for all types of workers. Some default options are shown in the following example snippet:. These options are in a separate subsection named dns and specify the behaviour of Rspamd name resolution. Here is a list of available tunables:. You can also specify another configuration of DNS servers selection strategy using upstream syntax, e.
In this case, 8. The WebUI supports displaying and aggregating statistics from a cluster of Rspamd servers and changing configuration of all cluster members at once. On the Rspamd server at which you want to point your web-browser add a neighbours list to the local. There is no communication between the cluster members. Rspamd just sends the neighbours list to the web-browser. Everything else happens on the browser side. The web-browser makes HTTP requests directly to the neighbours on the list.
For some reason ask cebka on IRC about that you should have such a list in the configuration of every other neighbour. Actually, it does not matter what is configured in the neighbours section on other servers of the cluster. There should be at least one host entry. But if you are plannig to access WebUI on this host as well you should configure something sensible. If you have a reverse proxy with TLS in front of Rspamd, you need to explicitly specify the protocol and port in the host directive:.
Otherwise it defaults to http and respectively. Toggle navigation. Rspamd options settings Introduction The options section defines basic Rspamd behaviour.
It is also possible to specify weights of DNS servers to balance the payload, e. Neighbours list The WebUI supports displaying and aggregating statistics from a cluster of Rspamd servers and changing configuration of all cluster members at once.GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community. Already on GitHub? Sign in to your account. According to the What are local.
Can you put rspamadm configdump output for the relevant sections? That should work as described Never mind my question about local. I've just misread the FAQ example. It will be easier to control sockets in local configuration then. Is there some good reason to include local. Despite local. It's confusing. Why not to include local.
It will merge config elements like rspamd. Skip to content. Dismiss Join GitHub today GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. Sign up. New issue. Jump to bottom. Copy link Quote reply. This comment has been minimized. Sign in to view. Member Author. Yes, I have that lines in the rspamd.
Oh wait, that's UCL error. That's worse Hm, I can't reproduce this issue. It loads local file just fine.
I've tried on another server. Result is the same. I couldn't reproduce your issue again I found the problem. I had this in rspamd. What about local. This fixes rspamd and fixes rspamd Sign up for free to join this conversation on GitHub. Already have an account?The UCL format is described in detail in this document. Rspamd defines several variables and macros to extend UCL functionality. However, there are a lot of mentions of the sections in Rspamd documentation.
You can treat sections as a simple subobjects of the top object. For example, here are two equivalent definitions in ucl config and in json syntax:. UCL also supports include directive and it is used extensively in Rspamd configuration.
Priorities determine how values are overwritten during include. Higher priority elements overwrite lower priority ones. Normally, all Rspamd sections contain 2 or 3 includes:. Duplicate policy merge means that if there are two objects with the same name in both files, then their keys are merged:.
If you want to add or redefine some of those default values, you can use local. These variables are simply replaced with substitution value. Nested variables e. By default, this file looks like this one:. In common.
Then we include a global options section followed by logging logging configuration. The metrics. The workers section specifies Rspamd workers settings. Statistical filters are defined in statistics. Rspamd stores module configurations for both Lua and internal modules in modules. The modules section defines the path or paths of directories or specific files.
If a directory is specified then all files with a. This configuration is not intended to be changed by the user, rather it should be overridden in site-specific configuration files- see the quickstart for details. Nevertheless, packaging will generally never overwrite configuration files on upgrade if they have been touched by the user. Please read the migration notes carefully if you upgrade Rspamd to a new version for all incompatible configuration changes.
From version 1.GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. Have a question about this project?
Sign up for a free GitHub account to open an issue and contact its maintainers and the community. Already on GitHub? Sign in to your account. Where should I enter the Redis settings as explained in the docs?
Should they go in a conf. For now I have this in the conf. And: How would I enable the learn cache for redis? It seems to me that this is not mentioned in the docs? Or is there an error in my config? Also I was able to migrate the ham and spam databases to redis but not the learn cache.
Any details on how a successful command would look like? I just assumed that the classifier for redis should overwrite the sqlite classifier and therefore I put it in spam. Does the learn cache work for you with this setting? That's what I have, too. But as I said, the learn cache doesn't seem to work. I have the stated error in the logs and I don't have the entry mentioning bases in my email headers anymore.
Since my configuration is just as it is described in the docs I don't know why bases wouldn't work…. Is my config correct? Am I missing something there? Should I also add the other workers in the rspamd.
If you're redefining workers you should do so in override.Rspamd is designed to be fast and can process up to emails per second using a single CPU core.
Filtering out spam with rspamd
Locaweb is the largest email provider in Brazil, Locaweb supports more than 10 million inbound email addresses and processes more than million email messages a day. Rspamd is broadly customizable and allows multiple strategies to avoid Spam and false positives. In conclusion, Rspamd team is not only giving an incredible support for Locaweb but it has also been a great partner. Following its fast development and truly innovative ideas, mailcows migration to Rspamd was only a matter of time.
The concept of Rspamd is to be expandable. If it is within the scope of a mail filter, Rspamd is able to handle it. Rspamd offers a plethora of filtering options and great performance. Per user settings enable us to provide spam filtering for multiple tenants. Furthermore Rspamd makes it very easy to write custom rules, which allows us to quickly react to spam outbreaks. We started to use the product with the first public versions and for us Rspamd is a natural choice, which is providing speed, flexibility and has rich set of features.
Toggle navigation. Rspamd Fast, free and open-source spam filtering system. Quick start. News: Rspamd 2. Learn more. Rspamd is an important enrichment for the open source community.This guide describes the main steps to get and start working with Rspamd. In particular, we describe the following setup:. In this guide, we describe the setup of the Postfix MTA.
However, Rspamd can work with other MTA software - you can find details in the integration document. You should also consider to setup your own local DNS resolver. It is strongly recommended to setup TLS for your mail system. You can read more about this topic in one of the guides available on the Internet, for instance, this one. In this guide, we assume that all services have the same certificate which might not be desired if you want greater levels of security.
Here is the desired configuration for Postfix:. For Debian based systems you can use the following packages:. Configuration of Dovecot especially its authentication mechanisms is a bit out of the scope for this guide but you can find many good guides at the Dovecot main site.
However, you should set up Postfix authentication. Furthermore, it might be useful to set up TLS to avoid passwords and other sensitive information to be passed through insecure connections.
Rspamd uses Redis as a storage for non-volatile data:. Installation of Redis is quite straightforward: install it using the preferred way for your OS e. We strongly recommend using a separate Redis instance for each module that stores non-volatile data, in particular for the statistical module BAYES classifier and fuzzy storage.
A multi-instance Redis configuration simplifies some administration tasks e. A detailed explanation of multi-instance Redis configuration can be found in the Redis replication tutorial.
Please bear in mind that Redis could listen for connections from all network interfaces. This is potentially dangerous and in most cases should be limited to the loopback interfaces, with the following configuration directive:.
For saving data to disk, it is also useful to setup overcommit memory behavior which might be useful for loaded systems. It could be done in Linux by using the following command:. The download process is described in the downloads page where you can find how to get Rspamd, how to install it in your system, and, alternatively, how to build Rspamd from the sources. From version 1. This wizard can help you to configure the most commonly used features in Rspamd, for instance:.
First of all, please read the basic configuration principles here. It is recommended to use the special include files that are referenced in the stock configuration. Settings in local. Unlike rspamd. Similarly to rspamd. You can read more about actions, scores and these configuration parameters in this explanation.Rules are the essential part of a spam filtering system and Rspamd ships with some prepared rules by default.
However, if you run your own system you might want to have your own rules for better spam filtering or a better false positives rate. Rules are usually written in Luawhere you can specify both custom logic and generic regular expressions. Since Rspamd ships with its own rules it is a good idea to store your custom rules and configuration in separate files to avoid clashing with the default rules which might change from version to version.
There are some possibilities to achieve this:. Lua local configuration can be used to both override and extend, for example if the main lua file has the following line:. Therefore, you can either extend using local. We can also use an override file. This will set the other actions e. Regexp rules are useful since they are heavily optimized by Rspamd especially when Hyperscan is enabled and allow matching custom patterns in headers, URLs, text parts and even the entire message body.
Rule weights are usually defined in the metrics section and contain the following data:. Please bear in mind that the scores you define directly from Lua have lower priority and are overriden by scores defined in the groups. WebUI defined scores have even higher priority. Regexp rules are executed by the regexp module of Rspamd. You can find a detailed description of the syntax in the regexp module documentation.
Following these rules allows you to create fast and efficient rules. To add regexp rules you should use the config global table that is defined in any Lua file used by Rspamd:. Lua rules are more powerful than regexp ones but they are not as heavily optimized and can cause performance issues if written incorrectly. All Lua rules accept a special parameter called task which represents a scanned message. Each Lua rule can return 0or falsemeaning that the rule has not matched, or true if the symbol should be inserted.
The common convention of the return values is to return confidence factor varying from 0 to 1. They can be either in a single table:. There is no difference in these notations. Tables are usually more convenient if you form list of options during the rule progressing. There are a number of methods in task objects. For example, you can get any part of a message:.
The most common type of rules are generic filters. Each filter is basically a callback that is executed by Rspamd at some time, along with an optional symbol name associated with this callback. In general, there are three options to register symbols:. Filters are registered using the following method:. Numeric id is returned by a registration function with callback and can be used to link symbols:.