GUI / lua-resty-mail

A high-level, easy to use, and non-blocking email and SMTP library for OpenResty.
MIT License
66 stars 16 forks source link

Office 365 smpt issues #5

Closed iammatis closed 5 years ago

iammatis commented 5 years ago

I'm trying to send an email via Office 365 smpt, with these settings:

local mailer, err = mail.new({
  host = "smtp.office365.com",
  port = 587,
  starttls = true,
  username = "email_address",
  password = "password"
})

However each time I get an error saying:

/usr/lib/lua/resty/mail/smtp.lua:129: SMTP response was not successful: 504 5.7.4 Unrecognized authentication type [VI1PR08CA0234.eurprd08.prod.outlook.com]

When I add auth_type = "login" to settings I get:

/usr/lib/lua/resty/mail/smtp.lua:197: SMTP response was not successful: 554 5.2.0 STOREDRV.Submission.Exception:OutboundSpamException; Failed to process message due to a permanent exception with message WASCL UserAction verdict is not None. Actual verdict is HipNotify, ShowTierUpgrade. OutboundSpamException: WASCL UserAction verdict is not None. Actual verdict is HipNotify, ShowTierUpgrade. [Hostname=DM5PR0101MB2876.prod.exchangelabs.com]
iammatis commented 5 years ago

Well, for some reason it now works with auth_type = "login". Full settings:

local mailer, err = mail.new({
  host = "smtp.office365.com",
  port = 587,
  starttls = true,
  username = "email_address",
  password = "password",
  auth_type = "login"
})