GNU Mailutils Manual (split by node):   Section:   Chapter:FastBack: Programs   Up: Programs   FastForward: Libraries   Contents: Table of ContentsIndex: Function Index

3.8 readmsg — Extract Messages from a Folder

The readmsg utility extracts messages from a mailbox according to the criteria specified in the command line. These criteria are:

  1. A lone ‘*’ means “select all messages in the mailbox”.
  2. A list of message numbers may be specified. Values of ‘0’ and ‘$’ in the list both mean the last message in the mailbox. For example:
    readmsg 1 3 0

    extracts three messages from the folder: the first, the third, and the last.

  3. Finally, the selection may be some text to match. This will select a mail message which exactly matches the specified text. For example,
    readmsg staff meeting

    extracts the message which contains the words ‘staff meeting’. Note that it will not match a message containing ‘Staff Meeting’ – the matching is case sensitive. Normally only the first message which matches the pattern is printed.

Unless one of the informational options is used, at least one command line argument must be present. Informational options are: --help (-?), --usage, and --version (-V).