Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Need a primitive to pipe messages through shell commands. #51

skx opened this Issue · 1 comment

1 participant

skx commented

Right now we can invoke ! to execute a shell command globally, but we also need another similar thing to pipe a message through a shell command.

Consider a mark_spam() function that wants to train a message as being bogus. Currently I just save messages in ~/Maildir/.new-spam/ and a cronjob picks it up to train it.

However I can imagine that somebody else will want to pipe through spam_bayes, crm114, or similar.

We can already execute commands via os.exec the only part missing is getting the path to the current message.

Suggest: message() will return the path to the currently selected message, then we can do things like:

os.exec( "train-as-spam " .. message() )
@skx skx closed this issue from a commit
@skx New primitive: message(), to return the path to the current message.
  This allows piping to commands, etc.

  Closes #51.
@skx skx closed this in 0d74fb4
skx commented

Annoyingly I'd already written current_message so this bug was bogus to begin with.

Reverted the new primitive message(), but updated the implementation of current_message() with the newer code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.