tablectl

tablectl - Mastertable Administration

tablectl command is for referring, editing, and updating mastertables in the database of bounceHammer. bounceHammer's database have 6 mastertables: Addressers (a sender's email address), SenderDomains (a domain part of an Addresser), Destinations (a domain part of a Recipient), HostGroups, Providers, and Reasons(of email bounce) .

Usage

You can edit and refer each mastertable (SenderDomains, Destinations, HostGroups, Providers, and Reasons) of bounceHammer by using tablectl command without SQL. This operation can be do with WebUI.

List the reasons of email bounce from the mastertable
# tablectl --list -tw
 
Insert "example.com" into SenderDomains table
# tablectl --table s --insert --name 'example.com' --description 'Example Corp.'
 
Update the description of Addresser (Sender's email address) table with specifying ID(=1)
# tablectl --update -ta --id 1 --description 'this is my address'
 
Delete the record from Destinations (The domain part of Recipient) table with specifying ID(=4)
# tablectl --remove -td --id 4
 
Show help messages
# tablectl --help

Available Options

Options for Controlling Mastertable

-t, --table Character
Specify the mastertable which you want to operate. Available characters which can be specified are a: Addresser (a sender's email address), s: SenderDomains (a domain part of an Addresser), d: Destinations (a domain part of a Recipient), h: HostGroups, p: Providers, and w: Reasons (of email bounce).
--list
List the records of the mastertable which is specified with -t option. --id, --nameoption is useful with this option. This option is equivalent to the SQL: SELECT * FROM ... WHERE ... .
--update
Update the record of the mastertable which is specified with -t option. The record ID with --id option should be specified. Updatable columns will be specified with the following options: --name, --decription, --disable . This option is equivalent to UPDATE statement in SQL.
--insert
Insert new record into the mastertable which is specified with -t option. The new record is given by the following options: --name, --description, --disable . This option is equivalent to INSERT statement in SQL.
--remove
Delete the record in the mastertable which is specified with -t option. The record you want to remove should be specified with --id option. This option is equivalent to the SQL: DELETE FROM ... WHERE id = ... .

Options for Specifying Column

--id the ID
This option is for specifying ID to update the record with --update option, to delete the record with --remove option, and to list the records with --list option. This option is equivalent to ... WHERE id = ... in SQL.
--name Name
This option is for specifying name of the record to insert with --insert option, to update with --update, and to list with --list option. This option is equivalent to ... WHERE name = "..." in SQL.
This option should be specified when you insert new record with --insert option.
--description Description
This option is for specifying description of the record to insert with --insert option, to update with --update option, and to list with --list option. This option is equivalent to ... WHERE description = "..." in SQL.
--disabled 1 or 0
This option is for specifying disabled-flag of the record to insert with --insert option, to update with --update option, and to list with --list option. This option is equivalent to ... WHERE disable = ... in SQL.

Other Options

-C, --conf /path/to/configuration file
Use an alternative bounceHammer's configuration file. If this option is omitted, the command will use INSTALL-DESTINATION/etc/bouncehammer.cf .
-T, --test
Runs as test mode. This option is equals to the option -C INSTALL-DESTINATION/etc/test-run.cf .
-F, --fotmat Character
Display the records which will be listed with --list option as the specified format. When this option is omitted, the records will be displayed as a YAML format. If one of either --insert, --update, --remove option is specified, This option will be ignored. Available characters are following: yaml: YAML, and asciitable: ASCII Table.
--silent (Beginning with ver.2.1.0)
Turn silent mode on. This option makes the command quiet in spite of -v, --verbose option (described later). And when the command is called from a daemon (such as sendmail), the command will exit with status 0 in spite of an error. If an MTA process (e.g. /usr/sbin/sendmail) which is called the command without this --silent option stopped by an error, the command will exit with status 75(EX_TEMPFAIL).
-v, --verbose
Turn verbose mode ON.
--help
Display help messages of this command.
--version
Display the version number of this command.

About SenderDomains Table

You should register domain names into SenderDomains table manually by using tablectl command or WebUI. bouncehammer is supposed to use like the following:

  • In many case, Sender's domain name of bounced email is under your control.
  • You or Your company are able to manage all of the domain names of yours.
  • SenderDomains table should hold sender's domain names only which you want to namage with bouncehammer

Information about how to register your domain names into SenderDomain table is availabe at Register domain names page.

Screenshot of the running command

tablectl -Fa --table senderdomain --list

The following screenshot shows that tablectl command list the records in SenderDomain table as a ASCII Table format.

No TrackBacks

TrackBack URL: http://bouncehammer.jp/cgi-bin/mt/mt-tb.cgi/106

Leave a comment