SYNOPSIS
Nm mgidOp Fl IqvdpROp Fl r Ar rcfileOp Fl c Ar 'command'Op Fl P Ar pidfileOp Fl

DESCRIPTION
The mgid (or csoftadm) client is a simple command-line tool that interacts with the mgid daemon. Originally designed for csoft.net servers (http://www.csoft.net/), mgid is a privilege-separated daemon which provides users on a multi-user Unix system (or a redundant array of Unix systems) with limited control over specific server configuration settings.

This manual page gives only a short description of the various commands that are implemented by most stock mgid configurations. For an extensive set of examples, see: http://www.csoft.net/docs/cadm/.

The command-line options are as follows:
-Issue multiple commands read from the standard input. This operation mode implies the Fl Iflag.
Fl IDisable interactive prompts.
Fl qOnly print error messages.
Fl vPrint the mgid version and exit.
Fl dEnable debug mode.
Fl pPing the backend, print the latency, then exit. If the backend is unavailable, an exit code of 1 is returned.
Fl RIgnore the system-wide initialization script (see FILES section below).
Fl rRun an alternate initialization script on startup. The script file may contain any valid mgid command.
Fl cIssue a single command and exit immediately. This operation mode implies the Fl Iflag.
Fl PSet a unique PID file for the client to use. This option is recommended in order to avoid multiple client instances when invoking mgid from a crontab.

COMMANDS
The following commands may be typed at the prompt. The TAB key performs context-sensitive command completion. When used interactively (the default operation mode), mgid will prompt for any parameter that is omitted on the command line.


MAIL CONFIGURATION
Each e-mail address (or macro) configured under your account is associated with a list of instructions, determining the way incoming e-mail is processed. Instructions can have associated conditionals. For example, you can instruct messages that have been determined to be spam, to be discarded or delivered to a specific mailbox folder.

Note that if using multiple instructions with conditionals, and more than one conditional evaluates to true, only the first instruction in the list will be executed, without any further processing.

The table below summarizes the different types of mail delivery instructions that are supported by our mail system:
mailbox-nameE-mail is delivered to the named mailbox account (as configured previously using mail mbox add, see MAILBOXES section for details).
user@domain.extE-mail is forwarded to the given e-mail address, which may be either locally-hosted or external to the server. To prevent blacklisting due to spam, if the target address is hosted with a provider that enforces site-wide spam filtering, it is recommended that you pre-filter the mail for spam, by using at least a "spam<=5.0" conditional.
./path/to/fileMessages are written to the given file, in standard "flat-mailbox" format.
./path/to/directory/Messages are written to the given maildir directory structure.
¯o-nameMessages are further processed by the specified "mail macro". Mail macros are treated just like ordinary e-mail addresses, with their own list of delivery instructions (use mail rule add to create a new macro).
|program argsThe given program is executed on the server and contents of the incoming e-mails is piped to its standard input. Do not use this feature unless you are familiar with Ux .The standard procmail and maildrop filters are available on the server, for users who are familiar with them. Note that our mail system will always insert a X-Csoft-Pipe header in mail delivered this way, so that loops may be detected.

When using the more advanced mail rule add command over mail alias add, conditionals may be specified. The table below summarizes the different conditionals supported by our mail system:
anyAlways evaluate to true.
spamAlways evaluate to true, but check for spam and insert SpamAssassin headers into the message.
spam<=>nSpam threshold is less than (spam<=n), or greater than (spam>=n) the specified score (note that behavior if score is exactly n is not important: if using multiple rules and score is exactly n, only the first rule will be processed). When using the default SpamAssassin configuration, a score around 5.0 is possibly spam and 7.0 is very likely spam.
size<=>nThe message body is less than or greater than the given size in bytes. The "K" and "M" suffixes are recognized.
sender=user@domain.extSender envelope address matches this value.
client_address=1.2.3.4Numerical IP address of the sender matches this value.

MAIL ADDRESS CONFIGURATION
This function configures the way that e-mail to a given locally hosted e-mail address is processed.
XoIc mailIc aliasIc listOp Ar stringXcDisplay the list of all e-mail address currently configured under your account (or only those matching the given string if one is passed).
XoIc mailIc aliasIc addOp Ar user@domain.extOp Ar instruction1Op Ar ...XcConfigure a new e-mail address Ar user@domain.ext ,and arrange for mail delivered to that address to be processed unconditionally per the given instruction. The domain name of the address must have been previously configured (see the DNS section). See MAIL CONFIGURATION for the list of supported instructions.
XoIc mailIc aliasIc rcpt-addOp Ar user@domain.extOp Ar instruction1Op Ar ...XcAppend an unconditional instruction to an existing address.
XoIc mailIc aliasIc rcpt-delOp Ar user@domain.extOp Ar instruction1Op Ar ...XcRemove an unconditional instruction from an address.
XoIc mailIc aliasIc delOp Ar user@domain.extOp Ar ...XcRemove the given e-mail address (or list of addresses). Messages sent to a removed address will be bounced.
XoIc mailIc ruleIc addOp Ar user@domain.ext | ¯o-nameOp Ar conditionOp Ar instructionXcMore advanced version of mail alias add with support for conditionals. This command will configure a new address, or append a new condition/instruction rule to an existing address. See MAIL CONFIGURATION for the list of supported instructions.

Instead of an address, a "macro" may be specified. Macros are specified as "&foo", where "foo" is an arbitrary name, and are configured just like ordinary addresses. Once the "&foo" macro is created, "&foo" becomes a valid destination for mail alias add or mail rule add.
XoIc mailIc ruleIc delOp Ar user@domain.ext | ¯o-nameOp Ar conditionOp Ar instructionXcRemove the specified condition/instruction rule from an e-mail address or macro. If Ar conditionis set to " * ", the address or macro is simply deleted.


MAILBOXES
Mail accounts (also referred to as "mailboxes") store incoming messages in mbox or maildir format. Users can then retrieve the mailbox contents from a remote mail client program (such as Mozilla Thunderbird) via POP3 or IMAP. Our web interface also allows mailbox users to log in and use a simple webmail interface to access their mail. Depending on the parent account's hosting package, users of mail accounts may be provided with shell access and programs such as mutt and alpine.
XoIc mailIc mboxIc addOp Ar mailbox-nameOp Ar passwordXcCreate a new mailbox called Ar mailbox-name .Mailbox names are only relevant to POP3/IMAP authentication. No e-mail address is associated with the mailbox until an alias is added with the XoIc mailIc aliasIc addXccommand.
XoIc mailIc mboxIc delOp Ar mailbox-name1Op Ar mailbox-name2Op Ar ...XcDelete the given mailboxes (but not the associated aliases).
XoIc mailIc mboxIc listOp Ar mailbox-name1Op Ar mailbox-name2Op Ar ...XcDisplay a list of all the active mailboxes, or only the ones with names matching the arguments.
XoIc mailIc mboxIc passOp Ar mailbox-nameOp Ar passwordXcChange the password of a mailbox account. Passing the password on the command line is deprecated, since it will be saved as plaintext in history files.
XoIc mailIc mboxIc maildirOp Ar mailbox-nameXcSwitch a mailbox to maildir format. This is only available on hosts running qmail.
XoIc mailIc mboxIc mboxOp Ar mailbox-nameXcSwitch a mailbox to mbox format.


DOMAIN NAME SERVICE
Users with the dns privilege can add, delete and modify named zone files they own.
XoIc dnsIc addOp Ar hostOp Ar destinationXcPoint a domain/subdomain to an IP address or another hostname. The Ar destinationargument is either an IPv4 address, an IPv6 address or a valid CNAME. For subdomains, a CNAME of " @ " makes the subdomain resolve to the parent domain's address.
XoIc dnsIc delOp Ar host1Op Ar host2Op Ar ...XcIf Ar hostis a subdomain, remove it from its parent zone file. If Ar hostis a domain name, remove its zone file entirely.
XoIc dnsIc listOp Ar host1Op Ar host2Op Ar ...XcDisplay the list of active domain names. If arguments are given, subdomains of the matching domain names are shown as well. If no argument is given, subdomains are not shown.
XoIc dnsIc zoneOp Ar host1Op Ar host2Op Ar ...XcSame as XoIc dnsIc listXcexcept that all RR (Resource Records) defined by the zone files are shown.
XoIc dnsIc soaOp Ar domain-nameOp Ar email-addressXcModify the e-mail address in the SOA (Start-Of-Authority) record for a given domain name.
XoIc dnsIc mxIc addOp Ar hostnameOp Ar mail-serverXcAdd a MX (Mail eXchanger) record to Ar hostname ,which may be either a domain name or a subdomain. The priority of the last MX record + 10 is assigned to the new MX.
XoIc dnsIc mxIc delOp Ar hostnameOp Ar mail-serverXcRemove Ar mail-serverfrom the list of MX records associated with Ar hostname .
XoIc dnsIc nsIc addOp Ar hostnameOp Ar name-serverXcAdd a NS (Name Server) record to Ar hostname ,which may be either a domain name or a subdomain.
XoIc dnsIc nsIc delOp Ar hostnameOp Ar name-serverXcRemove Ar name-serverfrom the list of NS records associated with Ar hostname .

MYSQL DATABASES
The following commands assist MySQL database creation and management of associated MySQL users.
XoIc dbIc mysqlIc listXcDisplay the list of currently active MySQL databases followed by the privileges that MySQL users have on them.
XoIc dbIc mysqlIc userlistXcDisplay the list of currently active MySQL users, followed by the databases which they have access over.
XoIc dbIc mysqlIc addOp Ar db-nameXcCreate a new MySQL database of the given name. Initially, nobody has any privileges on this database.
XoIc dbIc mysqlIc delOp Ar db-name1Op Ar ...XcRemove one or more MySQL databases, destroying their contents.
XoIc dbIc mysqlIc useraddOp Ar db-usernameOp Ar db-hostOp Ar db-passwordXcCreate a new MySQL account. The MySQL user will be able to connect from Ar db-host(this almost always set to localhost).
XoIc dbIc mysqlIc userdelOp Ar db-usernameOp Ar ...XcDestroy one or more MySQL accounts. This does not affect databases.
XoIc dbIc mysqlIc grantOp Ar db-nameOp Ar db-usernameOp Ar sql-rightsOp Ar ...XcGrant (or revoke) specific set of permissions of a MySQL user Ar db-usernameover a database Ar db-name .The Ar sql-rightsargument is a comma-separated list of MySQL privileges (or ALL meaning all available MySQL privileges). To display the list of privileges allowed by the server, use the db mysql userprivs command.
XoIc dbIc mysqlIc userprivsXcDisplay all MySQL privileges that are implemented by the server.
XoIc dbIc mysqlIc passIc db-usernameIc new-passwordXcChange the password associated with an existing MySQL user.

POSTGRESQL DATABASES
The following commands assist PostgreSQL database creation.
XoIc dbIc pgsqlIc listXcDisplay the list of currently active PostgreSQL databases followed by the ownership and character set information.
XoIc dbIc pgsqlIc addOp Ar db-nameOp Ar character-setXcCreate a new PostgreSQL database of the given name, using the given character encoding. See db pgsql encodings for a list of available encodings.
XoIc dbIc pgsqlIc encodingsXcDisplay the list of available character sets.
XoIc dbIc pgsqlIc delOp Ar db-name1Op Ar ...XcRemove one or more PostgreSQL databases, destroying their contents. There must not be any open connection to them, or the operation will fail.
XoIc dbIc pgsqlIc set-maxconnOp Ar countXcSet the maximum number of PostgreSQL connections that are permitted from the default role. The default value and maximum permitted values are server-specific.

CONFIGURATION TUNABLES
These commands manipulate server-side account configuration settings. Any change should take effect within an hour.
XoIc confIc listXcDisplay the current configuration settings.
XoIc confIc setOp Ar optionOp Ar new-valueXcChange the value of the given option.
XoIc prefIc showXcDisplay the current client configuration settings.
XoIc prefIc setOp Ar optionOp Ar new-valueXcChange the value of an option, this is usually called from ~/.mgidrc.

MISCELLANEOUS
XoIc moduleIc showXcDisplays the loaded client modules, their version and a short description.
XoIc moduleIc loadOp Ar module-nameXcLoad a custom module; usually called from ~/.mgidrc.
XoIc moduleIc unloadOp Ar module-nameXcUnload a given client module; usually called from ~/mgidrc. to remove unused commands.
XoIc shellIc aliasOp Ar alias-commandOp Ar real-commandOp Ar arg1Op Ar arg2Op Ar ...XcArrange for the command Ar alias-commandto invoke Ar real-commandwith the given arguments.
XoIc openOp Ar hostnameOp Ar userOp Ar passwordXcConnect to the given mgid server; usually called from a system-wide mgidrc. The user and password arguments are for password authentication (which may or may not be available on the given mgid server).
XoIc closeXcTerminates the current connection to the mgid server, if there is any.
XoIc helpOp Ar cmd1Op Ar subcmd1Op Ar subcmd2Op Ar ...XcDisplays help on a given command.
XoIc exitXcDisconnect and leave the program.
XoIc quitXcDisconnect and leave the program.

FILES
~/.mgidrc User initialization script.
$PREFIX/share/mgid/mgidrc System-wide initialization script (override with the Fl roption).

SEE ALSO
mgid, mgid

http://www.csoft.net/docs/cadm/

BUGS
This man page is incomplete.

(c) 2016 Hypertriton Inc.
Hosted on OpenBSD servers at Csoft.net in NYC.
Sponsored by ElectronTubeStore.com.
Hosted by Csoft.net Sponsored by ElectronTubeStore.com