Always use iconv, don't try to start it. This enables a choice between iconv implementations.
Escape the headers using RFC2047

Incorporates the encoding code from rfc2047.erl from Zotonic to encode
the Subject: header. Also adds parser for RFC 822-style address lists;
encode all header values with RFC2047.

Squashed commit of the following:

commit 5573728e0eed403b919d947c5ee30fb6c6554dbb
Author: Arjan Scherpenisse <arjan@scherpenisse.net>
Date:   Mon Nov 5 23:05:25 2012 +0100

    Add test with decode_header

commit 749b140dd9f75dd327ab7ee63af72fa78e313ade
Author: Arjan Scherpenisse <arjan@scherpenisse.net>
Date:   Mon Nov 5 21:49:13 2012 +0100

    Add parser for RFC 822-style address lists; encode all header values with RFC2047.

commit b9f1196f48215e9780c632e630cdf5b57d343265
Author: Arjan Scherpenisse <arjan@scherpenisse.net>
Date:   Mon Nov 5 15:59:32 2012 +0100

    Escape the Subject: header using RFC2047

    Incorporates the encoding code from rfc2047.erl from Zotonic to encode
    the Subject: header.
Use newer rebar version which does not brake the build on a compilation *warning*
If TLS upgrade crashes then try again without SSL.
A crash can happen on servers with self-signed certificates.
Fix 'EXIT' tuple, no pid here.
Add missing catch (where did that one go?)
Let binstr handle correctly an empty list. Thanks to dLuna.  Fixes #42.
Merge branch 'mw-ssl-upgrade-crash' of git://github.com/zotonic/gen_smtp into zotonic-mw-ssl-upgrade-crash
Added 'make test' command for simple eunit testing with ssl and iconv
Decode headers in multipart messages sub-bodies.

This is useful for, eg, when attachement filenames are not in ASCII encoding
Eunit test for decode-multipart-headers patch #36
Fix for typo in previous patches. Small change in test case to prevent Erlang character set issues.
Fix crash for endless recursion when parsing illegal e-mail address. Fixes #48
Make gen_smtp dialyze, bumping it up to modern day Erlang versions.
Use the application dependency list instead of manually starting apps.

This is the standard method of starting application dependencies and
is less error prone than attempting to ensure applications are started
whenever the client code needs those applications started.
Use application:ensure_all_started/1 instead of manually starting our dependencies.
Use our implementation of ensure_all_started/1 instead of the Erlang one.

This means that Erlang versions which do not have it built in can
continue to be supported.

Closes #51.
Remove the compatibilty shims from the binstr module.
Merge pull request #50 from AeroNotix/master

Make gen_smtp dialyze, bumping it up to modern day Erlang versions.
DKIM signing prototype