17 lines
583 B
Lua
17 lines
583 B
Lua
local file = fs.open("/disk/email.conf","r")
|
|
local conf = load("return {"..file.readAll().."}")()
|
|
local modem = peripheral.wrap("top")
|
|
modem.open(tonumber(conf.server_id))
|
|
print("Email server is running...")
|
|
|
|
while true do
|
|
local event, side, channel, replyChannel, message, distance = os.pullEvent("modem_message")
|
|
if message == "35" then
|
|
modem.transmit(replyChannel, 15, 135)
|
|
else
|
|
-- Here you would handle authentication, e.g. check user:pass
|
|
print("Received credentials: " .. tostring(message))
|
|
-- You can add logic to check credentials and respond accordingly
|
|
end
|
|
end
|