gemini-hlsw/ocs — pull request #158 by tpolecat (2014-12-05 21:44:48+00:00)
Title: added missing javamail providers

@swalker2m can you change the title to include whatever bug you're working on?

Added a missing config file that installs the retry handler for emails.

Prior to this change (from the OT bundle, just to be sure it's global)

```scala
scala> val s = javax.mail.Session.getInstance(new java.util.Properties)
s: javax.mail.Session = javax.mail.Session@3910adea

scala> s.getProvider("smtp")
res0: javax.mail.Provider = javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
```
After this change:

```scala
scala> s.getProvider("smtp")
res0: javax.mail.Provider = javax.mail.Provider[TRANSPORT,smtp,edu.gemini.mail.RetrySMTPTransport,Gemini 8.1m HLPG]
```

And then, with VPN off:

```scala
scala> val queue = new edu.gemini.mail.RetryQueue(new java.io.File("/tmp/mail"))
queue: edu.gemini.mail.RetryQueue = Thread[Thread-3,5,run-main-group-0]

scala> edu.gemini.mail.RetrySMTPTransport.setQueue(queue)

scala> queue.open()
Dec 05, 2014 1:40:17 PM edu.gemini.mail.RetryQueue open
INFO: Starting SMTP retry queue on /tmp/mail

scala> val m = edu.gemini.util.security.auth.keychain.KeyMailer(edu.gemini.spModel.core.Site.GS, "smtp.cl.gemini.edu")
Dec 05, 2014 1:40:28 PM edu.gemini.spModel.core.Site
INFO: Current site is null
m: edu.gemini.util.security.auth.keychain.KeyMailer = edu.gemini.util.security.auth.keychain.KeyMailer$$anon$1@6de262a1

scala> m.notifyPassword(edu.gemini.util.security.principal.UserPrincipal("rnorris@gemini.edu"), "banana").unsafePerformIO

scala> Dec 05, 2014 1:40:36 PM edu.gemini.mail.RetrySMTPTransport connect
WARNING: Connect failed. Messages will be queued for retry.
Dec 05, 2014 1:40:36 PM edu.gemini.util.security.auth.keychain.KeyMailer$$anon$1$$anonfun$send$1$$anonfun$apply$mcV$sp$2 apply
INFO: Successfully sent mail to Gemini User .
```

Mail is in the queue:

```
mail$ ls /tmp/mail
<1190610655.1417815677981.JavaMail.rnorris@monad.local>.message <1190610655.1417815677981.JavaMail.rnorris@monad.local>.session
```

Turn VPN on, wait a minute, `/tmp/mail` is empty and mail arrives. So I think we're good.