Mailutils query

From Mailutils

Jump to: navigation, search

The mailutils query command queries values from GNU Mailutils configuration files. It takes one or more configuration paths as its arguments. On output, it displays the values it found, each value on a separate line. If the requested value is a block statement it is displayed in full. For example, if main configuration file contained:

  logging {
    syslog yes;
    facility mail;
  };

Then:

 $ mailutils query .logging.syslog
 syslog yes;
 $ mailutils query .logging.syslog .logging.facility
 syslog yes;
 facility mail;
 $ mailutils query .logging
 logging {
   syslog yes;
   facility mail;
 };

Several command line options allow to modify output format. The --value option instructs the command to output only values:

 $ mailutils query --value .logging.syslog
 yes

The --path option instructs it to print full path names for each value:

 $ mailutils query --path .logging.syslog
 logging.syslog: yes

The --program option instructs mailutils to behave as if it was called under another program name. For example, the following command:

 $ mailutils query --program=pop3d .server.transcript

will return the value of the server.transcript statement for pop3d utility.

By default, mailutils query operates on the main configuration file. Another configuration file can be supplied using the --file (-f) option:

 $ mailutils query --file /usr/local/etc/file.conf .pidfile

See also

Personal tools