Return-Path: Delivered-To: apmail-activemq-camel-dev-archive@locus.apache.org Received: (qmail 2461 invoked from network); 27 Oct 2008 12:01:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Oct 2008 12:01:44 -0000 Received: (qmail 94487 invoked by uid 500); 27 Oct 2008 12:01:49 -0000 Delivered-To: apmail-activemq-camel-dev-archive@activemq.apache.org Received: (qmail 94410 invoked by uid 500); 27 Oct 2008 12:01:48 -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 94313 invoked by uid 99); 27 Oct 2008 12:01:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Oct 2008 05:01:48 -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; Mon, 27 Oct 2008 12:00:43 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B4EF5234C237 for ; Mon, 27 Oct 2008 05:00:53 -0700 (PDT) Message-ID: <101301679.1225108853740.JavaMail.jira@brutus> Date: Mon, 27 Oct 2008 05:00:53 -0700 (PDT) From: "David Peterson (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Commented: (CAMEL-1028) Don't require username on send mail routes (relays don't require login) In-Reply-To: <104671508.1225105732598.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-1028?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46853#action_46853 ] David Peterson commented on CAMEL-1028: --------------------------------------- Yes, it is fixed in 1.5-SNAPSHOT. Thanks. > Don't require username on send mail routes (relays don't require login) > ----------------------------------------------------------------------- > > Key: CAMEL-1028 > URL: https://issues.apache.org/activemq/browse/CAMEL-1028 > Project: Apache Camel > Issue Type: Bug > Components: camel-mail > Affects Versions: 1.4.0 > Reporter: David Peterson > > Don't require a login in the send mail URI because internal relay mail servers don't require them. If you do include one, the mail server gets confused and thinks that you are looping and it will bounce the email so this is a bit inconvenient bug. > Thread [Thread: 1 org.apache.camel.component.mail.MailComponent@663ec] (Suspended (exception NullPointerException)) > Properties(Hashtable).put(K, V) line: 394 > MailConfiguration.createJavaMailProperties() line: 146 > MailConfiguration.createJavaMailSender() line: 107 > MailEndpoint.createProducer() line: 53 > ProducerCache.getProducer(Endpoint) line: 50 > ProducerCache.send(Endpoint, Processor) line: 84 > DefaultProducerTemplate.send(Endpoint, Processor) line: 84 > DefaultProducerTemplate.sendBodyAndHeaders(Endpoint, Object, Map) line: 143 > DefaultProducerTemplate.sendBodyAndHeaders(String, Object, Map) line: 139 > LogEmailThrowsAdvice.sendEmail(String) line: 64 > LogEmailThrowsAdvice.afterThrowing(Method, Object[], Object, Exception) line: 42 > NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] > NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39 > DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 > Method.invoke(Object, Object...) line: 597 > ThrowsAdviceInterceptor.invokeHandlerMethod(MethodInvocation, Throwable, Method) line: 146 > ThrowsAdviceInterceptor.invoke(MethodInvocation) line: 131 > ReflectiveMethodInvocation.proceed() line: 171 > JdkDynamicAopProxy.invoke(Object, Method, Object[]) line: 204 > $Proxy24.process(Exchange) line: not available > BeanProcessor.process(Exchange) line: 81 > BeanEndpoint(ProcessorEndpoint).onExchange(Exchange) line: 92 > ProcessorEndpoint$1.process(Exchange) line: 66 > AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(Exchange, AsyncCallback) line: 43 > SendProcessor.process(Exchange, AsyncCallback) line: 75 > InstrumentationProcessor.process(Exchange, AsyncCallback) line: 57 > DeadLetterChannel.process(Exchange, AsyncCallback, DeadLetterChannel$RedeliveryData) line: 155 > DeadLetterChannel.process(Exchange, AsyncCallback) line: 91 > InstrumentationProcessor.process(Exchange, AsyncCallback) line: 57 > UnitOfWorkProcessor.process(Exchange, AsyncCallback) line: 39 > AsyncProcessorHelper.process(AsyncProcessor, Exchange) line: 41 > UnitOfWorkProcessor(DelegateAsyncProcessor).process(Exchange) line: 66 > MailConsumer.processMessage(Message) line: 169 > MailConsumer.processMessages(Message[]) line: 151 > MailConsumer.poll() line: 105 > MailConsumer(ScheduledPollConsumer).run() line: 65 > Executors$RunnableAdapter.call() line: 441 > FutureTask$Sync.innerRunAndReset() line: 317 > ScheduledThreadPoolExecutor$ScheduledFutureTask(FutureTask).runAndReset() line: 150 > ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor$ScheduledFutureTask) line: 98 > ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic() line: 181 > ScheduledThreadPoolExecutor$ScheduledFutureTask.run() line: 205 > ThreadPoolExecutor$Worker.runTask(Runnable) line: 885 > ThreadPoolExecutor$Worker.run() line: 907 > Thread.run() line: 619 > Code: > AOPExceptionHandler: > private void sendEmail(String errors) { > template = camelContext.createProducerTemplate(); > StringBuffer body = new StringBuffer("Hello Techops.\n"); > body.append("Got an exception please handle.\n\nRegards Reportdev.\n\n"); > body.append(errors); > template.sendBodyAndHeaders(emailServerUri, body, emailProperties); > } > applicationContext.xml > > > > > value="smtp://mail.apache.corp" /> > > > > "ReportDev@apache.com" > > > "Exception in 3rd Party Reporting Email > Processing" > > > "DPeterson@apache.com" > > > > > > Workaround is to use URI for "To" and put the username after the ? in the URI. This will fool the mail relay server into routing the email bypassing it's loop detection logic: > > > > > value="smtp://mail.contextweb.corp?username=reportdev&to=DPeterson@apache.com" /> > > > > "ReportDev@apache.com" > > > "Exception in 3rd Party Reporting Email > Processing" > > > > > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.