guimb — A Mailbox Scanning and Processing LanguageGuimb is an experimental tool that iterates over messages in
a mailbox (or several mailboxes), applying a Scheme function to each
of them.
A user-defined scheme module that supplies the function to apply is specified using the --source or --file option. The module must define at least the following function:
Processes message msg. This function can alter the message using Guile primitives supplied by mailutils.
The following function definitions are optional:
If defined, this function is called after guimb has finished
processing the command line. args is a list of unconsumed
command line arguments.
The function is intended to provide a way of configuring the module from the command line.
If defined, this function is called after all mailboxes have been processed.
In the following example we define a module that prints
information about each message is the input mailbox, in a way similar
to frm utility:
(define-module (frm)
:export (guimb-message))
(use-modules (mailutils mailutils))
(define (guimb-message msg)
(display (mu-message-get-sender msg))
(display " ")
(display (mu-message-get-header msg "subject"))
(newline))
The modules are looked up in directories listed in the global variable
%load-path. New directories can be added to that variable on
the fly using the -L (--load-path) option. For
example, if the sample module above was saved in a file
frm.scm somewhere in the load path, it can be applied to the
current user inbox by running the following command:
guimb --file frm
| • Specifying Scheme Program to Execute | ||
| • Specifying Mailboxes to Operate Upon | ||
| • Passing Options to Scheme | ||
| • Command Line Option Summary |