At time of writing, Confluence (4.3) doesn’t easily support sending email via SMTPs, which makes using it with Google Apps a bit difficult. At GLiNTECH we worked around the issue using stunnel.
We run Confluence on Ubuntu and stunnel is available in the apt repository so is a cinch to set up...
sudo apt-get update
sudo apt-get install stunnel4
You’ll need to enable stunnel to start, so edit /etc/default/stunnel and set:
ENABLED=1
You’ll need to create a certificate and private key (pem). This can be done quickly using openssl:
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout stunnel.pem -out stunnel.pem
Move stunnel.pem to /etc/stunnel/stunnel.pem
Create /etc/stunnel/stunnel.conf with the following contents
chroot = /var/lib/stunnel4/
setuid = stunnel4
setgid = stunnel4
pid = /stunnel4.pid
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
client = yes
cert = /etc/stunnel/stunnel.pem
options = NO_SSLv2
options = SINGLE_ECDH_USE
options = SINGLE_DH_USE
[pop3s]
accept = 110
connect = pop.gmail.com:995
[imaps]
accept = 143
connect = imap.gmail.com:993
[ssmtp]
accept = 25
connect = smtp.gmail.com:465
Start Stunnel with sudo /etc/init.d/stunnel start
Now configure Confluence to use Stunnel as it’s SMTP server:
Test it out by sending a test email...
All done with zero downtime!