#include "message.h"
#include "task.h"
#include "archives.h"
-#include "fstring.h"
static void
rspamd_archive_dtor (gpointer p)
#include "message.h"
#include "printf.h"
#include "smtp_parsers.h"
-#include "mime_headers.h"
static void
rspamd_email_addr_dtor (struct rspamd_email_address *addr)
#include "rspamd.h"
#include "message.h"
#include "lua/lua_common.h"
-#include "cryptobox.h"
#include <math.h>
#include "contrib/uthash/utlist.h"
#include "util.h"
#include "rspamd.h"
#include "message.h"
-#include "cfg_file.h"
-#include "libutil/regexp.h"
#include "html.h"
#include "images.h"
#include "archives.h"
-#include "email_addr.h"
-#include "utlist.h"
#include "tokenizers/tokenizers.h"
-#include "cryptobox.h"
#include "smtp_parsers.h"
#include "mime_parser.h"
#include "mime_encoding.h"
#include "libstemmer.h"
#endif
-#include <iconv.h>
-
#define GTUBE_SYMBOL "GTUBE"
#define SET_PART_RAW(part) ((part)->flags &= ~RSPAMD_MIME_TEXT_PART_FLAG_UTF)
#include "message.h"
#include "mime_expressions.h"
#include "html.h"
-#include "email_addr.h"
#include "lua/lua_common.h"
#include "utlist.h"
}
}
- if ((double)(hits * num / 2.) / (double)total >= threshold) {
+ if ((hits * num / 2.) / (double)total >= threshold) {
return TRUE;
}
#include "mime_headers.h"
#include "smtp_parsers.h"
#include "mime_encoding.h"
-#include "email_addr.h"
-#include "task.h"
-#include "cryptobox.h"
-#include "contrib/libottery/ottery.h"
static void
rspamd_mime_header_check_special (struct rspamd_task *task,
#include "mime_parser.h"
#include "mime_headers.h"
#include "message.h"
-#include "content_type.h"
#include "multipattern.h"
-#include "cryptobox.h"
#include "contrib/libottery/ottery.h"
struct rspamd_mime_parser_lib_ctx {
if (hdr_pos > 0 && hdr_pos < str.len) {
- task->raw_headers_content.begin = (gchar *) (str.str);
+ task->raw_headers_content.begin = str.str;
task->raw_headers_content.len = hdr_pos;
task->raw_headers_content.body_start = str.str + body_pos;
hdr_pos = rspamd_mime_parser_headers_heuristic (&str, &body_pos);
if (hdr_pos > 0 && hdr_pos <= str.len) {
- task->raw_headers_content.begin = (gchar *) (str.str);
+ task->raw_headers_content.begin = str.str;
task->raw_headers_content.len = hdr_pos;
task->raw_headers_content.body_start = str.str + body_pos;
rspamd_strcase_equal, NULL, rspamd_ptr_array_free_hard);
if (hdr_pos > 0 && hdr_pos < str.len) {
- npart->raw_headers_str = (gchar *) (str.str);
+ npart->raw_headers_str = str.str;
npart->raw_headers_len = hdr_pos;
npart->raw_data.begin = str.str + body_pos;
#include "rdns.h"
#include "mem_pool.h"
#include "cfg_file.h"
-#include "monitored.h"
#include "cryptobox.h"
#include "logger.h"
-#include "radix.h"
static const gdouble default_monitoring_interval = 60.0;
static const guint default_max_errors = 3;
*/
#include "config.h"
#include "rspamd.h"
-#include "util.h"
-#include "cfg_file.h"
-#include "cfg_rcl.h"
#include "message.h"
#include "utlist.h"
-#include "http.h"
#include "http_private.h"
-#include "email_addr.h"
#include "worker_private.h"
-#include "cryptobox.h"
#include "contrib/zstd/zstd.h"
-#include "contrib/uthash/utlist.h"
#include "lua/lua_common.h"
#include "unix-std.h"
#include <math.h>
#include "contrib/hiredis/async.h"
#include "contrib/hiredis/adapters/libevent.h"
#include "cryptobox.h"
-#include "ref.h"
#include "logger.h"
struct rspamd_redis_pool_elt;
*/
#include "config.h"
#include "rspamd.h"
-#include "roll_history.h"
-#include "ucl.h"
#include "lua/lua_common.h"
#include "unix-std.h"
#include "spf.h"
#include "rspamd.h"
#include "message.h"
-#include "filter.h"
#include "utlist.h"
-#include "email_addr.h"
#define SPF_VER1_STR "v=spf1"
#define SPF_VER2_STR "spf2."
#include "config.h"
#include "url.h"
#include "util.h"
-#include "fstring.h"
#include "rspamd.h"
#include "message.h"
-#include "http.h"
#include "multipattern.h"
-#include "http_parser.h"
#include "contrib/uthash/utlist.h"
typedef struct url_match_s {
*/
#include "config.h"
#include "rspamd.h"
-#include "message.h"
#include "lua/lua_common.h"
#include "worker_util.h"
#include "unix-std.h"
*/
#include "classifiers.h"
#include "rspamd.h"
-#include "filter.h"
-#include "cfg_file.h"
#include "stat_internal.h"
#include "math.h"
#include "tokenizers.h"
#include "stat_internal.h"
-#include "cryptobox.h"
/* Size for features pipe */
#define DEFAULT_FEATURE_WINDOW_SIZE 5
#include "util.h"
#include "logger.h"
#include "cryptobox.h"
-#include "radix.h"
#include "unix-std.h"
/* pwd and grp */
#ifdef HAVE_PWD_H
*/
#include "config.h"
#include "logger.h"
-#include "util.h"
#include "rspamd.h"
#include "map.h"
-#include "cryptobox.h"
#include "ottery.h"
-#include "keypair.h"
#include "unix-std.h"
#ifdef HAVE_SYSLOG_H
#include "http.h"
#include "http_private.h"
#include "rspamd.h"
-#include "cryptobox.h"
-#include "unix-std.h"
-#include "http_parser.h"
-#include "libutil/regexp.h"
#include "contrib/zstd/zstd.h"
#ifdef WITH_HYPERSCAN
#include "mem_pool.h"
#include "fstring.h"
#include "logger.h"
-#include "utlist.h"
#include "ottery.h"
#include "unix-std.h"
#include "config.h"
#include "libutil/multipattern.h"
#include "libutil/str_util.h"
-#include "libutil/util.h"
-#include "libutil/printf.h"
#include "libcryptobox/cryptobox.h"
-#include "unix-std.h"
-#include "libutil/logger.h"
#ifdef WITH_HYPERSCAN
+#include "logger.h"
+#include "unix-std.h"
#include "hs.h"
#endif
#include "acism.h"
*/
#include "printf.h"
-#include "fstring.h"
#include "str_util.h"
-#include <math.h>
/**
* From FreeBSD libutil code
#include "lua_common.h"
#include "expression.h"
#include "composites.h"
-#include "unix-std.h"
+
#ifdef HAVE_SYS_UTSNAME_H
-#include <sys/utsname.h>
#endif
/*
* limitations under the License.
*/
#include "lua_common.h"
-#include "cfg_file.h"
/* Classifier methods */
LUA_FUNCTION_DEF (classifier, get_statfiles);
#include "libutil/expression.h"
#include "libserver/composites.h"
#include "lua/lua_map.h"
-#include "monitored.h"
#include "utlist.h"
#include <math.h>
static gint
lua_config_get_api_version (lua_State *L)
{
- lua_pushinteger (L, RSPAMD_LUA_API_VERSION);
- return 1;
+ return luaL_error (L, "obsolete function");
}
static gint
*/
#include "lua_common.h"
-#include "cryptobox.h"
-#include "keypair.h"
#include "unix-std.h"
-#include <openssl/evp.h>
-#include <openssl/hmac.h>
struct rspamd_lua_cryptobox_hash {
rspamd_cryptobox_hash_state_t *h;
* limitations under the License.
*/
#include "lua_common.h"
-#include "dns.h"
#include "utlist.h"
* limitations under the License.
*/
#include "lua_common.h"
-#include "util.h"
+
#ifdef WITH_FANN
#include <fann.h>
#endif
* limitations under the License.
*/
#include "lua_common.h"
-#include "dns.h"
-#include "http.h"
#include "http_private.h"
-#include "utlist.h"
-#include "libcryptobox/keypair.h"
#include "unix-std.h"
/***
/* Error */
lua_pushnil (cbd->L);
/* Reply code */
- lua_pushinteger (cbd->L, msg->code);
+ lua_pushnumber (cbd->L, msg->code);
/* Body */
body = rspamd_http_message_get_body (msg, &body_len);
#include "lua_common.h"
#include "libutil/map.h"
#include "libutil/map_private.h"
-#include "libutil/radix.h"
-#include "lua/lua_map.h"
/***
* This module is used to manage rspamd maps and map like objects
* limitations under the License.
*/
#include "lua_common.h"
-#include "mem_pool.h"
/***
* @module rspamd_mempool
struct memory_pool_s *mempool = rspamd_lua_check_mempool (L, 1);
if (mempool) {
- lua_pushinteger (L, rspamd_mempool_suggest_size ());
+ lua_pushnumber (L, rspamd_mempool_suggest_size ());
return 0;
}
else {
return 1;
}
- lua_pushinteger (L, part->parsed_data.len);
+ lua_pushnumber (L, part->parsed_data.len);
return 1;
}
* limitations under the License.
*/
#include "lua_common.h"
-#include "dns.h"
#include "utlist.h"
#include "contrib/hiredis/hiredis.h"
* limitations under the License.
*/
#include "lua_common.h"
-#include "regexp.h"
/***
* @module rspamd_regexp
#include "lua_common.h"
#include "unix-std.h"
-
-#ifdef HAVE_OPENSSL
#include <openssl/err.h>
+#include <openssl/pem.h>
#include <openssl/sha.h>
#include <openssl/rsa.h>
-#include <openssl/pem.h>
LUA_FUNCTION_DEF (rsa_pubkey, load);
LUA_FUNCTION_DEF (rsa_pubkey, create);
lua_settop (L, 0);
}
-
-#else
-void
-luaopen_rsa (lua_State * L)
-{
- msg_info ("this rspamd version is not linked against openssl, therefore no "
- "RSA support is available");
-}
-#endif
* limitations under the License.
*/
#include "lua_common.h"
-#include "util.h"
#include "sqlite_utils.h"
/***
*/
#include "lua_common.h"
#include "message.h"
-#include "protocol.h"
-#include "filter.h"
-#include "dns.h"
-#include "util.h"
#include "images.h"
#include "archives.h"
-#include "cfg_file.h"
-#include "email_addr.h"
#include "utlist.h"
-#include "cryptobox.h"
#include "unix-std.h"
#include "libmime/smtp_parsers.h"
-#include "contrib/uthash/utlist.h"
#include <math.h>
/***
if (task) {
if (task->helo != NULL) {
- lua_pushstring (L, (gchar *)task->helo);
+ lua_pushstring (L, task->helo);
return 1;
}
else {
struct rspamd_image *img = lua_check_image (L);
if (img != NULL) {
- lua_pushinteger (L, img->data->len);
+ lua_pushnumber (L, img->data->len);
}
else {
return luaL_error (L, "invalid arguments");
struct rspamd_archive *arch = lua_check_archive (L);
if (arch != NULL) {
- lua_pushinteger (L, arch->size);
+ lua_pushnumber (L, arch->size);
}
else {
return luaL_error (L, "invalid arguments");
* limitations under the License.
*/
#include "lua_common.h"
-#include "dns.h"
#include "utlist.h"
-#include "ref.h"
#include "unix-std.h"
/***
vec->iov_base = g_malloc (len);
dtor = g_slice_alloc0 (sizeof (*dtor));
dtor->dtor = g_free;
- dtor->data = (void *)vec->iov_base;
+ dtor->data = vec->iov_base;
LL_PREPEND (cbd->dtors, dtor);
memcpy (vec->iov_base, str, len);
vec->iov_len = len;
*/
#include "config.h"
#include "lua_common.h"
-#include "upstream.h"
-#include "cfg_file.h"
/***
struct rspamd_lua_url *url = lua_check_url (L, 1);
if (url != NULL) {
- lua_pushinteger (L, url->url->urllen);
+ lua_pushnumber (L, url->url->urllen);
}
else {
lua_pushnil (L);
lua_url = lua_newuserdata (L, sizeof (struct rspamd_lua_url));
rspamd_lua_setclass (L, "rspamd{url}", -1);
lua_url->url = url;
- lua_pushinteger (L, n + 1);
+ lua_pushnumber (L, n + 1);
lua_pushlstring (L, url->string, url->urllen);
lua_settable (L, -3);
}
* limitations under the License.
*/
#include "lua_common.h"
-#include "task.h"
-#include "rspamd.h"
#include "html.h"
-#include "cfg_rcl.h"
#include "tokenizers/tokenizers.h"
-#include "libserver/url.h"
#include "unix-std.h"
#include "contrib/zstd/zstd.h"
#include "libmime/email_addr.h"
case 12:
/* Push integer value */
num = strtoul (text, NULL, 10);
- lua_pushinteger (ud->L, num);
+ lua_pushnumber (ud->L, num);
break;
case 13:
/* Push integer value */
#include "libserver/worker_util.h"
#include "fuzzy_wire.h"
#include "utlist.h"
-#include "cryptobox.h"
#include "ottery.h"
-#include "keypair.h"
#include "lua/lua_common.h"
#include "unix-std.h"
#include "libutil/http_private.h"
#include "libutil/hash.h"
#include "libutil/map.h"
#include "rspamd.h"
-#include "addr.h"
#define DEFAULT_SYMBOL_FAIL "R_SPF_FAIL"
#define DEFAULT_SYMBOL_SOFTFAIL "R_SPF_SOFTFAIL"
#include "cryptobox.h"
#include "printf.h"
#include "http.h"
-#include "ucl.h"
-#include "libcryptobox/keypair.h"
-#include "libutil/str_util.h"
static gboolean hex_encode = FALSE;
static gboolean raw = FALSE;
#include "config.h"
#include "rspamadm.h"
-#include "cryptobox.h"
#include "libutil/http.h"
#include "libutil/http_private.h"
#include "printf.h"
#include "lua/lua_common.h"
#include "message.h"
-#include "task.h"
#include "unix-std.h"
#include "linenoise.h"
#include "worker_util.h"