tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: resource configuration for jndi mail
Date Mon, 06 Aug 2012 16:08:17 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mark,

On 8/5/12 6:16 PM, Mark Eggers wrote:
> This system currently does not have nonlocal mail capabilities.

Do you mean that you can only connect to localhost:25 or that you can
(and must) connect to Gmail in order to send email to non-local
destinations? I suspect you mean the latter.

> The only other applications at this point (Icinga, Redmine) talk to
> a GMail service account directly.
> 
> I'm really at a tipping point here - configure postfix to forward 
> nonlocal mail to GMail using the service account, or configure
> (another) direct connection.

Direct-connect isn't too bad, though it might be nice to have postfix
doing the queuing (and re-trying) for you locally.

> Just to get things running, I'm thinking of using the direct
> connection and defining all of the parameters in a Resource element
> in context.xml.
> 
> I understand from the documentation that I can define the host name
> with the attribute mail.smtp.host.
> 
> Will translating the other properties I need to send mail via GMail
> to attributes work (port, password, auth, and so on)? The other
> mechanism is to set these in CATALINA_OPTS. The latter makes these
> values more easily accessible (casual ps command for example).

See the JNDI Resources HOWTO:
http://tomcat.apache.org/tomcat-7.0-doc/jndi-resources-howto.html

Specifically, there is this passage under "Configure Tomcat's Resource
Factory" (the one for "mail/Session"... there are like 5 of those
titles in the JNDI HOWTO but only one for SMTP):

"
Additional resource attributes and values will be converted to
properties and values and passed to
javax.mail.Session.getInstance(java.util.Properties) as part of the
java.util.Properties collection. In addition to the properties defined
in Annex A of the JavaMail specification, individual providers may
also support additional properties like password.
"

You can find big lists of properties that can you set in the following
locations:

http://java.sun.com/products/javamail/javadocs/javax/mail/package-summary.html
http://javamail.kenai.com/nonav/javadocs/com/sun/mail/smtp/package-summary.html
http://java.sun.com/products/javamail/javadocs/javax/mail/internet/package-summary.html

> I suppose it's time to set up postfix.

Not a terrible idea, though not strictly necessary.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlAf6/EACgkQ9CaO5/Lv0PDYLgCgp1IEYjBbcULySyfKN/JPTDIW
+sYAn1fO7JW8j/+AR0zQbY37BXOiYJKO
=EYXv
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message