Fully managed cloud. 30-day FREE full featured trial. Start Now
cancel
Showing results for 
Search instead for 
Did you mean: 

Send an email from Lua script through Microsoft 365 SMTP server

olgaf
Padawan

Hi,

I've written a Lua script that will send email to a recipient. The recipient is using Outlook 365 and the IT guy has provided me with their smtp server. When I send email without username, password nor smtp port definition, the email comes through, but the content of the email is stripped away with message: 

CAUTION: External email. Do not click on links or open attachments unless you know the content is safe.

When I specify port, username and password provided to me by the local IT, the email does not come through at all. The procedure stops after 1 min with error message:

Operation already in progress.

Do you have any suggestion to what may be the problem?

Regards,

Olga

 

1 ACCEPTED SOLUTION

Accepted Solutions

exa-SebastianB
Team Exasol
Team Exasol

O365 strips anything that it deems unsafe. What kind of attachment are you trying to transport?

As for the authenticated connection, you probably already guessed that this requires a TLS connection. Exasol does not yet support LuaSec. The database development team is currently working on integrating that library.

You can bundle Lua libraries with your Lua scripts using Lua amalg. We have a community article with detailed instructions: "Exasol Loves Lua part 3 - Handling Modules"

Note that you can only bundle pure-Lua modules yourself. Libraries containing C parts can only be added by Exasol.

Unfortunately for your current case TLS support requires a library that has C parts and uses OpenSSL under the hood. That library is under review by the core database team and scheduled for inclusion in the next Exasol major release. We will inform Product Management that there is demand in the current version already. Unfortunately I cannot promise that there will be a backport.

View solution in original post

3 REPLIES 3

exa-SebastianB
Team Exasol
Team Exasol

O365 strips anything that it deems unsafe. What kind of attachment are you trying to transport?

As for the authenticated connection, you probably already guessed that this requires a TLS connection. Exasol does not yet support LuaSec. The database development team is currently working on integrating that library.

You can bundle Lua libraries with your Lua scripts using Lua amalg. We have a community article with detailed instructions: "Exasol Loves Lua part 3 - Handling Modules"

Note that you can only bundle pure-Lua modules yourself. Libraries containing C parts can only be added by Exasol.

Unfortunately for your current case TLS support requires a library that has C parts and uses OpenSSL under the hood. That library is under review by the core database team and scheduled for inclusion in the next Exasol major release. We will inform Product Management that there is demand in the current version already. Unfortunately I cannot promise that there will be a backport.

olgaf
Padawan

Thank you, Sebastian.

Seems like TLS is the part I'm missing.

I am not comfortable with installation of Lua amalg and 3.part modules on customer servers. I would really prefer an Exasol version with all pre-installed.

exa-SebastianB
Team Exasol
Team Exasol

As I mentioned we will preinstall LuaSec and LuaOSSL with the next major as far as I am informed.

What we unfortunately cannot do is install all Lua modules that are out there.

Let's say you plan to use tls-mailer. This is a pure-Lua module. In this case using amalg is the required way. It depends on LuaSec and LuaSocket, which we preinstall.

You can easily download modules from LuaRocks and bundling them with your script really isn't complicated if you follow the instructions in the community article.