Skip to content

Instantly share code, notes, and snippets.

@kylemanna
Created May 12, 2013 05:28
Show Gist options
  • Select an option

  • Save kylemanna/5562526 to your computer and use it in GitHub Desktop.

Select an option

Save kylemanna/5562526 to your computer and use it in GitHub Desktop.
Test using LUA + LUA Process Call (lua-lpc) + spamassassin
#!/usr/bin/env lua
require("lpc")
--[[
local f = io.open("spam1.txt", "rb")
local content = f:read("*all")
f:close()
]]--
local content = io.stdin:read("*all")
--local pid, w, r = lpc.run("spamassassin")
local pid, w, r = lpc.run("spamc")
io.stderr:write("writing to pid " .. pid .. "...\n")
w:write(content)
w:close()
io.stderr:write("waiting for spamassasin...\n")
print (r:read("*all"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment