NAME

PublicCheck::MidStoreSql

Storage for PublicCheck::To using an SQL database.


DESCRIPTION

This is a storage mechanism for storing outbound message ID's, required by PublicCheck::To to check references.


CONFIGURATION

public_sql_password
The password to connect to the database.

public_sql_username
The username required to connect.

public_sql_dsn
The database DSN, (See perldoc DBI)

Additionally, the SQL used to construct the two queries can be changed, allowing you to use a different table, note however that the order of the question marks is significant. (and fixed)

public_sql_statement
Used whithout the 'strict' level reference checks.
        SELECT count(message_id) FROM mid_history WHERE message_id=? AND username=?

public_sql_strict_statement
Used when strict level checks are in place.

eval:public_check_references('strict')

        SELECT count(message_id) FROM mid_history WHERE message_id=? AND username=? AND email=?


SQL TABLE

You'll have to create your own SQL table, something like this:

  CREATE TABLE mid_history (
        username varchar(100) NOT NULL default '',
        email varchar(200) NOT NULL default '',
        message_id   varchar(127) NOT NULL,
        lastupdate timestamp NOT NULL,
        PRIMARY KEY  (username,message_id)
  ) TYPE=MyISAM;

The lastupdate is not required, but handy if you ever wanted to expire old ones.


POPULATING DATABASE

Not done, it's a local matter which needs to be done with an out-bound email filter.