Amavisd has two settings to use its SQL tables:
@storage_sql_dsn uses 4 sql tables (
quarantine), and it's used to store:
@lookup_sql_dsn: uses 4 sql tables (
wblist), and it's used to store:
Note: iRedMail has addition sql table
outbound_wblist to store
white/blacklists for outbound emails, but it's used by iRedAPD (plugin
amavisd_wblist), not by Amavisd.
amavisd.mailaddr stores email addresses NOT hosted on your server.
Note: value of column
mailaddr.email could be something like below:
@.: a catch-all address.
@domain.com: entire domain.
@.domain.com: entire domain and all its sub-domains.
email@example.com: a single email address.
user@*: email addresses start with
user@. Note: This is used by iRedAPD, not Amavisd.
192.168.1.2: a single IP address. Note: This is used by iRedAPD, not Amavisd.
192.168.*.2: wildcard IP address. Note: This is used by iRedAPD, not Amavisd.
The addresses are used in several tables:
amavisd.wblist: used by Amavisd. If sender (of inbound message) is blacklisted, Amavisd will quarantine this email. But if you have iRedAPD plugin
amavisd_wblistenabled, this smtp session will be rejected before queued by Postfix, so Amavisd doesn't know this rejected message at all.
amavisd.outbound_wblist. New in iRedMail-0.9.3, used by iRedAPD plugin
amavisd_wblistfor white/blacklisting for outbound message.
amavisd.users stores mail addresses hosted on your server. NOTE: you
don't need to sync all existing mail users in this table, just add mail users
you want to define a per-account spam policy in this table.
Value of column
users.email uses same format as
amavisd.mailaddr mentioned above.
amavisd.wblist stores white/blacklists for inbound message.
(sender id) refers to
wblist.rid (recipient id) refers to
amavisd.outbound_wblist stores white/blacklists for outbound message.
outbound_wblist.sid (sender id) refers to
(recipient id) refers to
Note: this table is used by iRedAPD, not Amavisd.
amavisd.policy: used to define per-recipient spam policy, and max message
Since Amavisd will store basic info of every inbound/outbound email, the SQL
database will grow bigger and bigger, iRedMail setups a daily cron job to
clean up old records with script shipped in iRedAdmin (available in both
iRedAdmin open source edition and iRedAdmin-Pro):