Mail::...Network(3pm)
β¨ NAME β¨
Mail::SpamAssassin::Plugin::NeuralNetwork β bestie, this is the SpamAssassin plugin that checks your mail with a Fast Artificial Neural Network library π§ π
(yes, the manual page is literally called Mail::...Network(3pm) and yes, bestie, that is giving mysterious. anyway.)
πΈ SYNOPSIS πΈ
loadplugin Mail::SpamAssassin::Plugin::NeuralNetwork
like. that's it. that's the whole setup. iconic π
π¦ DESCRIPTION π¦
This plugin checks emails using a Neural Network algorithm. no cap, an actual little brain doing vibe checks on your inbox π§ β¨
π CAVEATS π
β οΈ okay this part is IMPORTANT, so listen up bestie:
The SpamAssassin learning subsystem routes all training through the Bayes scanner infrastructure. Which means π Mail::SpamAssassin::Plugin::Bayes must be loaded, and use_bayes 1 must be set, for this plugin's training to actually get triggered. no bayes, no training. it's giving "the group chat doesn't work without the group." π
Here's all the knobs you can turn, one by one π
use_neuralnetwork(0|1) β default:1. Whether to use Neural Network, if it is available. fr fr.neuralnetwork_data_dirdirname β default:undef. Where the NeuralNetwork plugin will store its data. ποΈneuralnetwork_min_text_lenn β default:256. Minimum number of characters of visible text required to run prediction or learning on a message. too short? not today, message. βneuralnetwork_min_word_lenn β default:4. Minimum token length considered when building the vocabulary and feature vectors.neuralnetwork_max_word_lenn β default:24. Maximum token length considered when building the vocabulary and feature vectors.neuralnetwork_vocab_capn β default:10000. Maximum number of vocabulary terms to retain; least-frequent terms are pruned when exceeded. byeeee to the flops π«Άneuralnetwork_cache_ttln β default:300. Time-to-live in seconds for the in-memory vocabulary and model caches. Set to0to disable caching.neuralnetwork_min_spam_countn β default:100. Minimum number of spam messages in the vocabulary required to enable prediction.neuralnetwork_min_ham_countn β default:100. Minimum number of ham messages in the vocabulary required to enable prediction.neuralnetwork_spam_thresholdf β default:0.6. Prediction values above this threshold are considered spam.neuralnetwork_ham_thresholdf β default:0.4. Prediction values below this threshold are considered ham.neuralnetwork_learning_ratef β default:0.1. Learning rate used by the underlying FANN network during incremental training. it's learning, we love a growth arc π±neuralnetwork_momentumf β default:0.1. Momentum used for training updates.neuralnetwork_train_epochsn β default:50. Number of training epochs to perform when learning a single message.neuralnetwork_train_algorithmβFANN_TRAIN_QUICKPROP|FANN_TRAIN_RPROP|FANN_TRAIN_BATCH|FANN_TRAIN_INCREMENTALβ default:FANN_TRAIN_RPROP. Algorithm used by the Fann neural network when training; might increase speed depending on the data volume. πββοΈπ¨neuralnetwork_lock_timeoutn β default:10. Maximum number of seconds to wait for the exclusive training lock before giving up and skipping the learn operation. Set to0to wait indefinitely. (yes, indefinitely. main character energy but make it a mutex π³)neuralnetwork_rprop_delta_maxn β default:0.5. Delta value to apply to the RPROP training replay loop.neuralnetwork_retrain_intervaln β default:100. Number of successfullearn_messagecalls between forced full retrains of the neural network from the persisted vocabulary. After each retrain, the incrementally-trained network is replaced with the freshly rebuilt one. Set to0to disable periodic retraining and keep online learning only.neuralnetwork_stopwordswords β default:"the and for with that this from there their have be not but you your". Space-separated list of stopwords to ignore when tokenizing text. the it-girls of words that don't get a seat at the table πneuralnetwork_autolearn0|1β default:0. When SpamAssassin declares a message a clear spam or ham during the message scan, and launches the auto-learn process, the message is autolearned as spam/ham in the same way as during the manual learning. Value0for this option disables the auto-learn process for this plugin.neuralnetwork_autolearn_vocab_only0|1β default:0. When set to1and auto-learn is enabled, autolearned messages update the vocabulary and training buffer but skip FANN model training and saving. This avoids slow I/O operations and temporary files duringspamdprocessing. The model is rebuilt from the accumulated vocabulary on the next manualsa-learnrun. ngl this one is the "do it later" queen πneuralnetwork_dsnβ default:none. The DBI dsn of the database to use.- For SQLite, the database will be created automatically if it does not already exist; the supplied path and file must be read/writable by the user running
spamassassinorspamd. - For MySQL/MariaDB or PostgreSQL, see
sql-directoryfor database table creation clauses. - You will need to have the proper DBI module for your database. For example
DBD::SQLite,DBD::mysql,DBD::MariaDBorDBD::Pg. - Minimum required SQLite version is
3.24.0(available fromDBD::SQLite 1.59_01). - Examples:
- For SQLite, the database will be created automatically if it does not already exist; the supplied path and file must be read/writable by the user running
neuralnetwork_dsn dbi:SQLite:dbname=/var/lib/spamassassin/NeuralNetwork.db
neuralnetwork_usernameβ default:none. The username that should be used to connect to the database. Not used for SQLite.neuralnetwork_passwordβ default:none. The password that should be used to connect to the database. Not used for SQLite. π shhhneuralnetwork_min_vocab_hitsn β default:10. Minimum number of tokens in the email that must exist in the vocabulary for prediction to run.
π₯ EVAL RULES π₯
these are the little rules you drop into your config, and they SLAP π β¨
check_neuralnetwork_spam()β Body eval rule. Returns true when the neural network prediction score exceedsneuralnetwork_spam_threshold(default0.6).check_neuralnetwork_ham()β Body eval rule. Returns true when the neural network prediction score is belowneuralnetwork_ham_threshold(default0.4).check_neuralnetwork(low, high)β Body eval rule accepting two optional floating-point arguments. Returns true when the raw prediction score falls within the inclusive range[low, high]. Defaults:low = 0.0,high = 1.0.
Use this rule to define finer-grained confidence tiers. π confidence TIERS, bestie, we love a ranking system:
body NN_CONFIDENT_SPAM eval:check_neuralnetwork(0.75, 1.0)
describe NN_CONFIDENT_SPAM Email classified as spam with high confidence by Neural Network
score NN_CONFIDENT_SPAM 2.0
body NN_PROBABLE_SPAM eval:check_neuralnetwork(0.55, 0.75)
describe NN_PROBABLE_SPAM Email classified as probable spam by Neural Network
score NN_PROBABLE_SPAM 1.0
body NN_PROBABLE_HAM eval:check_neuralnetwork(0.0, 0.4)
describe NN_PROBABLE_HAM Email classified as ham by Neural Network
score NN_PROBABLE_HAM -1.0
and that's the whole page, bestie! π this all came from the User Contributed Perl Documentation, running on perl v5.40.1, dated 2026-07-23, and the page signs off as Mail::...Network(3pm) ππ¦ go forth and let the neural net read your mail (respectfully) ππ«Ά
π¦ where this page comes from
- ubuntu stonking: spamassassin 4.0.2+svn1935691-1build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms