General-Purpose Mail Package
|Official GNU Software|
guimb— A Mailbox Scanning and Processing Language
Guimb is an experimental tool that iterates over messages in
a mailbox (or several mailboxes), applying a Scheme function to each
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
(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
This document was generated on January 2, 2022 using makeinfo.Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.