You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "David Peterson (JIRA)" <ji...@apache.org> on 2008/10/27 12:08:52 UTC
[jira] Created: (CAMEL-1028) Don't require username on send mail
routes (relays don't require login)
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.
e RuntimeCamelException (id=212)
cause FailedToCreateProducerException (id=215)
detailMessage "org.apache.camel.FailedToCreateProducerException: Failed to create Producer for endpoint: Endpoint[smtp://mail.contextweb.corp]. Reason: java.lang.NullPointerException" (id=217)
stackTrace null
Stack Trace:
Thread [Thread: 1 org.apache.camel.component.mail.MailComponent@663ec] (Suspended)
AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(Exchange, AsyncCallback) line: 45
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<E>).run() line: 65
Executors$RunnableAdapter<T>.call() line: 441
FutureTask$Sync.innerRunAndReset() line: 317
ScheduledThreadPoolExecutor$ScheduledFutureTask<V>(FutureTask<V>).runAndReset() line: 150
ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.access$101(ScheduledThreadPoolExecutor$ScheduledFutureTask) line: 98
ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.runPeriodic() line: 181
ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.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
<bean id="logThrowsAdvice" class="com.contextweb.advice.LogEmailThrowsAdvice">
<property name="camelContext" ref="camel" />
<property name="sendMail" value="true" />
<!-- username=reportdev&to=DPeterson@apache.com -->
<property name="emailServerUri"
value="smtp://mail.apache.corp" />
<property name="emailProperties">
<map>
<entry key="From">
<value>"ReportDev@apache.com"</value>
</entry>
<entry key="Subject">
<value>"Exception in 3rd Party Reporting Email
Processing"</value>
</entry>
<entry key="To">
<value>"DPeterson@apache.com"</value>
</entry>
</map>
</property>
<property name="logFactory" ref="LogFactoryBean" />
</bean>
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:
<!-- Define the ThrowsAdvice bean -->
<bean id="logThrowsAdvice" class="com.contextweb.advice.LogEmailThrowsAdvice">
<property name="camelContext" ref="camel" />
<property name="sendMail" value="true" />
<property name="emailServerUri"
value="smtp://mail.contextweb.corp?username=reportdev&to=DPeterson@apache.com" />
<property name="emailProperties">
<map>
<entry key="From">
<value>"ReportDev@apache.com"</value>
</entry>
<entry key="Subject">
<value>"Exception in 3rd Party Reporting Email
Processing"</value>
</entry>
</map>
</property>
<property name="logFactory" ref="LogFactoryBean" />
</bean>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (CAMEL-1028) Don't require username on send mail
routes (relays don't require login)
Posted by "David Peterson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-1028?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
David Peterson updated CAMEL-1028:
----------------------------------
Description:
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<K,V>).put(K, V) line: 394
MailConfiguration.createJavaMailProperties() line: 146
MailConfiguration.createJavaMailSender() line: 107
MailEndpoint.createProducer() line: 53
ProducerCache<E>.getProducer(Endpoint<E>) line: 50
ProducerCache<E>.send(Endpoint<E>, Processor) line: 84
DefaultProducerTemplate<E>.send(Endpoint<E>, Processor) line: 84
DefaultProducerTemplate<E>.sendBodyAndHeaders(Endpoint, Object, Map<String,Object>) line: 143
DefaultProducerTemplate<E>.sendBodyAndHeaders(String, Object, Map<String,Object>) 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<E>).run() line: 65
Executors$RunnableAdapter<T>.call() line: 441
FutureTask$Sync.innerRunAndReset() line: 317
ScheduledThreadPoolExecutor$ScheduledFutureTask<V>(FutureTask<V>).runAndReset() line: 150
ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.access$101(ScheduledThreadPoolExecutor$ScheduledFutureTask) line: 98
ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.runPeriodic() line: 181
ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.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
<bean id="logThrowsAdvice" class="com.contextweb.advice.LogEmailThrowsAdvice">
<property name="camelContext" ref="camel" />
<property name="sendMail" value="true" />
<!-- username=reportdev&to=DPeterson@apache.com -->
<property name="emailServerUri"
value="smtp://mail.apache.corp" />
<property name="emailProperties">
<map>
<entry key="From">
<value>"ReportDev@apache.com"</value>
</entry>
<entry key="Subject">
<value>"Exception in 3rd Party Reporting Email
Processing"</value>
</entry>
<entry key="To">
<value>"DPeterson@apache.com"</value>
</entry>
</map>
</property>
<property name="logFactory" ref="LogFactoryBean" />
</bean>
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:
<!-- Define the ThrowsAdvice bean -->
<bean id="logThrowsAdvice" class="com.contextweb.advice.LogEmailThrowsAdvice">
<property name="camelContext" ref="camel" />
<property name="sendMail" value="true" />
<property name="emailServerUri"
value="smtp://mail.contextweb.corp?username=reportdev&to=DPeterson@apache.com" />
<property name="emailProperties">
<map>
<entry key="From">
<value>"ReportDev@apache.com"</value>
</entry>
<entry key="Subject">
<value>"Exception in 3rd Party Reporting Email
Processing"</value>
</entry>
</map>
</property>
<property name="logFactory" ref="LogFactoryBean" />
</bean>
was:
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.
e RuntimeCamelException (id=212)
cause FailedToCreateProducerException (id=215)
detailMessage "org.apache.camel.FailedToCreateProducerException: Failed to create Producer for endpoint: Endpoint[smtp://mail.contextweb.corp]. Reason: java.lang.NullPointerException" (id=217)
stackTrace null
Stack Trace:
Thread [Thread: 1 org.apache.camel.component.mail.MailComponent@663ec] (Suspended)
AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(Exchange, AsyncCallback) line: 45
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<E>).run() line: 65
Executors$RunnableAdapter<T>.call() line: 441
FutureTask$Sync.innerRunAndReset() line: 317
ScheduledThreadPoolExecutor$ScheduledFutureTask<V>(FutureTask<V>).runAndReset() line: 150
ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.access$101(ScheduledThreadPoolExecutor$ScheduledFutureTask) line: 98
ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.runPeriodic() line: 181
ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.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
<bean id="logThrowsAdvice" class="com.contextweb.advice.LogEmailThrowsAdvice">
<property name="camelContext" ref="camel" />
<property name="sendMail" value="true" />
<!-- username=reportdev&to=DPeterson@apache.com -->
<property name="emailServerUri"
value="smtp://mail.apache.corp" />
<property name="emailProperties">
<map>
<entry key="From">
<value>"ReportDev@apache.com"</value>
</entry>
<entry key="Subject">
<value>"Exception in 3rd Party Reporting Email
Processing"</value>
</entry>
<entry key="To">
<value>"DPeterson@apache.com"</value>
</entry>
</map>
</property>
<property name="logFactory" ref="LogFactoryBean" />
</bean>
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:
<!-- Define the ThrowsAdvice bean -->
<bean id="logThrowsAdvice" class="com.contextweb.advice.LogEmailThrowsAdvice">
<property name="camelContext" ref="camel" />
<property name="sendMail" value="true" />
<property name="emailServerUri"
value="smtp://mail.contextweb.corp?username=reportdev&to=DPeterson@apache.com" />
<property name="emailProperties">
<map>
<entry key="From">
<value>"ReportDev@apache.com"</value>
</entry>
<entry key="Subject">
<value>"Exception in 3rd Party Reporting Email
Processing"</value>
</entry>
</map>
</property>
<property name="logFactory" ref="LogFactoryBean" />
</bean>
Changed eclipse to catch the actual NullPointerException so replacing the stack trace w/ a better one.
> 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<K,V>).put(K, V) line: 394
> MailConfiguration.createJavaMailProperties() line: 146
> MailConfiguration.createJavaMailSender() line: 107
> MailEndpoint.createProducer() line: 53
> ProducerCache<E>.getProducer(Endpoint<E>) line: 50
> ProducerCache<E>.send(Endpoint<E>, Processor) line: 84
> DefaultProducerTemplate<E>.send(Endpoint<E>, Processor) line: 84
> DefaultProducerTemplate<E>.sendBodyAndHeaders(Endpoint, Object, Map<String,Object>) line: 143
> DefaultProducerTemplate<E>.sendBodyAndHeaders(String, Object, Map<String,Object>) 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<E>).run() line: 65
> Executors$RunnableAdapter<T>.call() line: 441
> FutureTask$Sync.innerRunAndReset() line: 317
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>(FutureTask<V>).runAndReset() line: 150
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.access$101(ScheduledThreadPoolExecutor$ScheduledFutureTask) line: 98
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.runPeriodic() line: 181
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.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
> <bean id="logThrowsAdvice" class="com.contextweb.advice.LogEmailThrowsAdvice">
> <property name="camelContext" ref="camel" />
> <property name="sendMail" value="true" />
> <!-- username=reportdev&to=DPeterson@apache.com -->
> <property name="emailServerUri"
> value="smtp://mail.apache.corp" />
> <property name="emailProperties">
> <map>
> <entry key="From">
> <value>"ReportDev@apache.com"</value>
> </entry>
> <entry key="Subject">
> <value>"Exception in 3rd Party Reporting Email
> Processing"</value>
> </entry>
> <entry key="To">
> <value>"DPeterson@apache.com"</value>
> </entry>
> </map>
> </property>
> <property name="logFactory" ref="LogFactoryBean" />
> </bean>
> 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:
> <!-- Define the ThrowsAdvice bean -->
> <bean id="logThrowsAdvice" class="com.contextweb.advice.LogEmailThrowsAdvice">
> <property name="camelContext" ref="camel" />
> <property name="sendMail" value="true" />
> <property name="emailServerUri"
> value="smtp://mail.contextweb.corp?username=reportdev&to=DPeterson@apache.com" />
> <property name="emailProperties">
> <map>
> <entry key="From">
> <value>"ReportDev@apache.com"</value>
> </entry>
> <entry key="Subject">
> <value>"Exception in 3rd Party Reporting Email
> Processing"</value>
> </entry>
> </map>
> </property>
> <property name="logFactory" ref="LogFactoryBean" />
> </bean>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (CAMEL-1028) Don't require username on send mail
routes (relays don't require login)
Posted by "David Peterson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-1028?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
David Peterson updated CAMEL-1028:
----------------------------------
However, I have to stay with my workaround for now. I cannot switch to 1.5-SNAPSHOT until this gets fixed (was working in 1.4, broken in 1.5).
http://www.nabble.com/processOnlyUnseenMessages%3Dtrue-not-working-in-1.4.0--tt20120636s22882.html#a20169282
> 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<K,V>).put(K, V) line: 394
> MailConfiguration.createJavaMailProperties() line: 146
> MailConfiguration.createJavaMailSender() line: 107
> MailEndpoint.createProducer() line: 53
> ProducerCache<E>.getProducer(Endpoint<E>) line: 50
> ProducerCache<E>.send(Endpoint<E>, Processor) line: 84
> DefaultProducerTemplate<E>.send(Endpoint<E>, Processor) line: 84
> DefaultProducerTemplate<E>.sendBodyAndHeaders(Endpoint, Object, Map<String,Object>) line: 143
> DefaultProducerTemplate<E>.sendBodyAndHeaders(String, Object, Map<String,Object>) 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<E>).run() line: 65
> Executors$RunnableAdapter<T>.call() line: 441
> FutureTask$Sync.innerRunAndReset() line: 317
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>(FutureTask<V>).runAndReset() line: 150
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.access$101(ScheduledThreadPoolExecutor$ScheduledFutureTask) line: 98
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.runPeriodic() line: 181
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.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
> <bean id="logThrowsAdvice" class="com.contextweb.advice.LogEmailThrowsAdvice">
> <property name="camelContext" ref="camel" />
> <property name="sendMail" value="true" />
> <!-- username=reportdev&to=DPeterson@apache.com -->
> <property name="emailServerUri"
> value="smtp://mail.apache.corp" />
> <property name="emailProperties">
> <map>
> <entry key="From">
> <value>"ReportDev@apache.com"</value>
> </entry>
> <entry key="Subject">
> <value>"Exception in 3rd Party Reporting Email
> Processing"</value>
> </entry>
> <entry key="To">
> <value>"DPeterson@apache.com"</value>
> </entry>
> </map>
> </property>
> <property name="logFactory" ref="LogFactoryBean" />
> </bean>
> 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:
> <!-- Define the ThrowsAdvice bean -->
> <bean id="logThrowsAdvice" class="com.contextweb.advice.LogEmailThrowsAdvice">
> <property name="camelContext" ref="camel" />
> <property name="sendMail" value="true" />
> <property name="emailServerUri"
> value="smtp://mail.contextweb.corp?username=reportdev&to=DPeterson@apache.com" />
> <property name="emailProperties">
> <map>
> <entry key="From">
> <value>"ReportDev@apache.com"</value>
> </entry>
> <entry key="Subject">
> <value>"Exception in 3rd Party Reporting Email
> Processing"</value>
> </entry>
> </map>
> </property>
> <property name="logFactory" ref="LogFactoryBean" />
> </bean>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-1028) Don't require username on send mail
routes (relays don't require login)
Posted by "David Peterson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-1028?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46856#action_46856 ]
David Peterson commented on CAMEL-1028:
---------------------------------------
Yes, I'm speaking about the new error #2. Sorry, it's a bit buried down in the Forum thread, but here is a snippet of it along with Janstey's comment that it will be fixed in the next snapshot.
2. New Exception in trying to process Excel files. This works in 1.4.0 so something got broken in 1.5-SNAPSHOT.
[org.apache.camel.NoTypeConversionAvailableException] thrown by target class [com.contextweb.mail.MailReader] and method [public abstract void org.apache.camel.Processor.process(org.apache.camel.Exchange) throws java.lang.Exception]org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: class com.sun.mail.util.BASE64DecoderStream to the required type: org.apache.commons.logging.Log with value com.sun.mail.util.BASE64DecoderStream@aa4bf8
at org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:117)
Janstey response:
#2 should be fixed in the next SNAPSHOT deploy.
> 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<K,V>).put(K, V) line: 394
> MailConfiguration.createJavaMailProperties() line: 146
> MailConfiguration.createJavaMailSender() line: 107
> MailEndpoint.createProducer() line: 53
> ProducerCache<E>.getProducer(Endpoint<E>) line: 50
> ProducerCache<E>.send(Endpoint<E>, Processor) line: 84
> DefaultProducerTemplate<E>.send(Endpoint<E>, Processor) line: 84
> DefaultProducerTemplate<E>.sendBodyAndHeaders(Endpoint, Object, Map<String,Object>) line: 143
> DefaultProducerTemplate<E>.sendBodyAndHeaders(String, Object, Map<String,Object>) 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<E>).run() line: 65
> Executors$RunnableAdapter<T>.call() line: 441
> FutureTask$Sync.innerRunAndReset() line: 317
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>(FutureTask<V>).runAndReset() line: 150
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.access$101(ScheduledThreadPoolExecutor$ScheduledFutureTask) line: 98
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.runPeriodic() line: 181
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.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
> <bean id="logThrowsAdvice" class="com.contextweb.advice.LogEmailThrowsAdvice">
> <property name="camelContext" ref="camel" />
> <property name="sendMail" value="true" />
> <!-- username=reportdev&to=DPeterson@apache.com -->
> <property name="emailServerUri"
> value="smtp://mail.apache.corp" />
> <property name="emailProperties">
> <map>
> <entry key="From">
> <value>"ReportDev@apache.com"</value>
> </entry>
> <entry key="Subject">
> <value>"Exception in 3rd Party Reporting Email
> Processing"</value>
> </entry>
> <entry key="To">
> <value>"DPeterson@apache.com"</value>
> </entry>
> </map>
> </property>
> <property name="logFactory" ref="LogFactoryBean" />
> </bean>
> 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:
> <!-- Define the ThrowsAdvice bean -->
> <bean id="logThrowsAdvice" class="com.contextweb.advice.LogEmailThrowsAdvice">
> <property name="camelContext" ref="camel" />
> <property name="sendMail" value="true" />
> <property name="emailServerUri"
> value="smtp://mail.contextweb.corp?username=reportdev&to=DPeterson@apache.com" />
> <property name="emailProperties">
> <map>
> <entry key="From">
> <value>"ReportDev@apache.com"</value>
> </entry>
> <entry key="Subject">
> <value>"Exception in 3rd Party Reporting Email
> Processing"</value>
> </entry>
> </map>
> </property>
> <property name="logFactory" ref="LogFactoryBean" />
> </bean>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-1028) Don't require username on send mail
routes (relays don't require login)
Posted by "David Peterson (JIRA)" <ji...@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<K,V>).put(K, V) line: 394
> MailConfiguration.createJavaMailProperties() line: 146
> MailConfiguration.createJavaMailSender() line: 107
> MailEndpoint.createProducer() line: 53
> ProducerCache<E>.getProducer(Endpoint<E>) line: 50
> ProducerCache<E>.send(Endpoint<E>, Processor) line: 84
> DefaultProducerTemplate<E>.send(Endpoint<E>, Processor) line: 84
> DefaultProducerTemplate<E>.sendBodyAndHeaders(Endpoint, Object, Map<String,Object>) line: 143
> DefaultProducerTemplate<E>.sendBodyAndHeaders(String, Object, Map<String,Object>) 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<E>).run() line: 65
> Executors$RunnableAdapter<T>.call() line: 441
> FutureTask$Sync.innerRunAndReset() line: 317
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>(FutureTask<V>).runAndReset() line: 150
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.access$101(ScheduledThreadPoolExecutor$ScheduledFutureTask) line: 98
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.runPeriodic() line: 181
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.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
> <bean id="logThrowsAdvice" class="com.contextweb.advice.LogEmailThrowsAdvice">
> <property name="camelContext" ref="camel" />
> <property name="sendMail" value="true" />
> <!-- username=reportdev&to=DPeterson@apache.com -->
> <property name="emailServerUri"
> value="smtp://mail.apache.corp" />
> <property name="emailProperties">
> <map>
> <entry key="From">
> <value>"ReportDev@apache.com"</value>
> </entry>
> <entry key="Subject">
> <value>"Exception in 3rd Party Reporting Email
> Processing"</value>
> </entry>
> <entry key="To">
> <value>"DPeterson@apache.com"</value>
> </entry>
> </map>
> </property>
> <property name="logFactory" ref="LogFactoryBean" />
> </bean>
> 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:
> <!-- Define the ThrowsAdvice bean -->
> <bean id="logThrowsAdvice" class="com.contextweb.advice.LogEmailThrowsAdvice">
> <property name="camelContext" ref="camel" />
> <property name="sendMail" value="true" />
> <property name="emailServerUri"
> value="smtp://mail.contextweb.corp?username=reportdev&to=DPeterson@apache.com" />
> <property name="emailProperties">
> <map>
> <entry key="From">
> <value>"ReportDev@apache.com"</value>
> </entry>
> <entry key="Subject">
> <value>"Exception in 3rd Party Reporting Email
> Processing"</value>
> </entry>
> </map>
> </property>
> <property name="logFactory" ref="LogFactoryBean" />
> </bean>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (CAMEL-1028) Don't require username on send mail
routes (relays don't require login)
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-1028?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen closed CAMEL-1028.
------------------------------
Fix Version/s: 1.5.0
Resolution: Fixed
David
#2 Yes it should be fixed in 1.5.
Jonathan have committed the fix:
Author: janstey
Date: Sat Oct 25 18:38:39 2008
New Revision: 707928
> 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
> Fix For: 1.5.0
>
>
> 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<K,V>).put(K, V) line: 394
> MailConfiguration.createJavaMailProperties() line: 146
> MailConfiguration.createJavaMailSender() line: 107
> MailEndpoint.createProducer() line: 53
> ProducerCache<E>.getProducer(Endpoint<E>) line: 50
> ProducerCache<E>.send(Endpoint<E>, Processor) line: 84
> DefaultProducerTemplate<E>.send(Endpoint<E>, Processor) line: 84
> DefaultProducerTemplate<E>.sendBodyAndHeaders(Endpoint, Object, Map<String,Object>) line: 143
> DefaultProducerTemplate<E>.sendBodyAndHeaders(String, Object, Map<String,Object>) 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<E>).run() line: 65
> Executors$RunnableAdapter<T>.call() line: 441
> FutureTask$Sync.innerRunAndReset() line: 317
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>(FutureTask<V>).runAndReset() line: 150
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.access$101(ScheduledThreadPoolExecutor$ScheduledFutureTask) line: 98
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.runPeriodic() line: 181
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.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
> <bean id="logThrowsAdvice" class="com.contextweb.advice.LogEmailThrowsAdvice">
> <property name="camelContext" ref="camel" />
> <property name="sendMail" value="true" />
> <!-- username=reportdev&to=DPeterson@apache.com -->
> <property name="emailServerUri"
> value="smtp://mail.apache.corp" />
> <property name="emailProperties">
> <map>
> <entry key="From">
> <value>"ReportDev@apache.com"</value>
> </entry>
> <entry key="Subject">
> <value>"Exception in 3rd Party Reporting Email
> Processing"</value>
> </entry>
> <entry key="To">
> <value>"DPeterson@apache.com"</value>
> </entry>
> </map>
> </property>
> <property name="logFactory" ref="LogFactoryBean" />
> </bean>
> 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:
> <!-- Define the ThrowsAdvice bean -->
> <bean id="logThrowsAdvice" class="com.contextweb.advice.LogEmailThrowsAdvice">
> <property name="camelContext" ref="camel" />
> <property name="sendMail" value="true" />
> <property name="emailServerUri"
> value="smtp://mail.contextweb.corp?username=reportdev&to=DPeterson@apache.com" />
> <property name="emailProperties">
> <map>
> <entry key="From">
> <value>"ReportDev@apache.com"</value>
> </entry>
> <entry key="Subject">
> <value>"Exception in 3rd Party Reporting Email
> Processing"</value>
> </entry>
> </map>
> </property>
> <property name="logFactory" ref="LogFactoryBean" />
> </bean>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (CAMEL-1028) Don't require username on send mail
routes (relays don't require login)
Posted by "David Peterson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-1028?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
David Peterson updated CAMEL-1028:
----------------------------------
This seems to be fixed in 1.5-SNAPSHOT. Feel free to close this.
> 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<K,V>).put(K, V) line: 394
> MailConfiguration.createJavaMailProperties() line: 146
> MailConfiguration.createJavaMailSender() line: 107
> MailEndpoint.createProducer() line: 53
> ProducerCache<E>.getProducer(Endpoint<E>) line: 50
> ProducerCache<E>.send(Endpoint<E>, Processor) line: 84
> DefaultProducerTemplate<E>.send(Endpoint<E>, Processor) line: 84
> DefaultProducerTemplate<E>.sendBodyAndHeaders(Endpoint, Object, Map<String,Object>) line: 143
> DefaultProducerTemplate<E>.sendBodyAndHeaders(String, Object, Map<String,Object>) 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<E>).run() line: 65
> Executors$RunnableAdapter<T>.call() line: 441
> FutureTask$Sync.innerRunAndReset() line: 317
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>(FutureTask<V>).runAndReset() line: 150
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.access$101(ScheduledThreadPoolExecutor$ScheduledFutureTask) line: 98
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.runPeriodic() line: 181
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.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
> <bean id="logThrowsAdvice" class="com.contextweb.advice.LogEmailThrowsAdvice">
> <property name="camelContext" ref="camel" />
> <property name="sendMail" value="true" />
> <!-- username=reportdev&to=DPeterson@apache.com -->
> <property name="emailServerUri"
> value="smtp://mail.apache.corp" />
> <property name="emailProperties">
> <map>
> <entry key="From">
> <value>"ReportDev@apache.com"</value>
> </entry>
> <entry key="Subject">
> <value>"Exception in 3rd Party Reporting Email
> Processing"</value>
> </entry>
> <entry key="To">
> <value>"DPeterson@apache.com"</value>
> </entry>
> </map>
> </property>
> <property name="logFactory" ref="LogFactoryBean" />
> </bean>
> 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:
> <!-- Define the ThrowsAdvice bean -->
> <bean id="logThrowsAdvice" class="com.contextweb.advice.LogEmailThrowsAdvice">
> <property name="camelContext" ref="camel" />
> <property name="sendMail" value="true" />
> <property name="emailServerUri"
> value="smtp://mail.contextweb.corp?username=reportdev&to=DPeterson@apache.com" />
> <property name="emailProperties">
> <map>
> <entry key="From">
> <value>"ReportDev@apache.com"</value>
> </entry>
> <entry key="Subject">
> <value>"Exception in 3rd Party Reporting Email
> Processing"</value>
> </entry>
> </map>
> </property>
> <property name="logFactory" ref="LogFactoryBean" />
> </bean>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-1028) Don't require username on send mail
routes (relays don't require login)
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-1028?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46851#action_46851 ]
Claus Ibsen commented on CAMEL-1028:
------------------------------------
David I think this one is fixed in Camel 1.5.
Can you try with 1.5-SNAPSHOT?
> 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<K,V>).put(K, V) line: 394
> MailConfiguration.createJavaMailProperties() line: 146
> MailConfiguration.createJavaMailSender() line: 107
> MailEndpoint.createProducer() line: 53
> ProducerCache<E>.getProducer(Endpoint<E>) line: 50
> ProducerCache<E>.send(Endpoint<E>, Processor) line: 84
> DefaultProducerTemplate<E>.send(Endpoint<E>, Processor) line: 84
> DefaultProducerTemplate<E>.sendBodyAndHeaders(Endpoint, Object, Map<String,Object>) line: 143
> DefaultProducerTemplate<E>.sendBodyAndHeaders(String, Object, Map<String,Object>) 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<E>).run() line: 65
> Executors$RunnableAdapter<T>.call() line: 441
> FutureTask$Sync.innerRunAndReset() line: 317
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>(FutureTask<V>).runAndReset() line: 150
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.access$101(ScheduledThreadPoolExecutor$ScheduledFutureTask) line: 98
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.runPeriodic() line: 181
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.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
> <bean id="logThrowsAdvice" class="com.contextweb.advice.LogEmailThrowsAdvice">
> <property name="camelContext" ref="camel" />
> <property name="sendMail" value="true" />
> <!-- username=reportdev&to=DPeterson@apache.com -->
> <property name="emailServerUri"
> value="smtp://mail.apache.corp" />
> <property name="emailProperties">
> <map>
> <entry key="From">
> <value>"ReportDev@apache.com"</value>
> </entry>
> <entry key="Subject">
> <value>"Exception in 3rd Party Reporting Email
> Processing"</value>
> </entry>
> <entry key="To">
> <value>"DPeterson@apache.com"</value>
> </entry>
> </map>
> </property>
> <property name="logFactory" ref="LogFactoryBean" />
> </bean>
> 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:
> <!-- Define the ThrowsAdvice bean -->
> <bean id="logThrowsAdvice" class="com.contextweb.advice.LogEmailThrowsAdvice">
> <property name="camelContext" ref="camel" />
> <property name="sendMail" value="true" />
> <property name="emailServerUri"
> value="smtp://mail.contextweb.corp?username=reportdev&to=DPeterson@apache.com" />
> <property name="emailProperties">
> <map>
> <entry key="From">
> <value>"ReportDev@apache.com"</value>
> </entry>
> <entry key="Subject">
> <value>"Exception in 3rd Party Reporting Email
> Processing"</value>
> </entry>
> </map>
> </property>
> <property name="logFactory" ref="LogFactoryBean" />
> </bean>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-1028) Don't require username on send mail
routes (relays don't require login)
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-1028?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46855#action_46855 ]
Claus Ibsen commented on CAMEL-1028:
------------------------------------
David
Isn't he problem with processOnlyUnseenMessages not because of POP3? If you use IMAP does it not work in 1.5?
> 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<K,V>).put(K, V) line: 394
> MailConfiguration.createJavaMailProperties() line: 146
> MailConfiguration.createJavaMailSender() line: 107
> MailEndpoint.createProducer() line: 53
> ProducerCache<E>.getProducer(Endpoint<E>) line: 50
> ProducerCache<E>.send(Endpoint<E>, Processor) line: 84
> DefaultProducerTemplate<E>.send(Endpoint<E>, Processor) line: 84
> DefaultProducerTemplate<E>.sendBodyAndHeaders(Endpoint, Object, Map<String,Object>) line: 143
> DefaultProducerTemplate<E>.sendBodyAndHeaders(String, Object, Map<String,Object>) 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<E>).run() line: 65
> Executors$RunnableAdapter<T>.call() line: 441
> FutureTask$Sync.innerRunAndReset() line: 317
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>(FutureTask<V>).runAndReset() line: 150
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.access$101(ScheduledThreadPoolExecutor$ScheduledFutureTask) line: 98
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.runPeriodic() line: 181
> ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.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
> <bean id="logThrowsAdvice" class="com.contextweb.advice.LogEmailThrowsAdvice">
> <property name="camelContext" ref="camel" />
> <property name="sendMail" value="true" />
> <!-- username=reportdev&to=DPeterson@apache.com -->
> <property name="emailServerUri"
> value="smtp://mail.apache.corp" />
> <property name="emailProperties">
> <map>
> <entry key="From">
> <value>"ReportDev@apache.com"</value>
> </entry>
> <entry key="Subject">
> <value>"Exception in 3rd Party Reporting Email
> Processing"</value>
> </entry>
> <entry key="To">
> <value>"DPeterson@apache.com"</value>
> </entry>
> </map>
> </property>
> <property name="logFactory" ref="LogFactoryBean" />
> </bean>
> 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:
> <!-- Define the ThrowsAdvice bean -->
> <bean id="logThrowsAdvice" class="com.contextweb.advice.LogEmailThrowsAdvice">
> <property name="camelContext" ref="camel" />
> <property name="sendMail" value="true" />
> <property name="emailServerUri"
> value="smtp://mail.contextweb.corp?username=reportdev&to=DPeterson@apache.com" />
> <property name="emailProperties">
> <map>
> <entry key="From">
> <value>"ReportDev@apache.com"</value>
> </entry>
> <entry key="Subject">
> <value>"Exception in 3rd Party Reporting Email
> Processing"</value>
> </entry>
> </map>
> </property>
> <property name="logFactory" ref="LogFactoryBean" />
> </bean>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.