06.06.2020, 23:55
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)--------
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)--------