File splitmail.icn

Summary

SplitMail -- split messages from system mailbox by matching substrings in Subject: and/or From: lines. Can handle arbitrary sized system mailboxes.

Options:

Exactly one of --name or --file is required. When --file is used, the default names for the output files start with basename of the named file.

You must have at least one instance of --subject or --from. When the option uses --subject= or --from= then the match is case sensitive. Replacing = with ~ as in --subject~happy results in a case insensitive match.

FILENAME may be /dev/null to suppress output, and defaults to USER.with for --withfile and USER.without for --withoutfile.

Procedures:
basename, getMessage, helpMesg, main, mapFrom, readMessages, routeMessage, showHeader, showList, word

Records:
message

Global variables:
append, dryrun, fCiList, fList, sCiList, sList, verbose

Imports:
util

This file is part of the (main) package.

Source code.

Details
Procedures:

basename(s)

Produce the filename at the end of a Unix pathname.


getMessage(line, mailFile)

Read a single mail message from a mail file.


helpMesg()

Display the usage information to standard error.


main(args)

Read a user's system mailbox and split messages into two separate files based on substrings found in From: and Subject: lines.


mapFrom(s)

Produce the 'from' information from a From: line. Used in verbose mode.


readMessages(mailFileName)

Generate the mail messages from the users system mailbox. Produces each mail messages in internal form.


routeMessage(message, file1, file2)

Given a single mail message, routes it to the appropriate output file based on the selection criteria.


showHeader(f, prefix, h)

Show a summary of a mail message's header. Used in verbose mode.


showList(f, prefix, aList)

Display a list of values on one line, preceded by some prefix. Used in verbose mode.


word()

String scanning procedure that generates the next word


Records:

message(from, subject, date, text)

 Internal form for mail message


Global variables:
append -- If non-null, append to output files instead of overwriting

dryrun -- If non-null, don't create output files

fCiList -- List of case-insensitive From: substrings to look for

fList -- List of From: substrings to look for

sCiList -- List of case-insensitive Subject: substrings to look for

sList -- List of Subject: substrings to look for

verbose -- If non-null, show how messages are categorized


This page produced by UniDoc on 2021/04/15 @ 23:59:54.