CREATE TABLE greylist (
    sender_host_address TEXT NOT NULL DEFAULT "",
    sender_address TEXT NOT NULL DEFAULT "",
    recipient_address TEXT NOT NULL DEFAULT "",
    block_expires INTEGER NOT NULL DEFAULT 0,
    record_expires INTEGER NOT NULL DEFAULT 0,
    blocked_count INTEGER NOT NULL DEFAULT 0,
    passed_count INTEGER NOT NULL DEFAULT 0,
    aborted_count INTEGER NOT NULL DEFAULT 0,
    origin_type TEXT NOT NULL DEFAULT "",
    create_time INTEGER NOT NULL DEFAULT 0,
    last_update INTEGER NOT NULL DEFAULT 0
);

CREATE UNIQUE INDEX triplet ON greylist (sender_host_address, sender_address, recipient_address);
CREATE INDEX record_expires ON greylist (record_expires);
