No SSL With ColdFusion's CFPOP?
I was very surprised to find out that ColdFusion's CFPOP tag does not support POP3 SSL. ColdFusion is over 10 years old now...you've got to add that in, Adobe!
Anyway, I did some digging around, and thanks to a comment on another blog by Darin Tyler, I found an easy fix. You can use some simple Java commands to "force" cfpop to use SSL. In my testing, I used Gmail, and the code is below:
<cfset javaSystemProps = javaSystem.getProperties() />
<cfset javaSystemProps.setProperty("mail.pop3.socketFactory.class", "javax.net.ssl.SSLSocketFactory") />
<cfpop
server="pop.gmail.com"
action="getAll"
name="popMessages"
port="995"
username="myemailaddress@gmail.com"
password="i'mnotgoingtotellyou">
Jake Munson
34 Yrs old
The Java call is the way to go, and I wanted to share one additional technique I've used with it: you'll want to turn SSL off if the user turns it off to access another POP account, or if the same application serves multiple users who don't all use SSL. So after you turn SSL on with the line:
<cfset javaSystemProps.setProperty("mail.pop3.socketFactory.class", "javax.net.ssl.SSLSocketFactory") />
You can turn it off with:
<cfset javaSystemProps.setProperty("mail.pop3.socketFactory.class", "javax.net.SocketFactory") />