mvmf: mvmda/mfl script examples
mvmf: mvmda/mfl script examples
Here are a few examples of mvmda MFL scripts. Each example is presented
in a separate page since each example is syntactically correct and could
indeed be used as a valid source script (including the comments used
to annotate each one).
SIEVE-only
This group of examples makes use of SIEVE constructs exclusively.
- discards:
A simple program that will discard messages matching certain
basic criteria, and save any that don't match.
- combined-discards:
Shows how the "discards" script can be restated with a more complex
test statement.
- vacation:
A silly example of a vacation message.
- classify:
Shows some unique ways to classify messages.
- editheader:
Manipulation of some headers in a mail message.
- real-sieve:
A possible real-world script.
MFL
This group of examples uses the C-like side of MFL, usually
in conjunction with SIEVE elements.
- Example: str-fun-1:
A somewhat elaborate mixing of strings, functions, C-like code,
and sieve code.
- Example: hdrctls:
Shows how you can use MFL code to consult a data file for many of
your filing/filtering decisions, rather than hardwiring these
decisions into a script.
(More to come... send in some?)
Startup
mvmda's system-wide startup script, which directs much of its operation,
might be configured to look for a user-level startup file (typically
called .mvmda-rc.mfl) and execute it before processing any other
scripts. It is typically used to establish preferences, define
variables and functions, and set controls.
A sample user-mvmda-rc.mfl file.
Much more can be done, of course. The language references, RFCs, and
internet drafts provide much more detail about what can be done.