Lumail - The console email client

Lua primitives: mime_type()

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

This function will attempt to determine the correct MIME-type for the specified filename.

The MIME-type is determined by examining the filename extension, if present, and if the lookup fails then the default value of application/octet-stream will be returned.

The code to perform the lookup parses the system file /etc/mime.types, if present, and if that fails it will revert to a small list of known-values.

For example:

msg(mime_type( "/path/to/foo.jpg" ));

This will result in the message image/jpg being displayed.


This function has been available since version 0.09.