This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Email function
#12
Hi,
I take the opportunity of this thread to ask what does it mean the following when system try to send mails.

string: 421 4.4.5 Directory harvest attack detected

SMTP server is not gmail and it works fine in other system. But I am trying to send mail to a gmail receiver. Here below my script. I cannot find out a solution. Thanks.

-- send an e-mail,
function mail(to, subject, message)
-- make sure these settings are correct
local settings = {
-- "from" field, only e-mail must be specified here
from = 'xxxxx',
-- smtp username
user = 'xxxx',
-- smtp password
password = 'xxxx',
-- smtp server
server = 'xxx',
-- smtp server port
port = 25,
-- enable ssl, required for gmail smtp
-- secure = 'tlsv1_2',

}

local smtp = require('socket.smtp')

if type(to) ~= 'table' then
to = { to }
end

for index, email in ipairs(to) do
to[ index ] = '<' .. tostring(email) .. '>'
end

-- message headers and body
settings.source = smtp.message({
headers = {
to = table.concat(to, ', '),
subject = subject,
['Content-type'] = 'text/html; charset=utf-8',
},
body = message
})

-- fixup from field
settings.from = '<' .. tostring(settings.from) .. '>'
settings.rcpt = to

return smtp.send(settings)
end
res, err = mail(...)
log(res, err)--------
Reply


Messages In This Thread
Email function - by XSPA2474KW - 25.01.2020, 07:40
RE: Email function - by Erwin van der Zwart - 25.01.2020, 08:47
RE: Email function - by XSPA2474KW - 25.01.2020, 13:54
RE: Email function - by admin - 25.01.2020, 13:56
RE: Email function - by XSPA2474KW - 25.01.2020, 14:55
RE: Email function - by admin - 25.01.2020, 15:28
RE: Email function - by XSPA2474KW - 25.01.2020, 16:14
RE: Email function - by Erwin van der Zwart - 25.01.2020, 16:57
RE: Email function - by XSPA2474KW - 25.01.2020, 17:17
RE: Email function - by Erwin van der Zwart - 25.01.2020, 17:43
RE: Email function - by XSPA2474KW - 25.01.2020, 18:07
RE: Email function - by Domoticatorino - 06.06.2020, 23:55
RE: Email function - by admin - 07.06.2020, 07:26
RE: Email function - by Domoticatorino - 07.06.2020, 09:12
RE: Email function - by Domoticatorino - 08.06.2020, 08:02
RE: Email function - by admin - 08.06.2020, 08:11
RE: Email function - by Domoticatorino - 08.06.2020, 08:33
RE: Email function - by admin - 08.06.2020, 08:36
RE: Email function - by toujour - 13.06.2020, 09:54
RE: Email function - by Domoticatorino - 13.06.2020, 14:42
RE: Email function - by admin - 13.06.2020, 16:06
RE: Email function - by Domoticatorino - 15.06.2020, 14:48

Forum Jump: