Can't send emails using MailTransportSender

  • 1
  • Question
  • Updated 6 years ago
I am trying to forward an email and I have something configured incorrectly.

What I am wanting to do is pop a mailbox, does some work on the attachment and then forward the email with the attachment to another mailbox.

Below is my error and config.

<u:proxy id="mail-proxy">
<u:transport id="incoming-mail-listener">
<u:property name="url" value="" />
<u:property name="mail.pop3.password" value="des" />
<u:property name="startDelay" value="1000" />
<u:property name="repeatInterval" value="10000" />
<u:property name="mail.pop3.user" value="des" />
<u:scriptFile filename="conf/mediation/src/java/gov/ok/afis/storeandforward/esb/IncomingMail.groovy" language="groovy"/>
<u:property name="from" value=""/>

<bean id="mail-sender"
<property name="properties">
<entry key="" value="localhost" />
<entry key="mail.smtp.port" value="25" />

2011-03-10 14:48:48,115 [-] [null-SimpleThreadPoolWorker-1] ERROR MessageProcessor Error processing message for : of service : mail-proxy
java.lang.IllegalArgumentException: Attachment filename must not be null
at org.springframework.util.Assert.notNull(
at org.springframework.mail.javamail.MimeMessageHelper.addAttachment(
at org.adroitlogic.ultraesb.transport.mail.MailTransportSender.send(
at org.adroitlogic.ultraesb.core.endpoint.Endpoint.sendToAddress(
at org.adroitlogic.ultraesb.core.endpoint.Endpoint.submitNewMessage(
at org.adroitlogic.ultraesb.core.ProxyService.processFlow(
at org.adroitlogic.ultraesb.core.ProxyService.doRealWork(
at org.adroitlogic.ultraesb.core.ProxyService.submitNewMessage(
at org.adroitlogic.ultraesb.transport.mail.MessageProcessor.processMailMessageThroughBus(
at org.adroitlogic.ultraesb.transport.mail.MessageProcessor.process(
at org.adroitlogic.ultraesb.transport.mail.MailTransportListener.processEmailMessage(
at org.adroitlogic.ultraesb.transport.mail.MailTransportListener.processFolder(
at org.adroitlogic.ultraesb.transport.mail.MailTransportListener.onPoll(
at org.adroitlogic.ultraesb.transport.base.AbstractPollingTransportListener.execute(
at org.adroitlogic.ultraesb.transport.base.AbstractPollingTransportListener$PollingJob.execute(
at org.quartz.simpl.SimpleThreadPool$
2011-03-10 14:48:48,840 [-] [main] INFO ConfigurationImpl UltraESB/1.3.0 (GA) started with root configuration..
2011-03-10 14:48:48,893 [-] [main] INFO ServerManager System initialized in : 8s ..
Photo of Brian A

Brian A

  • 13 Posts
  • 1 Reply Like

Posted 6 years ago

  • 1
Photo of Asankha Perera

Asankha Perera, Official Rep

  • 94 Posts
  • 0 Reply Likes
The problem here is that if we receive a multipart message, we try to identify which part should be considered as the main part, and which other part/s the attachments. This maybe complicated if your payload is available as both text/plain and text/html (i.e. alternative parts), and say your payload is text/xml!

The priority we have on 1.3.0 is SOAP 1.2 (i.e. application/soap+xml), SOAP 1.1/POX/XML (i.e. text/xml), Plain text (i.e. text/plain) and HTML (i.e. text/html)

When you have both text/plain and text/html as alternatives; or if you have a SOAP 1.2/1.1, or XML attachment, the text/plain and/or text/html part is considered as an attachment - but without a name, and the main part is selected as per the priority.

The error message above resulted due to this 'unnamed' attachment, which required a multipart outgoing message again.

We will shortly issue with a solution
Photo of Asankha Perera

Asankha Perera, Official Rep

  • 94 Posts
  • 0 Reply Likes

Although a workaround (i.e. to remove attachments without names msg.getAttachments().remove(null)) could be used for this issue, we wanted to make the use of the UltraESB more satisfying. Hence a complete solution is updated to go into v1.4.0 (along with more features and enhancements), and we have also back-ported this as a patch for the stable codebase v1.3.0

Please refer to for more details and to download the patch, which you must place under lib/patches

Photo of Brian A

Brian A

  • 13 Posts
  • 1 Reply Like
Thanks...I was wondering if it was a bug. When I generated the email and attached 1 file ultraesb saw 2 attachments, one of which was null.