Return-Path: Delivered-To: apmail-activemq-camel-dev-archive@locus.apache.org Received: (qmail 71335 invoked from network); 23 Sep 2008 09:37:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Sep 2008 09:37:13 -0000 Received: (qmail 70639 invoked by uid 500); 23 Sep 2008 09:37:11 -0000 Delivered-To: apmail-activemq-camel-dev-archive@activemq.apache.org Received: (qmail 70561 invoked by uid 500); 23 Sep 2008 09:37:10 -0000 Mailing-List: contact camel-dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-dev@activemq.apache.org Delivered-To: mailing list camel-dev@activemq.apache.org Received: (qmail 70550 invoked by uid 99); 23 Sep 2008 09:37:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Sep 2008 02:37:10 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Sep 2008 09:36:19 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 8D1C4234C1E3 for ; Tue, 23 Sep 2008 02:36:52 -0700 (PDT) Message-ID: <1074870232.1222162612576.JavaMail.jira@brutus> Date: Tue, 23 Sep 2008 02:36:52 -0700 (PDT) From: "Adam (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Commented: (CAMEL-869) A subject from message header is not copied to mailMessage In-Reply-To: <479035449.1220022052618.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/CAMEL-869?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45903#action_45903 ] Adam commented on CAMEL-869: ---------------------------- Hi Claus, Thanks for the hints. Sending plain test messages via spring mail worked just fine. The problem I found was that I was missing spring config for JavaMailSenderImpl. When I added this snippet All messages from camel-mail started coming in full fledged (subject, etc). I took a brief look at MailConfiguration for camel-mail and I guess that if a JavaMailSenderImpl is missing from spring config, camel-mail tries to create a default JavaMailSenderImpl bean from the arguments passed. I think that these conclusions can be added to the spec, or some extra plumbing for MailConfiguration/default JavaMailSenderImpl bean. Please close the issue and thanks very much for help. > A subject from message header is not copied to mailMessage > ----------------------------------------------------------- > > Key: CAMEL-869 > URL: https://issues.apache.org/activemq/browse/CAMEL-869 > Project: Apache Camel > Issue Type: Bug > Components: camel-mail > Affects Versions: 1.4.0, 1.5.0 > Reporter: Adam > Assignee: Hadrian Zbarcea > Fix For: 1.5.0 > > > The issue refers to sending emails on one of the stages in the messaging pipeline. I checked all the suggested solutions from the spec and none of the them resulted in an email message with a subject. > I have the following code: > ... > private static final String DIRECT_INFECTION_ALERT = "direct:infectionAlert"' > ... > from(DIRECT_INFECTION_ALERT) > .to("xslt:" + infectionAlertXsl) > .process(new Processor() { > public void process(Exchange exchange) throws Exception > { > Message m = exchange.getIn(); > Map headers = new HashMap(); > headers.put(TO_HEADER_KEY, recipients.toString()); > headers.put(FROM_HEADER_KEY, from); > headers.put(SUBJECT_HEADER_KEY, constant(INFECTION_ALERT_SUBJECT)); > m.setHeaders(headers); > m.setBody(exchange.getIn().getBody(), MailMessage.class); > MailMessage mail = new MailMessage(); > mail.copyFrom(m); > exchange.setIn(mail); > }}) > .to("log:debug","smtp://" + smtp_server + ":" + port); > and a simple and naive version -> > from(DIRECT_INFECTION_ALERT) > .to("xslt:" + infectionAlertXsl) > .process(new Processor() { > public void process(Exchange exchange) throws Exception > { > Message message = exchange.getIn(); > Map headers = new HashMap(); > headers.put(TO_HEADER_KEY, recipients.toString()); > headers.put(FROM_HEADER_KEY, from); > headers.put(SUBJECT_HEADER_KEY, constant(INFECTION_ALERT_SUBJECT)); > message.setHeaders(headers); > }}) > .to("log:debug","smtp://" + smtp_server + ":" + port); > I tried many other combinations, well all from the camel mail component spec. Upgraded camel to 1.5-SNAPSHOT (comes with fix for disabling authentication on missing username/password for mail server). I can receive email messages, no problem, but never managed to get one with a subject. On debugging, messages always have correct headers (subject, to, from, etc) but then the info is lost somewhere. > Thanks > Adam -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.