MGID(1)                     General Commands Manual                    MGID(1)


     mgid - command-line interface to the mgid system


     mgid [-IqvdpR] [-r rcfile] [-c 'command'] [-P pidfile] [-]


     The mgid (or csoftadm) client is a simple command-line tool that
     interacts with the mgid(8) daemon.  Originally designed for
     servers (, 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

     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:

     The command-line options are as follows:

     -     Issue multiple commands read from the standard input.  This
           operation mode implies the -I flag.

     -I    Disable interactive prompts.

     -q    Only print error messages.

     -v    Print the mgid version and exit.

     -d    Enable debug mode.

     -p    Ping the backend, print the latency, then exit.  If the backend is
           unavailable, an exit code of 1 is returned.

     -R    Ignore the system-wide initialization script (see ``FILES'' section

     -r    Run an alternate initialization script on startup.  The script file
           may contain any valid mgid command.

     -c    Issue a single command and exit immediately.  This operation mode
           implies the -I flag.

     -P    Set 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(5).


     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.


     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-name           E-mail is delivered to the named mailbox account
                            (as configured previously using `mail mbox add',
                            see `MAILBOXES' section for details).

     user@domain.ext        E-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/file         Messages are written to the given file, in
                            standard "flat-mailbox" format.

     ./path/to/directory/   Messages are written to the given maildir(5)
                            directory structure.

     &macro-name            Messages 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 args          The 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 UNIX.  The standard
                            procmail(1) and maildrop(1) 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:

     any                      Always evaluate to true.

     spam                     Always evaluate to true, but check for spam and
                              insert SpamAssassin headers into the message.

     spam<=>n                 Spam 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<=>n                 The message body is less than or greater than
                              the given size in bytes.  The "K" and "M"
                              suffixes are recognized.

     sender=user@domain.ext   Sender envelope address matches this value.

     client_address=   Numerical IP address of the sender matches this


     This function configures the way that e-mail to a given locally hosted e-
     mail address is processed.

     mail alias list [string]
           Display the list of all e-mail address currently configured under
           your account (or only those matching the given string if one is

     mail alias add [user@domain.ext] [instruction1] [...]
           Configure a new e-mail address 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.

     mail alias rcpt-add [user@domain.ext] [instruction1] [...]
           Append an unconditional instruction to an existing address.

     mail alias rcpt-del [user@domain.ext] [instruction1] [...]
           Remove an unconditional instruction from an address.

     mail alias del [user@domain.ext] [...]
           Remove the given e-mail address (or list of addresses).  Messages
           sent to a removed address will be bounced.

     mail rule add [user@domain.ext | &macro-name] [condition] [instruction]
           More 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'.

     mail rule del [user@domain.ext | &macro-name] [condition] [instruction]
           Remove the specified condition/instruction rule from an e-mail
           address or macro.  If condition is set to `*', the address or macro
           is simply deleted.


     Mail accounts (also referred to as "mailboxes") store incoming messages
     in mbox(5) or maildir(5) 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(1) and alpine(1).

     mail mbox add [mailbox-name] [password]
           Create a new mailbox called 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 mail
           alias add command.

     mail mbox del [mailbox-name1] [mailbox-name2] [...]
           Delete the given mailboxes (but not the associated aliases).

     mail mbox list [mailbox-name1] [mailbox-name2] [...]
           Display a list of all the active mailboxes, or only the ones with
           names matching the arguments.

     mail mbox pass [mailbox-name] [password]
           Change 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.

     mail mbox maildir [mailbox-name]
           Switch a mailbox to maildir(5) format.  This is only available on
           hosts running qmail(7).

     mail mbox mbox [mailbox-name]
           Switch a mailbox to mbox(5) format.


     Users with the dns privilege can add, delete and modify named(8) zone
     files they own.

     dns add [host] [destination]
           Point a domain/subdomain to an IP address or another hostname.  The
           destination argument 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.

     dns del [host1] [host2] [...]
           If host is a subdomain, remove it from its parent zone file.  If
           host is a domain name, remove its zone file entirely.

     dns list [host1] [host2] [...]
           Display 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.

     dns zone [host1] [host2] [...]
           Same as dns list except that all RR (Resource Records) defined by
           the zone files are shown.

     dns soa [domain-name] [email-address]
           Modify the e-mail address in the SOA (Start-Of-Authority) record
           for a given domain name.

     dns mx add [hostname] [mail-server]
           Add a MX (Mail eXchanger) record to 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.

     dns mx del [hostname] [mail-server]
           Remove mail-server from the list of MX records associated with

     dns ns add [hostname] [name-server]
           Add a NS (Name Server) record to hostname, which may be either a
           domain name or a subdomain.

     dns ns del [hostname] [name-server]
           Remove name-server from the list of NS records associated with


     The following commands assist MySQL database creation and management of
     associated MySQL users.

     db mysql list
           Display the list of currently active MySQL databases followed by
           the privileges that MySQL users have on them.

     db mysql userlist
           Display the list of currently active MySQL users, followed by the
           databases which they have access over.

     db mysql add [db-name]
           Create a new MySQL database of the given name.  Initially, nobody
           has any privileges on this database.

     db mysql del [db-name1] [...]
           Remove one or more MySQL databases, destroying their contents.

     db mysql useradd [db-username] [db-host] [db-password]
           Create a new MySQL account.  The MySQL user will be able to connect
           from db-host (this almost always set to `localhost').

     db mysql userdel [db-username] [...]
           Destroy one or more MySQL accounts.  This does not affect

     db mysql grant [db-name] [db-username] [sql-rights] [...]
           Grant (or revoke) specific set of permissions of a MySQL user
           db-username over a database db-name.  The sql-rights argument 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.

     db mysql userprivs
           Display all MySQL privileges that are implemented by the server.

     db mysql pass db-username new-password
           Change the password associated with an existing MySQL user.


     The following commands assist PostgreSQL database creation.

     db pgsql list
           Display the list of currently active PostgreSQL databases followed
           by the ownership and character set information.

     db pgsql add [db-name] [character-set]
           Create a new PostgreSQL database of the given name, using the given
           character encoding.  See `db pgsql encodings' for a list of
           available encodings.

     db pgsql encodings
           Display the list of available character sets.

     db pgsql del [db-name1] [...]
           Remove one or more PostgreSQL databases, destroying their contents.
           There must not be any open connection to them, or the operation
           will fail.

     db pgsql set-maxconn [count]
           Set the maximum number of PostgreSQL connections that are permitted
           from the default role.  The default value and maximum permitted
           values are server-specific.


     These commands manipulate server-side account configuration settings.
     Any change should take effect within an hour.

     conf list
           Display the current configuration settings.

     conf set [option] [new-value]
           Change the value of the given option.

     pref show
           Display the current client configuration settings.

     pref set [option] [new-value]
           Change the value of an option, this is usually called from


     module show
           Displays the loaded client modules, their version and a short

     module load [module-name]
           Load a custom module; usually called from ~/.mgidrc.

     module unload [module-name]
           Unload a given client module; usually called from ~/mgidrc.  to
           remove unused commands.

     shell alias [alias-command] [real-command] [arg1] [arg2] [...]
           Arrange for the command alias-command to invoke real-command with
           the given arguments.

     open [hostname] [user] [password]
           Connect 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

           Terminates the current connection to the mgid server, if there is

     help [cmd1] [subcmd1] [subcmd2] [...]
           Displays help on a given command.

     exit  Disconnect and leave the program.

     quit  Disconnect and leave the program.


     ~/.mgidrc   User initialization script.

                 System-wide initialization script (override with the -r


     mgid(3), mgid(8)


     This man page is incomplete.

                               December 14, 2001

[Unix Hosting | Open-Source | Contact Us]
[Engineering & Automation | Software Development | Server Applications]