Lumail - The console email client


Lua Primitives

The lumail client is scripted and configured in 100% Lua. The functions provided are documented here, above and beyond those you'd find in the Lua standard-library.

NOTE: Lumail-legacy has been superseded by Lumail 2.x, which has a wholly unified Lua API.

abort

Exit the application with a fatal error.

add_selected_folder

Add a folder to the list of selected folders.

alert

Show a message and prompt for an acknowledgement.

all_headers

Return all heades associated with the current message.

attachment

Return the content of the specified attachment.

attachment_colour

Specify the colour to draw attachment-names in.

attachments

Return a table of attachment-names.

bind_socket

Start listening for commands on a unix domain-socket.

body

Return the value of the parsed message body.

body_colour

Specify the colour to draw message bodies in.

bounce

Bounce an email.

bounce_path

Get, or set, the path to the script to send bounces.

cd

Change the current working directory.

choose_string

Choose from a small list of possible options.

clear

Clears the screen.

clear_selected_folders

Clear all selected folders.

close_socket

Stop listening for commands on a unix domain-socket.

completion_chars

Get or set the characters usd for tokenizing input prior to TAB-completion.

compose

Begin composing a new email.

count_attachments

Count the attachments in the current message.

count_body_parts

Count the number of MIME parts in the current message.

count_lines

Count the lines in the current message body.

count_maildirs

Count the number of maildirs.

count_messages

Count the number of messages in the currently selected folder(s).

create_maildir

Create a given Maildir.

current_maildir

Retrieve the currently selected folder.

current_maildirs

Retrieve the maildirs currently visible.

current_message

Retrieve the currently selected message.

cwd

Retrieve the current working directory.

date_formats

Format strings used for date-parsing.

DEBUG

A boolean describing whether debug support was compiled in.

delete

Delete a message.

delete_maildir

Delete an empty Maildir.

display_filter

Pass email bodies through a filter prior to display.

dump_stack

Dump the Lua stack to the debug-file.

editor

Configure the editor to use for mail composition.

exec

Execute a program, interactively.

executable

Test whether a given path represents an executable.

exit

Exit the application.

file_exists

Test whether a given path exists.

filter_maildirs

A hook allowing you to filter maildir entries from the list.

forward

Forward an email.

from

Get, or set, your from-address.

get_body_part

Retrieve a specified MIME part from the current message.

get_body_parts

Retrieve a table of the MIME parts in the current message.

get_signature

Retrieve the signature for this new mail.

get_variables

Get a copy of all current variables.

global_mode

Get, or set, the global mode.

has_body_part

Does this message have a MIME part of the given type?

header

Return the value of an email header.

header_colour

Specify the colour to draw message headers in.

headers

Control which headers are displayed when reading a message.

help

Show help information to the user.

history_file

Set a persistent history.

hostname

Return the hostname of the current machine.

ignored_folders

Exclude Maildirs from maildir-mode.

index_format

Control how message-lists are displayed.

index_highlight_mode

Specify how the highlight should be drawn in index-mode.

index_limit

Specify which messages to show.

index_offset

Get the current offset into the message list.

is_directory

Test whether a given path represents a directory.

is_maildir

Test whether a given path represents a Maildir.

is_new

Is a message new?

jump_index_to

Jump to a position in the message list.

jump_maildir_to

Jump to a position in the maildir list.

jump_message_to

Scroll the current message to the given line.

jump_text_to

Set the current offset of the text-mode display.

keymap

A table used for keybindings.

load_directory

Load *.lua from the given directory.

log_message

Write a string to the debug-file.

mail_filter

Pass whole emails through a filter.

maildir_format

Control how maildir-lists are displayed.

maildir_highlight_mode

Specify how the highlight should be drawn in maildir-mode.

maildir_limit

Specify which maildir folders to show.

maildir_offset

Get the current offset into the Maildir list.

maildir_prefix

Get, or set, the root of the maildir hierarchy.

maildirs_matching

Retrieve the maildirs matching a given pattern.

mark_read

Mark a message as old/read.

mark_unread

Mark a message as new/unread.

message_offset

Get the current offset into the message.

mime_type

Get the MIME-type for the given filename.

msg

Write a message to the status-area.

on_complete

Called when the user invokes TAB-completion.

on_delete_message

Called just prior to the deletion of a message.

on_edit_message

Called after the editor has terminated.

on_error

Called when a Lua error is encountered.

on_exit

Called when the client exits.

on_folder_selection

Called when the set of selected folder is changed.

on_get_body

Retrieve the body of a message.

on_idle

Called when the client is idle.

on_key

Called when a key is pressed.

on_message_aborted

Called when sending an email is aborted.

on_mode_change

Called when the global mode changes.

on_read_message

Called when an email is read.

on_reply_transform_subject

Allow the user to transform a subject, when hitting reply.

on_send_message

Called just prior to sending an email.

on_sent_message

Called just after sending an email.

prompt

Prompt for input from the user.

prompt_chars

Prompt for input from the user.

prompt_maildir

Prompt for a Maildir.

prompt_yn

Prompt for yes/no.

reply

Reply to an email.

save

Move a message to a different folder.

save_attachment

Save a single attachment to disk.

screen_height

Retrieve the height of the screen.

screen_width

Retrieve the width of the screen.

scroll_index_down

Scroll the list of messages down.

scroll_index_to

Scroll the list of messages to the next one matching a pattern.

scroll_index_up

Scroll the list of messages up.

scroll_maildir_down

Scroll the list of folders down.

scroll_maildir_to

Scroll the list of folders to the next name matching a pattern.

scroll_maildir_up

Scroll the list of folders up.

scroll_message_down

Scroll the current message down.

scroll_message_to

Scroll the current message to next line matching the given pattern.

scroll_message_up

Scroll the current message up.

scroll_text_down

Scroll the text being displayed down.

scroll_text_to

Scroll the text to the next occurence of the given regular expression.

scroll_text_up

Scroll the text being displayed up.

select_maildir

Select a maildir folder by path.

selected_folders

Get all selected folders.

send_email

Sent an email programatically.

sendmail_path

Get, or set, the path to sendmail.

sent_mail

Get, or set, the sent-mail folder path.

set_selected_folder

Change to select only the single specified folder.

show_attachments

Display the list of attachments beneath a message-header?

show_file_contents

Display the contents of a file.

show_text

Display some static text.

sleep

sleep for the specified amount of time.

sort

Specify the sorting order for messages.

stuff

Insert keystrokes into the input buffer.

text_offset

Get the current offset into the text-mode display.

toggle_selected_folder

Toggle the selected state of the current folder.

unread_maildir_colour

Control the colour for folders containing unread messages.

unread_message_colour

Control the colour for displaying unread messages.

VERSION

A text-string containing the Lumail version number.

view_inline_attachments

Should the attachment list contain "inline" parts?

wrap_lines

Should long lines be wrapped when reading a message?