views:

397

answers:

3

I apologize if this question has been asked before. I did a rather extensive search for similar questions, however all I could find were answers related to C++ or C#. I'm using GNU C.

I'm writing a daemon that needs to be able to send e-mail using SMTP. I need to be able to login to an external mail server, send the email and interpret any error codes. For various reasons, I can not use the system's sendmail facility (if even one is present).

The library should support at least OpenSSL. GNUTLS would be a perk, but not really needed.

Ideally, the library would be licensed LGPL2 (and later) or 3 clause BSD.

Any suggestions?

+1  A: 

http://josefsson.org/gsasl/

That seems like it would work. LGPL. C. SASL.

RibaldEddie
+1  A: 

This answer is more for anyone reading this post after the fact, but it looks like as of version 7.20.0 libcurl supports SMTP, including SSL.

It looks like SASL support is planned, but maybe not released yet. I did find this patch however.

bde
+1  A: 

Tim,

Have you looked at CyaSSL? It supports all current industry standards up to TLS 1.2 (as well as some cool features such as stream ciphers), has an OpenSSL compatibility layer, and focuses on optimizing speed and size.

It's dual licensed under both GPLv2 and a commercial license (if you need support). I recently used it with some Android work I was doing and was very pleased.

http://yassl.com/yaSSL/Products_cyassl.html

Regards,
Chris

Chrisc