1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 17:47:03 +00:00

lua: Bind after_message_stored and before_mail_accepted (#322)

Signed-off-by: James Hillyerd <james@hillyerd.com>

Signed-off-by: James Hillyerd <james@hillyerd.com>
This commit is contained in:
James Hillyerd
2023-01-24 16:37:26 -08:00
committed by GitHub
parent 55addbb556
commit 7f91c3e9cb
6 changed files with 472 additions and 0 deletions

View File

@@ -29,6 +29,11 @@ func (lp *statePool) newState() (*lua.LState, error) {
ls.SetGlobal(name, lua.LChannel(ch))
}
// Register custom types.
registerMessageMetadataType(ls)
registerMailAddressType(ls)
registerPolicyType(ls)
// Run compiled script.
ls.Push(ls.NewFunctionFromProto(lp.funcProto))
if err := ls.PCall(0, lua.MultRet, nil); err != nil {