webmcp
annotate framework/env/net/configure_mail.lua @ 480:e09654c4a042
Allow main handlers to use a poll function that indicates when process termination is requested
author | jbe |
---|---|
date | Tue Jun 06 16:14:33 2017 +0200 (2017-06-06) |
parents | 5d307886bd89 |
children | f87175f57591 |
rev | line source |
---|---|
jbe@444 | 1 --[[-- |
jbe@444 | 2 net.configure_mail{ |
jbe@444 | 3 command = command, -- table with binary name and static command line arguments |
jbe@444 | 4 envelope_from_option = envelope_from_option -- command line option to select "envelope from", e.g. "-f" |
jbe@444 | 5 } |
jbe@444 | 6 |
jbe@444 | 7 Configures the mail delivery system. |
jbe@444 | 8 Default: net.configure_mail{ command={"sendmail", "-t", "-i"}, envelope_from_option="-f" } |
jbe@444 | 9 |
jbe@444 | 10 --]]-- |
jbe@444 | 11 |
jbe@444 | 12 function net.configure_mail(args) |
jbe@444 | 13 local mail_config = { |
jbe@444 | 14 command = table.new(args.command), |
jbe@444 | 15 envelope_from_option = envelope_from_option |
jbe@444 | 16 } |
jbe@444 | 17 request.configure(function() |
jbe@444 | 18 net._mail_config = mail_config |
jbe@444 | 19 end) |
jbe@444 | 20 end |