Skip to content

CLI Documentation

Hunter Leath edited this page Jun 8, 2013 · 3 revisions

How to use the Provided Command Line Interface

The CLI is located in AD_ROOT/client/cli.go

Running the CLI

The Command Line Interface can run in either interactive (with the -i flag) or non-interactive modes.

For the purposes of this documentation, we will go over the program as if it were run in interactive mode and define the flags used to specify the options non-interactively.

Mode (-mode)

The first question that the program will ask you is the mode that you would like it to run in, acceptable answers are:

  • keygen - Generate the Signing Key Needed to Use Airdispatch
  • check - Check for New Mail
  • pub_check - Check for New Public Mail at an Address
  • send - Send a Message
  • alert - Alert a Server to A New Message
  • query - Query a Tracker
  • registration - Register an Address with a Tracker

After loading the key file, the CLI will inform you of your current airdispatch address.

Keygen

DESCRIPTION: The Keygen mode will generate and save airdispat.ch keys to the hard drive. They are stored in a single file.

After specifying the keygen mode, the CLI will ask you for a location to save your keys, this is a relative path to your current working directory. You must do this before using the client for more.

THIS IS NOT SECURE: USE THIS ONLY FOR TESTING PURPOSES.

Check

DESCRIPTION: The check mode will send a RET message to a specified mailserver to ask for new mail.

Other Parameters:

  • Remote Mailserver: the mailserver that is receiving messages for the address (flag: -remote)
  • File to Load Keys From: the keyfile generated from keygen (flag: -key)

Public Check

DESCRIPTION: The public check mode will send a RET message to a specified mailserver to ask for new public mail specified by a specific address.

Other Parameters:

  • Tracking Server: the server used to lookup the address (flag: -tracker)
  • Send or Query Address: the address that you want to download the public messages from (flag: -address)
  • File to Load Keys From: the file created in the keygen mode (flag: -key)
  • Retrive Messages Sent Since: the UNIX timestamp time of the earliest message that you want returned

Send

DESCRIPTION: The send mode will send a SEN message to a specified mailserver to deliver a message on our behalf. This must be run in interactive mode.

Other Parameters:

  • Remote Mailserver: the mailserver used to send the message
  • Send or Query Address: the address to deliver the message to
  • File to Load Keys From: the file created by keygen
  • Data Definition: a loop of asking for the data-type followed by the actual data (only in ASCII). You must specify done as the data type to finish creating the message and send it.

Alert

This mode should only be used to test mailservers that are unable to send alerts themselves.

Query

DESCRIPTION: The query mode will send a QUE message to a specified tracker to determine the location for the specified address.

Other Parameters:

  • Tracking Server: the tracker to query (flag: -tracker)
  • Send or Query Address: the address to query (flag: -address)
  • File to Load Keys From: the file created when the program was run in keygen mode (flag: -key)

Registration

DESCRIPTION: The registration mode will send a REG message to a specified tracker to publicly list the location of that address.

Other Parameters:

  • Tracking Server: the tracker to register on (flag: -tracker)
  • Location to Send Messages to: the mailserver to list as the location for the address (flag: -location)
  • File to Load Keys From: the key file generated in the keygen mode (flag: -key)