Created
April 8, 2015 01:24
-
-
Save DevElCuy/5ba06726aea8b6fb9b36 to your computer and use it in GitHub Desktop.
fake sendmail / just another null mailer written in Lua and seawolf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env lua5.1 | |
local seawolf = require 'seawolf'.__build('variable', 'behaviour') | |
local print_r = seawolf.variable.print_r | |
local temp_dir = seawolf.behaviour.temp_dir | |
local ts = os.date('%Y-%m-%d %H:%M:%S') | |
local output = ([[---- | |
-- %s | |
Arguments: %s | |
%s]]):format(ts, print_r(arg, 1), io.read '*a') | |
local fh = io.open(temp_dir() .. '/null_mailer.log', 'a+') | |
if fh then | |
fh:write(output) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This fake sendmail works as a logger, it reads from STDIN and outputs it to $TMP/null_mailer.log. Nice for debugging!