
Create spamassassin rule sql update#
Update your Amavis configuration /etc/amavis/conf.d/50_user = ( ) # none, same, or separate database Nota Bene : while executing DROP TABLE users, don't be silly, and do not remove mysql users database. # mysql -u amavis_storage -p amavis_storage Load the initial schema from Amavis docs (usually located in /usr/share/doc/amavisd-new/ ).ĭelete unnecessary tables, as we will be using this database only for mail storage and not for lookups : Mysql> GRANT ALL PRIVILEGES ON amavis_storage.* TO FLUSH PRIVILEGES


D_REJECT : Postfix will answer REJECT to the distant mail server, and the distant mail server may produce a delivery status notification to the user.D_BOUNCE : mail will not be delivered, and a delivery status notification will be returned by Postifx to sender (except if the score exceeds the dsn_cutoff level).D_PASS : mail will be delivered to inbox.This is the purpose of $final_virus_destiny, $final_spam_destiny, $final_banned_destiny, $final_bad_header_destiny. Once the message is categorized by Amavis tests (through SpamAssassin, ClamAV, etc), Amavis decides if it should be delivered to user mailbox or not, and if a bounce will be issued. quarantine_cutoff_level : a message above that level will not be quarantined.dsn_cutoff_level : a message above that level will never trigger a bounce or a reject, whatever spam_destiny is.kill_level : a message above that score is taken to the final_spam_destiny, and quarantined, it will not be delivered unless D_PASS is set to final_spam_destiny.tag2_level : a message above that score will be marked as X-Spam-Status: Yes and the subject is changed if sa_spam_modifies_subj is set to true.tag_level : a message above that score will be tagged with X-Spam-Status, X-Spam-Score and X-Spam-Level headers.The category of test (spam test, antivirus, etc) and the score along with levels determines the actions Amavis will trigger, and the final destiny where the mail belongs. 2.3 Levels and cutoffsĪmavis uses Spamassassin to score the mail, in order to decide what to do with it. We will use the Storage DSN to set up a secondary database for quarantine storage, to not mess with existing ISPConfig database. 2.2 Lookup DSN and Storage DSNĭSN (Data Source Name) are the connection strings with host, username, and password, used to connect to databases.Īmavis can set two DSN : one for Policies lookup (used to retrieve ISPConfig policies from Panel), and one for storage of mail meta informations and quarantine. We will have to change values in that policies, to make the SQL quarantine working. If you struggle wondering why your message keeps getting smashed at level 4.5, look at the sa_tag_level in policies. The ISPConfig policies can be changed in tab Email => Spamfilter => Policy in ISPConfig panel. It means that whatever you would set as $sa_spam_subject_tag, $sa_tag_level_deflt, $sa_tag2_level_deflt, $sa_kill_level_deflt, $sa_dsn_cutoff_level, it will be overridden by per-user policies. ' ORDER BY spamfilter_wblist.priority DESC' ' WHERE (spamfilter_wblist.rid=?) AND (spamfilter_wblist.email IN (%k))'. $sql_select_white_black_list = 'SELECT wb FROM spamfilter_wblist'. ' WHERE spamfilter_users.email IN (%k) ORDER BY spamfilter_users.priority DESC' ' FROM spamfilter_users LEFT JOIN spamfilter_policy ON spamfilter_users.policy_id=spamfilter_policy.id'. The configuration file for Amavis, written by ISPConfig contains =

In a default ISPConfig installation per-user ISPConfig policies are loaded. Off-subject generic explanations 2.1 Amavis and ISPConfig policies ISPConfig policies, Tag-Levels Jump to Installation if you know what you are doing. Optional : a working mail server with PHP (for Mailzu).A working SQL (PostgreSQL, MySQL.) database.A working Postfix+Amavis stack with ISPConfig.
