Compare commits
No commits in common. "main" and "v0.1.3" have entirely different histories.
3 changed files with 3 additions and 14 deletions
|
|
@ -29,5 +29,3 @@ a670de0f,24bd94d,feature/systemd-hardening,2025-09-07T16:40:47Z,michael,git,lua-
|
||||||
a71dd794,f5d9f35,main,2025-09-10T12:27:54Z,michael,git,lua-api
|
a71dd794,f5d9f35,main,2025-09-10T12:27:54Z,michael,git,lua-api
|
||||||
de5318f2,304b010,main,2025-09-10T14:45:12Z,michael,git,lua-api
|
de5318f2,304b010,main,2025-09-10T14:45:12Z,michael,git,lua-api
|
||||||
980d67cd,7a921dc,main,2025-09-10T14:46:13Z,michael,git,lua-api
|
980d67cd,7a921dc,main,2025-09-10T14:46:13Z,michael,git,lua-api
|
||||||
efbcbbd8,f20915f,main,2025-09-10T18:01:18Z,michael,git,lua-api
|
|
||||||
f777e765,f684ea1,main,2025-09-10T18:04:19Z,michael,git,lua-api
|
|
||||||
|
|
|
||||||
2
VERSION
2
VERSION
|
|
@ -1 +1 @@
|
||||||
0.1.4
|
0.1.3
|
||||||
|
|
|
||||||
13
src/smtp.lua
13
src/smtp.lua
|
|
@ -1,6 +1,6 @@
|
||||||
-- src/smtp.lua
|
-- furt-lua/src/smtp.lua
|
||||||
-- Universal SMTP implementation with SSL compatibility
|
-- Universal SMTP implementation with SSL compatibility
|
||||||
-- Supports both luaossl (Arch) and luasec (OpenBSD)
|
-- Supports both luaossl (Arch/karl) and luasec (OpenBSD/walter)
|
||||||
-- Dragons@Work Digital Sovereignty Project
|
-- Dragons@Work Digital Sovereignty Project
|
||||||
|
|
||||||
local socket = require("socket")
|
local socket = require("socket")
|
||||||
|
|
@ -304,11 +304,6 @@ function SMTP:send_email(to_address, subject, message, from_name)
|
||||||
return cleanup_and_fail("DATA command failed: " .. response)
|
return cleanup_and_fail("DATA command failed: " .. response)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Generate unique Message-ID
|
|
||||||
-- Extract domain from configured from_address
|
|
||||||
local hostname = self.from_address:match("@(.+)") or self.server
|
|
||||||
local message_id = string.format("<%d.%d@%s>", os.time(), math.random(10000), hostname)
|
|
||||||
|
|
||||||
-- Build email message
|
-- Build email message
|
||||||
local display_name = from_name or "Furt Contact Form"
|
local display_name = from_name or "Furt Contact Form"
|
||||||
local email_content = string.format(
|
local email_content = string.format(
|
||||||
|
|
@ -316,10 +311,7 @@ function SMTP:send_email(to_address, subject, message, from_name)
|
||||||
"To: <%s>\r\n" ..
|
"To: <%s>\r\n" ..
|
||||||
"Subject: %s\r\n" ..
|
"Subject: %s\r\n" ..
|
||||||
"Date: %s\r\n" ..
|
"Date: %s\r\n" ..
|
||||||
"Message-ID: %s\r\n" ..
|
|
||||||
"MIME-Version: 1.0\r\n" ..
|
|
||||||
"Content-Type: text/plain; charset=UTF-8\r\n" ..
|
"Content-Type: text/plain; charset=UTF-8\r\n" ..
|
||||||
"Content-Transfer-Encoding: 8bit\r\n" ..
|
|
||||||
"\r\n" ..
|
"\r\n" ..
|
||||||
"%s\r\n" ..
|
"%s\r\n" ..
|
||||||
".",
|
".",
|
||||||
|
|
@ -328,7 +320,6 @@ function SMTP:send_email(to_address, subject, message, from_name)
|
||||||
to_address,
|
to_address,
|
||||||
subject,
|
subject,
|
||||||
os.date("%a, %d %b %Y %H:%M:%S %z"),
|
os.date("%a, %d %b %Y %H:%M:%S %z"),
|
||||||
message_id,
|
|
||||||
message
|
message
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue