* [Feature] Add replies plugin
* [Feature] Add results parsing code
* [Feature] Add routines to compare and check pubkeys
- * [Feature] Add simplier versions of refcounts
+ * [Feature] Add simpler versions of refcounts
* [Feature] Add some time manipulation functions for lua APi
* [Feature] Add support for non-standard BATV signatures
* [Feature] Add support of address with at-domain list
* [Feature] Implement zero-copy mode for HTTP reading
* [Feature] Improve SPF domain detection logic
* [Feature] Improve config:register_symbol function
- * [Feature] Improve error report for type missmatch in lua
+ * [Feature] Improve error report for type mismatch in lua
* [Feature] Improve fstrings API
* [Feature] Improve getting SMTP data from lua_task
* [Feature] Improve levenshtein distance function
- Fix html images rules to reduce FP rates
* New rules:
- LONG_SUBJ - too long subject
- - MIME_BAD_ATTACHMENT - bad attachement type
+ - MIME_BAD_ATTACHMENT - bad attachment type
- RDNS_NONE - no reverse DNS record for sender's IP
- Fix MISSING_MIMEOLE rule for modern OE
* Many other bugfixes, memory leaks plugs thanks to:
* Cache correct passwords to avoid too high CPU usage when working with webui
* Controller sockets are owned by router do not export them to task
* Optimize logging by skipping hash table search if it's empty
- * Fix loading issue whith broken statfiles
+ * Fix loading issue with broken statfiles
* Print assertions from glib to rspamd logger
* Load legacy `lua/rspamd.local.lua`
* Update webui with some fixes to learning and scanning
- aggressive optimizations based on the abstract syntax tree;
- abstract expressions support (regular expressions, functions, lua modules
composites and so on)
- - New comparision and '+' operators support
+ - New comparison and '+' operators support
- New greedy algorithm to minimize execution time of expressions and
all symbols
- Dynamic expressions benchmark and reoptimizations
- converted to UTF-8
- normalized if needed (e.g. HTML tags are stripped)
* Rework DKIM canonization to line based
- * Fix fuzzy hashes addding
+ * Fix fuzzy hashes adding
* Use more specific hash function for fuzzy
* Fix leaking of iconv descriptors
* Fix PTR resolving in lua resolver
- Free IP list on upstream destruction
- Add test cases for addresses selection
- Allow adding of free form IP addresses to upstreams
- * Fix endiannes in lua_radix search (reported by @citrin)
+ * Fix endianness in lua_radix search (reported by @citrin)
* Soft shutdown should also set wanna_die flag (reported by @citrin)
* Stop use-after-free in event loop termination
* Fix processing of very short messages in DKIM (reported by @citrin)
* Do not output control characters if output is not terminal
* Fix some logic errors in learning
* Consider lua plugins errors as fatal configuration errors
- * Fix wirting message id during fuzzy_add command
+ * Fix writing message id during fuzzy_add command
* Display weight of symbols correctly
* Fixes to winnow learning
* One more try to improve accuracy of winnow algorithm
* Add ability to set minimum dimensions for images
* Assume all text/* content types as text/plain
* Fix getting data wrapper for gmime24
- * Many fixes to statfile syncronization system
+ * Many fixes to statfile synchronization system
* Fixed statfile pool initialization and synchronization with disk
* Prepare 0.3.2
* Fix Mail::Rspamd::Config for new rspamd features
* Make valgrind happy about comparing symbols
* Add more debug to comparing parts distance function
* Write action even if message has no symbols
- * Make improvements to HTML entites decoder: now it replaces entities with common characters and
+ * Make improvements to HTML entities decoder: now it replaces entities with common characters and
* Add -d option to force debug output
* Assume 7bit as default transfer encoding
* Do not overwrite lua plugins and configs if they already exists in target directory
* Stupid error in calculation compressed label length
* Some optimizations to client library
* Do not compare empty parts
- * Empty and non-empty parts are allways different
+ * Empty and non-empty parts are always different
* Save in regexp cache the whole regexp with header name (if exists) and with flags
* Add rspamd_log variable to lua plugins to access logging functions
* Each part in rspamd task now can have parent part
}
symbol "HFILTER_RCPT_BOUNCEMOREONE" {
weight = 1.50;
- description = "Message from bounce and over 1 recepient";
+ description = "Message from bounce and over 1 recipient";
}
symbol "HFILTER_URL_ONLY" {
weight = 2.20;
}
symbol "MIME_BAD_ATTACHMENT" {
weight = 4.0;
- description = "Invalid attachement mime type";
+ description = "Invalid attachment mime type";
one_shot = true;
}
symbol "MIME_ENCRYPTED_ARCHIVE" {
ip_score {
# servers = "localhost";
-# treshold = 100;
+# threshold = 100;
# reject_score = 3;
# no_action_score = -2;
# add_header_score = 1;
#define HAVE_EVUTIL_RNG_INIT 1
#endif
-/* Detect endiannes */
+/* Detect endianness */
#ifdef HAVE_ENDIAN_H
#include <endian.h>
{
/*
Returns OK if no errors, else error code.
- On succesful return, pEnvFile points to Envelope file name and
+ On successful return, pEnvFile points to Envelope file name and
pInpFile points to Message filename
*/
int iStatus;
tok_ptr = reply_buf;
/*
- * rspamd can use several metrics, logic implimented here:
+ * rspamd can use several metrics, logic implemented here:
* if any metric more than reject_score - will reject
* if any metric true - message will be marked as spam
*/
+ }
/* now send the file */
- /* spamd sometimes accepts conections but doesn't read data off
+ /* spamd sometimes accepts connections but doesn't read data off
@@ -304,7 +359,9 @@
(void)fclose(mbox_file);
+ }
/* now send the file */
- /* spamd sometimes accepts conections but doesn't read data off
+ /* spamd sometimes accepts connections but doesn't read data off
@@ -349,60 +404,93 @@
/* reading done */
(void)close(spamd_sock);
return sh->buf;
}
-/* Return the total size of the allocation of the specifed sds string,
+/* Return the total size of the allocation of the specified sds string,
* including:
* 1) The sds header before the pointer.
* 2) The string.
/* Here we call the headers_complete callback. This is somewhat
* different than other callbacks because if the user returns 1, we
* will interpret that as saying that this message has no body. This
- * is needed for the annoying case of recieving a response to a HEAD
+ * is needed for the annoying case of receiving a response to a HEAD
* request.
*
* We'd like to use CALLBACK_NOTIFY_NOADVANCE() here but we cannot, so
&& parser->content_length != ULLONG_MAX);
/* The difference between advancing content_length and p is because
- * the latter will automaticaly advance on the next loop iteration.
+ * the latter will automatically advance on the next loop iteration.
* Further, if content_length ends up at 0, we want to see the last
* byte again for our message complete callback.
*/
case s_dead:
return 1;
- /* Skip delimeters */
+ /* Skip delimiters */
case s_req_schema_slash:
case s_req_schema_slash_slash:
case s_req_server_start:
* array of children for that path can be found by counting the number
* of set bits to the left of that bit.
*
- * Similary, the internal bitmap has one bit for each binary node
+ * Similarly, the internal bitmap has one bit for each binary node
* which is internal to the multibit node. To determine whether there
* is data stored for an internal prefix, one checks the corresponding
* bit in the internal bitmap. As for extending paths, the index into
btrie->n_lc_nodes--;
}
else {
- /* can't merge, but can take some of childs bits */
+ /* can't merge, but can take some of children bits */
unsigned cshift = lc_shift (end + spare_bits) - lc_shift (end);
memcpy(node->prefix + shift, child->prefix,
/**
* g_match_info_next:
* @match_info: a #GMatchInfo structure
- * @error: location to store the error occuring, or %NULL to ignore errors
+ * @error: location to store the error occurring, or %NULL to ignore errors
*
* Scans for the next match using the same parameters of the previous
* call to g_regex_match_full() or g_regex_match() that returned
match_info->pos = match_info->offsets[1];
}
- /* it's possibile to get two identical matches when we are matching
+ /* it's possible to get two identical matches when we are matching
* empty strings, for instance if the pattern is "(?=[A-Z0-9])" and
* the string is "RegExTest" we have:
* - search at position 0: match from 0 to 0
* g_match_info_expand_references:
* @match_info: a #GMatchInfo or %NULL
* @string_to_expand: the string to expand
- * @error: location to store the error occuring, or %NULL to ignore errors
+ * @error: location to store the error occurring, or %NULL to ignore errors
*
* Returns a new string containing the text in @string_to_expand with
* references and escape sequences expanded. References refer to the last
* @match_options: match options
* @match_info: pointer to location where to store the #GMatchInfo,
* or %NULL if you do not need it
- * @error: location to store the error occuring, or %NULL to ignore errors
+ * @error: location to store the error occurring, or %NULL to ignore errors
*
* Scans for a match in string for the pattern in @regex.
* The @match_options are combined with the match options specified
* @match_options: match options
* @match_info: pointer to location where to store the #GMatchInfo,
* or %NULL if you do not need it
- * @error: location to store the error occuring, or %NULL to ignore errors
+ * @error: location to store the error occurring, or %NULL to ignore errors
*
* Using the standard algorithm for regular expression matching only
- * the longest match in the string is retrieved, it is not possibile
+ * the longest match in the string is retrieved, it is not possible
* to obtain all the available matches. For instance matching
* "<a> <b> <c>" against the pattern "<.*>"
* you get "<a> <b> <c>".
* @start_position: starting index of the string to match
* @replacement: text to replace each match with
* @match_options: options for the match
- * @error: location to store the error occuring, or %NULL to ignore errors
+ * @error: location to store the error occurring, or %NULL to ignore errors
*
* Replaces all occurrences of the pattern in @regex with the
* replacement text. Backreferences of the form '\number' or
* @start_position: starting index of the string to match
* @replacement: text to replace each match with
* @match_options: options for the match
- * @error: location to store the error occuring, or %NULL to ignore errors
+ * @error: location to store the error occurring, or %NULL to ignore errors
*
* Replaces all occurrences of the pattern in @regex with the
* replacement text. @replacement is replaced literally, to
* @match_options: options for the match
* @eval: a function to call for each match
* @user_data: user data to pass to the function
- * @error: location to store the error occuring, or %NULL to ignore errors
+ * @error: location to store the error occurring, or %NULL to ignore errors
*
* Replaces occurrences of the pattern in regex with the output of
* @eval for that occurrence.
unsigned output_len;
/** Bitmask of CPU flags required to run this PRF. */
uint32_t required_cpucap;
- /** Pointer to a function to intialize a state structure for the PRF.
+ /** Pointer to a function to initialize a state structure for the PRF.
*
* @param state An object of size at least (state_len) that will
* hold the state and any derived values. It must be aligned to
* - `yaml` - embedded yaml
*
* If `var` contains function, they are called during output formatting and if
- * they return string value, then this value is used for ouptut.
+ * they return string value, then this value is used for output.
* @param {variant} var any sort of lua variable (if userdata then metafield `__to_ucl` is searched for output)
* @param {string} format any available format
* @return {string} string representation of `var` in the specific `format`.
UCL_EMACRO, /**< Error processing a macro */
UCL_EINTERNAL, /**< Internal unclassified error */
UCL_ESSL, /**< SSL error */
- UCL_EMERGE /**< A merge error occured */
+ UCL_EMERGE /**< A merge error occurred */
} ucl_error_t;
/**
const char *key; /**< Key of an object */
struct ucl_object_s *next; /**< Array handle */
struct ucl_object_s *prev; /**< Array handle */
- uint32_t keylen; /**< Lenght of a key */
+ uint32_t keylen; /**< Length of a key */
uint32_t len; /**< Size of an object */
uint32_t ref; /**< Reference count */
uint16_t flags; /**< Object flags */
const ucl_object_t *obj);
/**
- * Get the next object from the `obj`. This fucntion iterates over arrays, objects
+ * Get the next object from the `obj`. This function iterates over arrays, objects
* and implicit arrays
* @param iter safe iterator
* @param expand_values expand explicit arrays and objects
};
/**
- * Get the next object from the `obj`. This fucntion iterates over arrays, objects
+ * Get the next object from the `obj`. This function iterates over arrays, objects
* and implicit arrays if needed
* @param iter safe iterator
* @param
* Move comment from `from` object to `to` object
* @param comments comments object
* @param what source object
- * @param whith destination object
+ * @param with destination object
* @return `true` if `from` has comment and it has been moved to `to`
*/
UCL_EXTERN bool ucl_comments_move (ucl_object_t *comments,
struct ucl_schema_error {
enum ucl_schema_error_code code; /**< error code */
char msg[128]; /**< error message */
- const ucl_object_t *obj; /**< object where error occured */
+ const ucl_object_t *obj; /**< object where error occurred */
};
/**
* @param schema schema object
* @param obj object to validate
* @param err error pointer, if this parameter is not NULL and error has been
- * occured, then `err` is filled with the exact error definition.
+ * occurred, then `err` is filled with the exact error definition.
* @return true if `obj` is valid using `schema`
*/
UCL_EXTERN bool ucl_object_validate (const ucl_object_t *schema,
* @param obj object to validate
* @param root root schema object
* @param err error pointer, if this parameter is not NULL and error has been
- * occured, then `err` is filled with the exact error definition.
+ * occurred, then `err` is filled with the exact error definition.
* @return true if `obj` is valid using `schema`
*/
UCL_EXTERN bool ucl_object_validate_root (const ucl_object_t *schema,
* @param root root schema object
* @param ext_refs external references (might be modified during validation)
* @param err error pointer, if this parameter is not NULL and error has been
- * occured, then `err` is filled with the exact error definition.
+ * occurred, then `err` is filled with the exact error definition.
* @return true if `obj` is valid using `schema`
*/
UCL_EXTERN bool ucl_object_validate_root_ext (const ucl_object_t *schema,
}
switch (obj->type) {
case UCL_INT:
- *target = obj->value.iv; /* Probaly could cause overflow */
+ *target = obj->value.iv; /* Probably could cause overflow */
break;
case UCL_FLOAT:
case UCL_TIME:
/*
** Computes the 'first set' of a pattern.
-** The result is a conservative aproximation:
+** The result is a conservative approximation:
** match p ax -> x (for some x) ==> a belongs to first(p)
** or
** a not in first(p) ==> match p ax -> fail (for all x)
/*
-** Repetion; optimizations:
+** Repetition; optimizations:
** When pattern is a charset, can use special instruction ISpan.
** When pattern is head fail, or if it starts with characters that
** are disjoint from what follows the repetions, a simple test
** is enough (a fail inside the repetition would backtrack to fail
** again in the following pattern, so there is no need for a choice).
-** When 'opt' is true, the repetion can reuse the Choice already
+** When 'opt' is true, the repetition can reuse the Choice already
** active in the stack.
*/
static void coderep (CompileState *compst, TTree *tree, int opt,
/*
-** Main code-generation function: dispatch to auxiliar functions
+** Main code-generation function: dispatch to auxiliary functions
** according to kind of tree. ('needfollow' should return true
** only for consructions that use 'fl'.)
*/
/*
-** Concatentate the contents of table 'idx1' into table 'idx2'.
+** Concatenate the contents of table 'idx1' into table 'idx2'.
** (Assume that both indices are negative.)
** Return the original length of table 'idx2' (or 0, if no
** element was added, as there is no need to correct any index).
/*
-** create a new tree, whith a new root and one sibling.
+** create a new tree, with a new root and one sibling.
** Sibling must be on the Lua stack, at index 1.
*/
static TTree *newroot1sib (lua_State *L, int tag) {
/*
-** create a new tree, whith a new root and 2 siblings.
+** create a new tree, with a new root and 2 siblings.
** Siblings must be on the Lua stack, first one at index 1.
*/
static TTree *newroot2sib (lua_State *L, int tag) {
Random and Pseudorandom Number Generators for Cryptographic
Applications (version 2.2.1) with 1000 bitstreams each containing
1M bits. MUM hashing is also faster Spooky64 and City64 on small
- strings (at least upto 512-bit) on Haswell and Power7. The MUM bulk
+ strings (at least up to 512-bit) on Has well and Power7. The MUM bulk
speed (speed on very long data) is bigger than Spooky and City on
Power7. On Haswell the bulk speed is bigger than Spooky one and
close to City speed. */
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
return _mum_bswap64 (v);
#else
-#error "Unknown endianess"
+#error "Unknown endianness"
#endif
}
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
return _mum_bswap32 (v);
#else
-#error "Unknown endianess"
+#error "Unknown endianness"
#endif
}
}
/* Hash data KEY of length LEN and SEED. The hash depends on the
- target endianess and the unroll factor. */
+ target endianness and the unroll factor. */
static inline uint64_t _MUM_INLINE
mum_hash (const void *key, size_t len, uint64_t seed) {
return _mum_hash_default (key, len, seed);
// #define XXH_ACCEPT_NULL_INPUT_POINTER 1
// XXH_FORCE_NATIVE_FORMAT :
-// By default, xxHash library provides endian-independant Hash values, based on little-endian convention.
+// By default, xxHash library provides endian-independent Hash values, based on little-endian convention.
// Results are therefore identical for little-endian and big-endian CPU.
// This comes at a performance cost for big-endian CPU, since some swapping is required to emulate little-endian format.
-// Should endian-independance be of no importance for your application, you may set the #define below to 1.
+// Should endian-independence be of no importance for your application, you may set the #define below to 1.
// It will improve speed for Big-endian CPU.
// This option has no impact on Little_Endian CPU.
#define XXH_FORCE_NATIVE_FORMAT 0
U32 *delDmerOcc = COVER_map_at(activeDmers, delDmer);
activeSegment.begin += 1;
*delDmerOcc -= 1;
- /* If this is the last occurence of the dmer, subtract its score */
+ /* If this is the last occurrence of the dmer, subtract its score */
if (*delDmerOcc == 0) {
COVER_map_remove(activeDmers, delDmer);
activeSegment.score -= freqs[delDmer];
} COVER_tryParameters_data_t;
/**
- * Tries a set of parameters and upates the COVER_best_t with the results.
+ * Tries a set of parameters and updates the COVER_best_t with the results.
* This function is thread safe if zstd is compiled with multithreaded support.
* It takes its parameters as an *OWNING* opaque pointer to support threading.
*/
Doxydown is extremely simple as it can output markdown only but it is very
convenient tool to generate nice markdown with all features required from the
documentation system. Doxydown uses input format that is very close to `doxygen`
-that allows to re-use the existing documentation comments. Currenly, doxydown
+that allows to re-use the existing documentation comments. Currently, doxydown
does not support many features but they could be easily added on demand.
## Input format
$language = $languages{c};
}
-## TODO: select language based on file extention
+## TODO: select language based on file extension
## TODO: change calling structure to allow looping through directory
use constant {
if mid:find("@%[%d+%.%d+%.%d+%.%d+%]") then
task:insert_result('MID_RHS_IP_LITERAL', 1.0)
end
- -- Check From address atrributes against MID
+ -- Check From address attributes against MID
local from = task:get_from(2)
if (from and from[1] and from[1].domain and from[1].domain ~= '') then
local fd = from[1].domain:lower()
-- https://technet.microsoft.com/en-us/library/dn205071(v=exchg.150).aspx
re = 'X-Forefront-Antispam-Report=/SFV:SPM/H',
score = 10,
- description = "Microsoft says the messge is spam",
+ description = "Microsoft says the message is spam",
group = 'upstream_spam_filters'
}
guint64 fuzzy_hashes_expired;
/**< number of fuzzy hashes expired */
guint64 fuzzy_hashes_checked[RSPAMD_FUZZY_EPOCH_MAX];
- /**< ammount of check requests for each epoch */
+ /**< amount of check requests for each epoch */
guint64 fuzzy_shingles_checked[RSPAMD_FUZZY_EPOCH_MAX];
- /**< ammount of shingle check requests for each epoch */
+ /**< amount of shingle check requests for each epoch */
guint64 fuzzy_hashes_found[RSPAMD_FUZZY_EPOCH_MAX];
/**< amount of hashes found by epoch */
guint64 invalid_requests;
BLAKE2B_DECLARE(ref)
#define BLAKE2B_GENERIC BLAKE2B_IMPL(0, "generic", ref)
-/* list implemenations from most optimized to least, with generic as the last entry */
+/* list implementations from most optimized to least, with generic as the last entry */
static const blake2b_impl_t blake2b_list[] = {
BLAKE2B_GENERIC,
#if defined(BLAKE2B_AVX)
state->leftover = 0;
}
-/* processes inlen bytes (can do partial blocks), handling input/ouput alignment */
+/* processes inlen bytes (can do partial blocks), handling input/output alignment */
static void
chacha_consume (chacha_state_internal *state,
const unsigned char *in, unsigned char *out, size_t inlen)
/**
* Decrypt and verify data chunk inplace
* @param data data to decrypt
- * @param len lenght of data
+ * @param len length of data
* @param pk remote pubkey
* @param sk local privkey
* @param sig signature input
/**
* Decrypt and verify data chunk inplace
* @param data data to decrypt
- * @param len lenght of data
+ * @param len length of data
* @param pk remote pubkey
* @param sk local privkey
* @param sig signature input
* pubkey
* @param sig signature source
* @param m input message
- * @param mlen message lenght
+ * @param mlen message length
* @param pk public key for verification
* @return true if signature is valid, false otherwise
*/
POLY1305_DECLARE(ref)
#define POLY1305_GENERIC POLY1305_IMPL(0, "generic", ref)
-/* list implemenations from most optimized to least, with generic as the last entry */
+/* list implementations from most optimized to least, with generic as the last entry */
static const poly1305_impl_t poly1305_list[] =
{
POLY1305_GENERIC,
#define SIPHASH_AVX2 SIPHASH_IMPL(CPUID_AVX2, "avx2", avx2)
#endif
-/* list implemenations from most optimized to least, with generic as the last entry */
+/* list implementations from most optimized to least, with generic as the last entry */
static const siphash_impl_t siphash_list[] = {
SIPHASH_GENERIC,
#if defined(SIPHASH_AVX2)
/**
* @file filter.h
- * Filters logic implemetation
+ * Filters logic implementation
*/
#ifndef RSPAMD_FILTER_H
GQuark type; /**< type of worker */
struct rspamd_worker_bind_conf *bind_conf; /**< bind configuration */
guint16 count; /**< number of workers */
- GList *listen_socks; /**< listening sockets desctiptors */
+ GList *listen_socks; /**< listening sockets descriptors */
guint32 rlimit_nofile; /**< max files limit */
guint32 rlimit_maxcore; /**< maximum core file size */
GHashTable *params; /**< params for worker */
/**
* Adds new documentation option specified by path `doc_path` that should be
- * splitted by dots
+ * split by dots
*/
ucl_object_t *rspamd_rcl_add_doc_by_path (struct rspamd_config *cfg,
const gchar *doc_path,
#define CM_NO_INDENT (1 << 18)
/* Elements that are obsolete (such as "dir", "menu"). */
#define CM_OBSOLETE (1 << 19)
-/* User defined elements. Used to determine how attributes wihout value
+/* User defined elements. Used to determine how attributes without value
should be printed. */
#define CM_NEW (1 << 20)
/* Elements that cannot be omitted. */
}
else if (g_ascii_strncasecmp (*begin, SPF_SCOPE_MFROM,
sizeof (SPF_SCOPE_MFROM) - 1) == 0) {
- /* mfrom is standart spf1 check */
+ /* mfrom is standard spf1 check */
*begin += sizeof (SPF_SCOPE_MFROM) - 1;
continue;
}
struct symbols_cache *cache, gint stage);
/**
- * Validate cache items agains theirs weights defined in metrics
+ * Validate cache items against theirs weights defined in metrics
* @param cache symbols cache
* @param cfg configuration
* @param strict do strict checks - symbols MUST be described in metrics
double time_virtual_finish;
struct timeval tv;
gboolean (*fin_callback)(struct rspamd_task *task, void *arg);
- /**< calback for filters finalizing */
+ /**< callback for filters finalizing */
void *fin_arg; /**< argument for fin callback */
struct rspamd_dns_resolver *resolver; /**< DNS resolver */
struct rspamd_email_address* rspamd_task_get_sender (struct rspamd_task *task);
/**
- * Return addresses in the following precendence:
+ * Return addresses in the following precedence:
* - deliver to
* - the first smtp recipient
* - the first mime recipient
* Parse string with ipv6 address of length `len` to `target` which should be
* at least sizeof (in6_addr_t)
* @param text input string
- * @param len lenth of `text` (if 0, then `text` must be zero terminated)
+ * @param len length of `text` (if 0, then `text` must be zero terminated)
* @param target target structure
* @return TRUE if the address has been parsed, otherwise `target` content is undefined
*/
* Parse string with ipv4 address of length `len` to `target` which should be
* at least sizeof (in4_addr_t)
* @param text input string
- * @param len lenth of `text` (if 0, then `text` must be zero terminated)
+ * @param len length of `text` (if 0, then `text` must be zero terminated)
* @param target target structure
* @return TRUE if the address has been parsed, otherwise `target` content is undefined
*/
guint32 tmp;
/*
* xor in the current byte against each byte of hval
- * (which alone gaurantees that every bit of input will have
+ * (which alone guarantees that every bit of input will have
* an effect on the output)
*/
tmp = c & 0xFF;
char c, gsize len) G_GNUC_WARN_UNUSED_RESULT;
/**
- * Erase `len` characters at postion `pos`
+ * Erase `len` characters at position `pos`
*/
void rspamd_fstring_erase (rspamd_fstring_t *str, gsize pos, gsize len);
void rspamd_http_router_free (struct rspamd_http_connection_router *router);
/**
- * Extract arguments from a messsage's URI contained inside query string decoding
+ * Extract arguments from a message's URI contained inside query string decoding
* them if needed
* @param msg HTTP request message
* @return new GHashTable which maps rspamd_ftok_t* to rspamd_ftok_t*
}
/* Fill buffer */
if (rspamd_log->io_buf.size < len) {
- /* Buffer is too small to hold this string, so write it dirrectly */
+ /* Buffer is too small to hold this string, so write it directly */
rspamd_log_flush (rspamd_log);
direct_write_log_line (rspamd_log, (void *) iov, iovcnt, TRUE);
}
else if (rspamd_log->io_buf.used + len >= rspamd_log->io_buf.size) {
- /* Buffer is full, try to write it dirrectly */
+ /* Buffer is full, try to write it directly */
rspamd_log_flush (rspamd_log);
fill_buffer (rspamd_log, iov, iovcnt);
}
return 0;
}
else {
- /* Unsinged version - just open file */
+ /* Unsigned version - just open file */
cbd->shmem_data = rspamd_http_message_shmem_ref (msg);
cbd->data_len = msg->body_buf.len;
rspamd_mempool_rwlock_t * rspamd_mempool_get_rwlock (rspamd_mempool_t *pool);
/**
- * Aquire read lock
+ * Acquire read lock
* @param lock rwlock object
*/
void rspamd_mempool_rlock_rwlock (rspamd_mempool_rwlock_t *lock);
/**
- * Aquire write lock
+ * Acquire write lock
* @param lock rwlock object
*/
void rspamd_mempool_wlock_rwlock (rspamd_mempool_rwlock_t *lock);
* @param in
* @param len
* @param cb if callback returns non-zero, then search is terminated and that value is returned
- * @param ud calback data
+ * @param ud callback data
* @return
*/
gint rspamd_multipattern_lookup (struct rspamd_multipattern *mp,
/**
* Callback used for common printf operations
* @param buf buffer to append
- * @param buflen lenght of the buffer
+ * @param buflen length of the buffer
* @param ud opaque pointer
* @return number of characters written
*/
* @param tree radix trie
* @param key key to insert (bitstring)
* @param keylen length of the key (in bytes)
- * @param masklen lenght of mask that should be applied to the key (in bits)
+ * @param masklen length of mask that should be applied to the key (in bits)
* @param value opaque value pointer
* @return previous value of the key or `RADIX_NO_VALUE`
*/
gboolean rspamd_gstring_icase_equal (gconstpointer v, gconstpointer v2);
/**
- * Copy src to dest limited to len, in compare with standart strlcpy(3) rspamd strlcpy does not
+ * Copy src to dest limited to len, in compare with standard strlcpy(3) rspamd strlcpy does not
* traverse the whole string and it is possible to use it for non NULL terminated strings. This is
* more like memccpy(dst, src, size, '\0')
*
metric = rspamd_config_new_metric (cfg, metric, name);
}
- /* Now iterate throught module table */
+ /* Now iterate through module table */
for (lua_pushnil (L); lua_next (L, -2); lua_pop (L, 1)) {
/* key - -2, value - -1 */
symbol =
gsize keylen;
GError *err = NULL;
- /* First check all module options that may be overriden in 'config' global */
+ /* First check all module options that may be overridden in 'config' global */
lua_getglobal (L, "config");
if (lua_istable (L, -1)) {
* - `weight`: weight of symbol (should normally be 1 or missing)
* - `priority`: priority of symbol (normally 0 or missing)
* - `type`: type of symbol: `normal` (default), `virtual` or `callback`
- * - `flags`: various flags splitted by commas or spaces:
+ * - `flags`: various flags split by commas or spaces:
* + `nice` if symbol can produce negative score;
* + `empty` if symbol can be called for empty messages
* + `skip` if symbol should be skipped now
/***
* @method rspamd_config:__newindex(name, callback)
* This metamethod is called if new indicies are added to the `rspamd_config` object.
- * Technically, it is the equialent of @see rspamd_config:register_symbol where `weight` is 1.0.
+ * Technically, it is the equivalent of @see rspamd_config:register_symbol where `weight` is 1.0.
* There is also table form invocation that allows to control more things:
*
* - `callback`: has the same meaning and acts as function of task
/***
* @method rspamd_config:register_regexp(params)
* Registers new re for further cached usage
- * Params is the table with the follwoing fields (mandatory fields are marked with `*`):
+ * Params is the table with the following fields (mandatory fields are marked with `*`):
* - `re`* : regular expression object
* - `type`*: type of regular expression:
* + `mime`: mime regexp
/***
* @method rspamd_config:replace_regexp(params)
* Replaces regexp with a new one
- * Params is the table with the follwoing fields (mandatory fields are marked with `*`):
+ * Params is the table with the following fields (mandatory fields are marked with `*`):
* - `old_re`* : old regular expression object (must be in the cache)
* - `new_re`* : old regular expression object (must not be in the cache)
*/
* Adds new callback that is called on worker process termination when all
* tasks pending are processed
*
- * @param callback {function} a fucntion with one argument (rspamd_task)
+ * @param callback {function} a function with one argument (rspamd_task)
*/
LUA_FUNCTION_DEF (config, register_finish_script);
* "priority" - optional priority
* "type" - optional type (normal, virtual, callback)
* -- Metric options
- * "score" - optional default score (overrided by metric)
+ * "score" - optional default score (overridden by metric)
* "group" - optional default group
* "one_shot" - optional one shot mode
* "description" - optional description
* - `src` - link to the source
* - `height` - height in pixels
* - `width` - width in pixels
- * - `embeded` - `true` if an image is embedded in a message
+ * - `embedded` - `true` if an image is embedded in a message
* @return {table} table of images in html part
*/
LUA_FUNCTION_DEF (html, get_images);
* @param {string} mime_type MIME type of the HTTP content (for example, `text/html`)
* @param {string/text} body full body content, can be opaque `rspamd{text}` to avoid data copying
* @param {number} timeout floating point request timeout value in seconds (default is 5.0 seconds)
- * @return {boolean} `true` if a request has been successfuly scheduled. If this value is `false` then some error occurred, the callback thus will not be called
+ * @return {boolean} `true` if a request has been successfully scheduled. If this value is `false` then some error occurred, the callback thus will not be called
*/
static gint
lua_http_request (lua_State *L)
/***
* @method mime_part:get_filename()
- * Extract filename associated with mime part if it is an attachement
+ * Extract filename associated with mime part if it is an attachment
* @return {string} filename or `nil` if no file is associated with this part
*/
LUA_FUNCTION_DEF (mimepart, get_filename);
*/
LUA_FUNCTION_DEF (task, get_ev_base);
/***
- * @method task:insert_result(symbol, weigth[, option1, ...])
+ * @method task:insert_result(symbol, weight[, option1, ...])
* Insert specific symbol to the tasks scanning results assigning the initial
* weight to it.
* @param {string} symbol symbol to insert
* - `greylist`: greylist message
* - `accept` or `no action`: whitelist message
* @param {rspamd_action or string} action a numeric or string action value
- * @param {string} description optional descripton
+ * @param {string} description optional description
@example
local function cb(task)
local gr = task:get_header('Greylist')
* - `real_ip` - string representation of IP as resolved by PTR request of MTA
* - `by_hostname` - MTA hostname
* - `proto` - protocol, e.g. ESMTP or ESMTPS
- * - `timestamp` - received timetamp
+ * - `timestamp` - received timestamp
* - `for` - for value (unparsed mailbox)
*
* Please note that in some situations rspamd cannot parse all the fields of received headers.
/***
* @method task:process_re(params)
* Processes the specified regexp and returns number of captures (cached or new)
- * Params is the table with the follwoing fields (mandatory fields are marked with `*`):
+ * Params is the table with the following fields (mandatory fields are marked with `*`):
* - `re`* : regular expression object
* - `type`*: type of regular expression:
* + `mime`: mime regexp
* + `url`: url regexp
* - `header`: for header and rawheader regexp means the name of header
* - `strong`: case sensitive match for headers
- * @return {number} number of regexp occurences in the task (limited by 255 so far)
+ * @return {number} number of regexp occurrences in the task (limited by 255 so far)
*/
LUA_FUNCTION_DEF (task, process_regexp);
* @function util.tokenize_text(input[, exceptions])
* Create tokens from a text using optional exceptions list
* @param {text/string} input input data
- * @param {table} exceptions, a table of pairs containing <start_pos,lenght> of exceptions in the input
+ * @param {table} exceptions, a table of pairs containing <start_pos,length> of exceptions in the input
* @return {table/strings} list of strings representing words in the text
*/
LUA_FUNCTION_DEF (util, tokenize_text);
--- Register symbol in metric
-- @param symbol name of symbol
-- @param weight weight of symbol
--- @param callback fucntion that would be called as callback for symbol
+-- @param callback function that would be called as callback for symbol
function metric:register_symbol (symbol, weight, callback)
------------------------------------- TASK -------------------------------------------
return 1;
}
-/* XXX: This fucntions should be rewritten completely */
+/* XXX: This functions should be rewritten completely */
static int
lua_worker_get_option (lua_State *L)
{
if (!is_hash) {
/* Allocate message from string */
- /* XXX: what about encrypted messsages ? */
+ /* XXX: what about encrypted messages ? */
task->msg.begin = msg->body_buf.begin;
task->msg.len = msg->body_buf.len;
end
else
local is_authed = false
- -- XXX: reporting address could be overidden
+ -- XXX: reporting address could be overridden
for _, r in ipairs(results) do
if string.match(r, 'v=DMARC1') then
is_authed = true
-- Majordomo detector
-- Check Sender for owner- or -owner
--- Check Precendence for 'Bulk' or 'List'
+-- Check Precedence for 'Bulk' or 'List'
--
-- And nothing more can be extracted :(
local function check_ml_majordomo(task)
local ucl = require "ucl"
local fun = require "fun"
--- Checks for overrided settings within query params and returns 'true' if
--- settings are overrided
+-- Checks for overridden settings within query params and returns 'true' if
+-- settings are overridden
local function check_query_settings(task)
-- Try 'settings' attribute
local query_set = task:get_request_header('settings')
'Mail::SpamAssassin::Plugin::HTMLEval',
}
--- Table that replaces SA symbol with rspamd equialent
+-- Table that replaces SA symbol with rspamd equivalent
-- Used for dependency resolution
local symbols_replacements = {
-- SPF replacements
gboolean is_http;
/* JSON output */
gboolean is_json;
- /* Allow learning throught worker */
+ /* Allow learning through worker */
gboolean allow_learn;
/* Limit of tasks */
guint32 max_tasks;
local _VERSION = "0.6.0"
---- The status codes that can be returned by an invoked test. These should not be overidden.
+--- The status codes that can be returned by an invoked test. These should not be overridden.
-- @name status_codes
-- @class table
-- @field err - This is returned when an invoked test results in an error
}
--- Labels used to show the various <tt>status_codes</tt> as a single character.
--- These can be overidden if you wish.
+-- These can be overridden if you wish.
-- @name status_labels
-- @class table
-- @see status_codes
{'(((A))', nil},
-- Balanced braces
{'(((A)))', '(A)'},
- -- Plus and comparision operators
+ -- Plus and comparison operators
{'A + B + C + D > 2', '2 (A) (B) (C) (D) +(4) >'},
-- Plus and logic operators
{'((A + B + C + D) > 2) & D', '(D) 2 (A) (B) (C) (D) +(4) > &'},
my @ham;
my $max_samples = -1;
my $split = 1;
-my $preprocessed = 0; # ouptut is in format <score>:<0|1>:<SYM1,...SYMN>
+my $preprocessed = 0; # output is in format <score>:<0|1>:<SYM1,...SYMN>
my $score_spam = 12;
my $score_ham = -6;
=item B<--correlations>
-Additionaly print correlation rate for each symbol displayed. This routine calculates merely paired correlations between symbols.
+Additionally print correlation rate for each symbol displayed. This routine calculates merely paired correlations between symbols.
=item B<--search-pattern>