# vm(3)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

vm - Email viewer
mail-check - Check for new email
stop-mail-check - Disable the check for new email
mail - Compose and send an email

## SYNOPSIS

vm
mail-check
stop-mail-check
mail

## DESCRIPTION

vm is a simple email manager, it is configured to send and receive emails using the user-setup(3) Mail dialog.

mail-check tests the size of this incoming mail box, a non-zero length indicates that new mail has arrived and mail-check informs the user by inserting a '`M`' in the mode-line (2nd character for the left) and ringing the system bell. mail-check uses create-callback(2) to check for new mail every 10 minutes, this can be disabled by executing stop-mail-check.

When vm is executed it checks for new mail, if found it first copies the new mail to a file called "`new_mail`" in the users mail directory. The incoming box is then emptied by truncating the file to zero length. The users main mail box is then loaded and the new mail (if any) is appended. The mail box is then processed after which 2 windows are created the bottom window listing all messages in the box and the top displaying the current message.

vm is capable of:

- Scrolling through the mail box displaying each message (`up`, `p`, `down`, `n`, `return`, `space`).
- Check and get new mail messages (`g`).
- Extract and cut embedded data files (`x`, `C`, `c`).
- Reply to and forward mail messages (`R`, `r`, `z`).
- Delete mail messages (`d`, `u`).
- Archive messages to other mail boxes (`A`, `a`).
- Save changes to the current mail box (`S`, `s`).
- Delete the current mail box (`D`).
- Visit another mail box (`v`).
- Send a mail message (`m`).
- Hide vm windows (`delete`).

Use the vm help page (bound to "`esc h`") for further information.

vm supports two types of embedded data, uuencode and mime encoding and uses ipipe-shell-command(2) to extract the data, the commanding to use must be supplied by the user using the setup dialog, which can contain the following special tokens:

`%i`

Temporary file name, if used, the embedded data is written to the this file first.

`%o`

User supplied output file name, if `%i` is not used, the embedded data is written to this file first.

`%b`

The output base name, i.e. `%o` without the path.

If no command line is supplied then the embedded data is written to the user supplied file name as a text file in the form found in the mail message.

mail can be used to compose and send an email, it can insert embedded data in a similar way to vm's data extraction, the following special tokens can be used:

`%i`

The user supplied data file to be embedded.

`%b`

The input base name, i.e. `%i` without the path.

`%o`

Temporary file name used to output the processed data file, this file is inserted into the mail message using insert-file(2).

mail also uses ipipe-shell-command to send the mail message, the following special tokens can be used:

`%f`

The from user name.

`%s`

The email subject.

`%t`

A comma separated list of 'To' recipients.

`%c`

A comma separated list of 'Cc' recipients.

`%o`

A file name of the mail message.

Any field not used in the command-line is left at the head of the mail message.

## EXAMPLE - UNIX

The following command-line can be used on most UNIX systems to extract uuencoded data:

    rm -f %o ; uudecode %i ; rm -f %i

The following command-line can be used on most UNIX systems to extract mime encoded data:

    rm -f /tmp/%b ; metamail -B -d -q -w -x -z %i ; mv -f /tmp/%b %o

The following command-line can be used on most UNIX systems to uuencode a data file ready for it to be embedded, the original file is not changed:

    uuencode %b < %i > %o

The following command-line can be used on most UNIX systems to send an email:

    /usr/lib/sendmail -oi -oem -odi -t < %o

## EXAMPLE - WIN32

Typically the cygwin(1) utilities can be used for data insertion and extraction. These have the advantage of being very similar to the unix ones so only minor changes are required, i.e. try the following for data insertion and mime & uuencode extraction respectively:

    del %o ^ uudecode %i ^ del %i
    del c:\tmp\%b ^ metamail -B -d -q -w -x -z %i ^ move c:\tmp\%b %o
    uuencode %b < %i > %o

This assumes that the shell you are using supports the '`^`' multiple commands on a single line feature, this is supported by 4dos(1) and 4nt(1). If your shell does not support this feature a simple batch file command could be used instead.

postie(1) is a freely available pop3/smpt e-mail support program, available on the net, which can be used to provide a fully working vm on windows systems. As it is typically used in a dial-up connect environment, the user-setup 'Queue Outgoing Mail' option will be enabled while the 'Check Mail' and 'VM Gets Mail' will be disabled. This ensures that a connection is only made when the vm '`g`' command is used which sets all queued outgoing mail and gets any incoming mail.

The following command-line can be used to get mail from your pop server using postie:

    postie -host:pop-mail-addr -user:user-addr -pass:password -file:inbox
            "-sep:From root Mon Jan 11 20:02:02 1999" -raw -rm

Where the `inbox` is the 'Incoming Mail Box' file specified in user-setup. The `-sep` option is used to partition each mail message from the previous message, this string is used as it is in a unix standard form so the resulting mail box could be understood by unix mail systems such as netscape etc.

NOTE: The -rm option is used to remove the incoming mail messages from the server. It is strongly recommended that the system is thoroughly tested without this option first.

The following command-line can be used to send mail to your smtp server using postie:

    postie -host:smtp-mail-addr "-from:user@mail-addr" -use_mime:0
            "-to:%t" "-s:%s" "-cc:%c" "-file:%o"

blat(1) is another freely available windows program which can be used to send mail with the following command-line:

    blat %o -f %f -s \"%s\" -t \"%t\" -c \"%c\"

## NOTES

vm is a macro defined in `vm.emf`, mail-check, stop-mail-check and mail are macros defined in `mail.emf`.

vm has only been tested in a couple of environments, the author will not except any responsibility for any loss of data, i.e. use at your own peril. You have been warned! Back-up all data files and test vm THOROUGHLY before using it.

## SEE ALSO

user-setup(3), ipipe-shell-command(2), create-callback(2), sendmail(1).

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>