smtp.cr icon indicating copy to clipboard operation
smtp.cr copied to clipboard

TLS connection to smtp server with password

Open samueleaton opened this issue 8 years ago • 8 comments

I'm trying to get something like you would see here.

For reference, I've used a node.js module, Nodemailer, that is able to implement that as seen in this example. It looks like the bulk of the work happens in this module.

I would like to add some more secure functionality to smtp. Let me know if there is anything I can do to help.

samueleaton avatar Oct 27 '16 17:10 samueleaton

Hi @samueleaton:

@sdogruyol asked for the same functionality for gmail smtp. There's 2 main features to implement, TLS connections (OpenSSL::SSL::Context::Client, https://crystal-lang.org/api/master/OpenSSL/SSL/Context/Client.html ) and Plain Auth (Super simple to implement). if you know the RFC's related to this features, you could help us with a Pull Request. I have a rough estimate to implement all the features in the first week of November, but i'm very bad with release dates :), so if you can help i'll appreciate it a lot.

ray-delossantos avatar Oct 28 '16 03:10 ray-delossantos

Yeah looking at how some other libs do it it didn't seem like too much work. We should think of a good api and then get crackin'.

Even though there is more demand for gmail, I think most would agree that it should work for many services and let the user be able to "plug 'n play". The nodemailer team did some work for us and has gathered a list of common services with domain alias, ports and security types.

samueleaton avatar Oct 28 '16 04:10 samueleaton

Maybe take in consideration this api:

http://ruby-doc.org/stdlib-2.0.0/libdoc/net/smtp/rdoc/Net/SMTP.html

ray-delossantos avatar Oct 28 '16 04:10 ray-delossantos

yeah i was reading the source code earlier today and saw that ruby was using the openssl lib like you suggested.

samueleaton avatar Oct 28 '16 04:10 samueleaton

See also: https://github.com/crystal-lang/crystal/blob/36b2fc4a677721ef5c7f2a27d6270f72b2999019/src/http/client.cr#L154 here's the code of TLS connection usage.

ray-delossantos avatar Oct 28 '16 05:10 ray-delossantos

I'm using https://github.com/arcage/crystal-email to auth with tls. Seems to work. Perhaps bringing the libs together somehow could help?

crisward avatar Jan 17 '17 10:01 crisward

Hello @crisward

Nice to know about this lib, i'll put a message in the readme file. Is there something in smtp.cr that you'll like to see in the crystal-email code base to cover in a PR?.

ray-delossantos avatar Jan 17 '17 11:01 ray-delossantos

Crystal email doesn't support HTML emails, and smtp.cr doesn't support attachments or tls. It'd be nice if we had one library with all the features.

crisward avatar Jan 17 '17 11:01 crisward