From users-return-235858-apmail-tomcat-users-archive=tomcat.apache.org@tomcat.apache.org Mon Aug 6 17:00:03 2012 Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 93765D388 for ; Mon, 6 Aug 2012 17:00:03 +0000 (UTC) Received: (qmail 83894 invoked by uid 500); 6 Aug 2012 17:00:00 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 83807 invoked by uid 500); 6 Aug 2012 17:00:00 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 83797 invoked by uid 99); 6 Aug 2012 17:00:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Aug 2012 17:00:00 +0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SINGLE_HEADER_2K,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [98.138.229.211] (HELO n2-vm3.bullet.mail.ne1.yahoo.com) (98.138.229.211) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Aug 2012 16:59:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=gcom1024; t=1344272373; bh=N+Z0PFo2RG+FF5VGUqdjjilSHacduTDBEf/Vk+uA7Co=; h=Received:Received:Received:DKIM-Signature:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:On 8/6/2012 9:> -----BEGIN PGP SIGNED MESSAGE-----:> Hash:>:> Mark,:>:> On 8/5/12 6:>> This system currently does not have nonlocal mail capabilities.:>:> Do you mean that you can only connect to localhost:> (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:>:> 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.:> ":>; b=arxmm9UQi0qBlSLybr4b/judg/NeEabMJhxHQW7O0Xhz6YTWkAz7C+0Tbwml3U7dmyav9T7YlENOsxDGYlYSgQRS7FSNJO6xIK9SW2Lj30/Ai7F4nLtGT6N7XQLYpeuijUvhcXIZL33ZsQvA5u8/uik+mXW0VfRsEqsYndj+bzs= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=gcom1024; d=yahoo.com; b=O1a5V0BDSCILrZPiDuup5dJQhv3pxossJz2Sy/DDPeORkb32Yp5j9LleHNGfsSRWcN0VkS2ZN9EXb/za2PWcCjuvPmJa2cJ791gHMQNc4s1R+SFs1xi0dKYZcaw8pEBtXhllBz9yHHD7EZkUbxLV+cDGZiSbnvTWY/WGdXNMhPw=; Received: from [98.138.226.174] by n2.bullet.mail.ne1.yahoo.com with NNFMP; 06 Aug 2012 16:59:33 -0000 Received: from [98.138.84.33] by t3.bullet.mail.ne1.yahoo.com with NNFMP; 06 Aug 2012 16:59:33 -0000 Received: from [127.0.0.1] by smtp101.mail.ne1.yahoo.com with NNFMP; 06 Aug 2012 16:59:32 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1344272372; bh=N+Z0PFo2RG+FF5VGUqdjjilSHacduTDBEf/Vk+uA7Co=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:On 8/6/2012 9:> -----BEGIN PGP SIGNED MESSAGE-----:> Hash:>:> Mark,:>:> On 8/5/12 6:>> This system currently does not have nonlocal mail capabilities.:>:> Do you mean that you can only connect to localhost:> (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 hav e 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:>:> 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.Prop erties) 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.:> ":>; b=Ppcg0OJ8idCPtI4jYcVu/zwaMbP4ha39zkfRCqqYiHbtM/et4CYEGFzWuJts4GwalE2FHxBT8dZctBiXdJn4dB6omzIrfjxv0qYA62kFJ+Xb+rpbG1ljFNGge4KH+59v+o3OXW7wsFmZPEoTHlmrZ0nqNi0/dtkSzXdIDk0NAqk= X-Yahoo-Newman-Id: 987560.36648.bm@smtp101.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: .ZzaNysVM1nsMZRHmOjEgeYKmpSWVJ3844IM0CxyNPCUm0w xfh4uj88DMcItmJHa0eV8_PFb5CeU6kWwAzPQwBoSPFMhKL1RwCmtSGIC7Qs OCim3qxNFeJ7ZxcbmEZzkUSNUwLmyHha5zwyI86q3HXXBcyMDLqnPyiWDIZl fm23yqj30QaimjQ0FdhVyUkG2gAe6KGVEAc7poFBb3YOXIYdaVTQW95ed9K4 Z0SqAliuYgVAGxruvkkaaJiLQ0spx.sZmwIwmqzZuQqKqrq4Xw3iGaZkhNh4 q0bWQ_RH3rkI0GChtAdtX_OAF25wtQTyXNkHHaZzleLNanhhaRND.jGqGL97 QKfP3UXbqmZYD3xxfJkbjZy3SWv3k.Dhuoivy0Ed4sFOcMm3VSg3rAfGSKTq pkd5S.R2uGo1JJL1O6AxGhVcsSiiAyM8Lg4bJNOHsHumZSRGzcX7gRagnfko t8wsKqBMmZiiJb4B50JkVWtZlX_BKu9JaYyEnvFlaYJNkY8b5jvsXwq2UD46 S8S4jRS0QmyffUCPziQeD60y2wUIf4Yhw9HOsa3qdPk6V04vdrl.zuKnInKJ SlSa8rrD224BCFaYZlx5su_2HuKdP5.a5PVBX7fBotUavrQogjG5Y9TWdq1v X4S0Nin7u5z4srOjmTRQuzEhk1HldRePl1BF5u3PiywxBk.yyyWQ- X-Yahoo-SMTP: PKuT8k2swBCeFOHzkGy5rTOUTa2hBxlR Received: from [127.0.0.1] (its_toasted@71.129.44.8 with plain) by smtp101.mail.ne1.yahoo.com with SMTP; 06 Aug 2012 09:59:32 -0700 PDT Message-ID: <501FF7D8.9090303@yahoo.com> Date: Mon, 06 Aug 2012 09:59:04 -0700 From: Mark Eggers User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: users@tomcat.apache.org Subject: Re: resource configuration for jndi mail References: <501EF0CC.8000900@yahoo.com> <501FEBF1.2040807@christopherschultz.net> In-Reply-To: <501FEBF1.2040807@christopherschultz.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Ah, careful reading (not Sunday evening reading) is your friend. I missed the above paragraph. The JNDI part I was clear on. What I missed was the "Additional resource attributes and values will be converted to properties" part. This appears in the Tomcat 7 documentation, but not the Tomcat 6 documentation. > 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 There are a lot of properties available, but unfortunately there is no password. However, the hint is there (in the paragraph that you quoted). After trolling the source for Tomcat 6 (and a bit of searching on the Internet), it appears that a password can be specified. The source in question is: org.apache.naming.factory.MailSessionFactory.java The attribute is password (in the Resource definition). That looks like the only additional (non JavaMail API) attribute / property that this factory supports (hence the hint). > >> I suppose it's time to set up postfix. > > Not a terrible idea, though not strictly necessary. > > - -chris I've never been fond of maintaining the same information in multiple places, so postfix is probably good in this environment. Sounds like I should submit a couple of patches to the documentation. 1. Add the paragraph from Tomcat 7 back into Tomcat 6 2. Add a paragraph to both stating that Tomcat's MailSessionFactory supports "password" as the only additional attribute / property. Thanks, Chris. . . . . just my two cents. /mde/ --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org