Lumail - The console email client


Lua primitives: filter_maildirs()

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

When the global_mode is set to maildir you will be presented with a list of Maildir folders.

The list will default to showing all available folders, but you may use maildir_limit() to change this.

There are three options for limiting, vua the maildir_limit primitive:

all

Show all maildirs.

new

Show all maildirs which contain unread messages.

"str"

Show all maildirs match the pattern "str".

If these aren't sufficient then you might prefer to define the filter_maildirs function - if this is defined then it will be invoked:

--
-- Don't show the spam folder or empty "incoming" folders
--
function filter_maildirs(maildir)
    if maildir.name == "spam" then
        return false
    elseif maildir:matches_regexp('/home/foo/mail/incoming/') and
           maildir.total_messages == 0 then
        return false
    end
    -- Include all other folders
    return true
end

Availability

This function has been available since version 0.25.

See Also

See also ignored_folders, maildir_limit.