Feature Proposal: Add support for SSL and TLS transport for SMTP

Motivation

GMail requires SSL or TLS. *nix users can support this using a local SMTP daemon, even SSMTP. But Windows users don't have that option.

Description and Documentation

Add a configuration option on the Mail configuration to choose SMTP, SMTP::TLS or SMTP::SSL. Also add checker to verify the dependency if the SSL or TLS method is chosen. and to make the user / password fields required as necessary.

See discussion at http://irclogs.foswiki.org/bin/irclogger_log/foswiki?date=2011-02-01,Tue&sel=640#l636

Examples

Impact

%WHATDOESITAFFECT%
edit

Implementation

-- Contributors: GeorgeClark - 01 Feb 2011

Discussion

on linux/unix, I use ssmtp - a sendmail replacement that does the job remarkable well.

however, I've not looked hard to find a similar tool that works on windows (though there is an ssmtp for cygwin, I never recomend cygwin)

-- SvenDowideit - 02 Feb 2011

I was the requester on IRC. I did a quick search and found Net::SMTP::TLS in CPAN. Maybe this module can be used for the Strawberry Perl implementation? A drop-down for the type of Authentication can then overwrite the setting and use the above-mentioned module.

-- SilviuSuceveanu - 02 Feb 2011

I started to implement this feature. SSL appears to be easy to do. However there are issues with TLS. The Perl CPAN module Net::SMTP::TLS appears to be a very incomplete implementation. It crashes if there are any issues with the email address. Net::SMTP permits bad email addresses to be ignored, but the TLS implementation is missing this .. and many other features of the base SMTP class.

I'll probably go ahead and implement SSL support, and hope that a better SMTP::TLS implementation comes along.

-- GeorgeClark - 25 Mar 2011

I managed to get gmail SMTP working using Foswiki. I configured the SMTPHOST to smtp.gmail.com:465. I then patched Net.pm changed calls to Net::SMTP->new to Net::SMTP::SSL-> new and changed the require. It worked fine. So just needs a configure option to direct Net.pm to call Net::SMTP::SSL. Under ubuntu I had to install SMTP SSL support: sudo apt-get install libnet-smtp-ssl-perl

-- JohnMurphy - 13 Jul 2011

The code is competed and merged into the upcoming. 1.1.4. It includes additional configuration settings, config checkers, and was combined with support for S/MIME and a "Test email" button in configure. Thanks for the feedback.

-- GeorgeClark - 14 Jul 2011
 
Topic revision: r9 - 14 Jul 2011, GeorgeClark - This page was cached on 23 Jan 2018 - 22:18.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License