Lumail - The console email client

Reading external input

As of release v0.25 lumail can read commands from an external source, a Unix domain socket, and will process them as they arrive.

To enable this handling you must explicitly call "bind_socket" within your configuration file.

-- Open a socket, from which lumail will regularly read input
bind_socket( os.getenv( "HOME" ) .. "/.listening.socket" )

-- If you wish to close the socket you can call close_socket at a later point.

Any valid Lua code read from the socket will be executed, so the next step is to send some input. Within the Lumail distribution is a tool called lumailctl which can be used to send commands:

$ lumailctl "exit();"

If you explicitly setup a path in the call to bind_socket you will need to specify that, otherwise the default will be used:

$ lumailctl /tmp/my.socket "exit();"

If you wish you could use socat to send the input, bypassing the need for the Lumail-specific tool:

echo alert('ok'); | socat - UNIX-CLIENT:~/.lumail.sock