NAME
|
Mails, mail2fs, M, Mg, mspool, mailplumb, mails, Arch, Spam, Reply,
Send – file based mail reader |
SYNOPSIS
|
mail2fs [ –acDn ] [ –d mdir ] [ mbox ] mails [ –aAs ] [ mdir ] [ monthdir ] M cmd [ dir ... ] Mg [ –h ] [ regexp ] mspool mailplumb [ –dho ] [ mdir ] Mails Arch Spam Reply Send
mlist |
DESCRIPTION
|
These programs cooperate to provide mail reading and delivering
facilities by using files from a shared file server. Mails are
stored in a convenient way to read or process them just by browsing
files, using a Plan B mail box format. Mail box format The directory for a message contains at least two files: text and raw. The text file has the mail headers and body already processed for reading, and raw has the original mail headers without any processing, including the UNIX header line (for debugging and also for obtaining message ids when replying to mails). Any attachment in the mail is kept stored in a separate file (possibly with the file name indicated in the MIME headers) ready to be used, that is, decoded. When the attachment is a mail, the message is stored in a subdirectory following the same conventions stated above. For mails with attachments, the text file contains additional text indicating the relative path names (from the mail's directory) that can be used to open the attachments. This is convenient to plumb(1) them while reading. There is no provision for storing mail flags in the Plan B mailbox format. However, the convention is that messages with the same last modification time for both the text file and the directory are not yet read. Using touch(1) on the text file ``flags'' the message as read. Because all these files have been already processed for reading, the usual file handling tools can be used to read, edit, copy, or remove them. The mailbox used by default is /mail/box/$user/msgs, and corresponds to the inbox. A Plan B mail box also contains two files: seq and digest. Messages are given sequence numbers as added to the mail box. The file seq contains the sequence number for the last message (or zero) and is DMEXCL to provide locking for multiple programs using the mail box. The file digest contains digests for mails added to the mailbox using mail2fs (and not for those added by hand using file tools). When a message has a digest that was already seen in the past the message is silently discarded as a dupplicate. Programs described below are parsimonious enough in the format of the mail box so that they will work even if messages are edited by hand, other files are created, or some of them are removed.
Virtual mail folders may be created by storing text files with
mail lists that contain a mail description per line starting with
the path for each mail. To archive mails into separate folders
the text presented for listing them on the inbox may be copied
to a text file representing the folder. Reading mail Without arguments it uses /mail/box/$user/mbox as the source (Plan 9) mail box and moves all messages from there to /mail/box/$user/msgs (in Plan B mailbox format). Supplying mbox as an argument would use that file as the source instead. Using option –d permits to use mdir as the destination instead. Messages are deleted from the Plan 9 mailbox unless flag –n is given. The Plan B mailbox is created if it does not exist only if flag –c is given. Flag –a makes mail2fs add the messages as archived to the Plan B mailbox. This is useful to add messages to a mailbox for further reference and not for listing when asking the mail index for the mailbox. For example, to archive outgoing mail in the default mail box. The program mails is a convenience tool for reading mail. It generates a mail index. Flag –a generates a list for all mails in the mailbox, archived or not. Unread mails are flagged by an initial N character (new) in the mail index. Flag –A includes spam as well. The mailbox is the standard msgs inbox unless a different one is supplied as an argument. As an option, both the mail box path and the name of a per–month directory can be indicated to ask mails for a list of mails for just that month. As an aid for other programs, mails places a list of the directories for the mails listed at /tmp/mails.$user, which can be useful for retrieve the paths for the mails the user is working with.
M is a script that applies the operation indicated by cmd to one
or more mails. It applies cmd to all mails last listed by mails,
(as described by the paths in /tmp/mails.$user), when no mail
directories are given as arguments. Arguments selecting mails
only need to mention the path to the mail directories, but may
refer to particular files within them, as a convenience to permit
pasting names from somewhere else without editing. Cmd may be
any of the following: The single letters a, s, i, d, p, l, m, and r can be used instead of the full cmd name (in the same order). Note that the letter is the initial for the command, but for deletion. Mg is not strictly necessary, but is supplied as a convenience script to call grep(1) to locate mails containing the expression given as an argument. Flag –h makes it search only in headers. Like the previous program, Mg considers just the mails listed in /tmp/mails.$user. Mailplumb is used to send plumb(1) messages to maintain faces(1) and other programs aware of the mails in the user's Plan B mailbox, or in mdir when supplied. Flag –h makes the program notify existing mails as new ones. Flag –o makes mailplumb post events for the Octopus, using ports(4) instead of plumber(4). Reading mail in O/live Executing !Mails at /mail/box/$user/msgs produces an initial list of mails. This list can be refreshed by executing ,<Mails in the panel containing the mail list. To read a mail just click (button–3) on the mail path. To select mails according to text shown in the mail index use the Sam command language. For example, ,x/9fans/+–p produces a mail index for mails comming from 9fans. To archive a set of mails send their index text as standard input to Arch. For example, ,>Arch archives all mails listed in the panel. In the same way, Spam flags mails as spam. Both Arch and Spam can be executed at the panel showing a single mail to archive and to flag as spam the mail shown.
The program mlist reads a list of paths from standard input corresponding
to mail files and produces a list of mails for them, suitable
for reading mail. Sending mail The file format is similar to that used by the acme(1) mail composition window. It includes one text line per header, a blank line, and the body. Attachments are added by lines starting with Attach: in the header. Inline attachments are added by lines starting with Include: in the header. Replies to other mails should contain a Replying: header containing the path to the mail being replied to (its raw file in a Plan B mailbox). Using multiple addresses (separated by white space) within a single To header causes the mail to sent to each different address as a different message (each receiver will not see others). This header line may be repeated to cause the message to be sent to a group of users (so that any of them gets all the recipient list). Messages are sent using marshal(1). The script Reply is available to send messages from olive(1). Similar to Arch and Spam, it replies to the mail shown in a panel when executed for that panel (e.g., !Reply) and to the mail listed in its standard input otherwise. For example, selecting a mail in the index and executing .>Reply would reply to it. When uncertain regarding the mail to reply, it would simple open an empty panel to create a new mail.
Mail is delivered by writing the panel created by Reply and then
executing !Send on that panel. |
EXAMPLES
|
Move all mails from the Plan 9 mailbox to the Plan B one, and
creates the later if it does not exist. ; mail2fs –c
List mails:
From now on, /tmp/mails.$user contains a list of mail directories
for M to work with. For example, display them.
List their directories and plumb all PDF attachments:
Reply to the second, mark the first as spam, and archive the others.
Prepare to use the script M (like above) but only for messages
from december 2007 that contain PDF attachments and are kept in
the omsgs mailbox:
Use mailplumb to see in faces messages in the Plan B mailbox:
This is a guide for reading mail using olive(1): |
FILES
|
/mail/box/$user/mbox Standard Plan 9 mail box for the user. /mail/box/$user/msgs/ Standard Plan B mail box for the user /tmp/mails.$user List of mails being processed by the user. |
SOURCE
|
/sys/src/cmd/mail2fs |
SEE ALSO
|
mail(1). |