Help get this topic noticed by sharing it on Twitter, Facebook, or email.

Can't send emails using MailTransportSender

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="des@host.com" />
<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:transport>
<u:target>
<u:inSequence>
<u:scriptFile filename="conf/mediation/src/java/gov/ok/afis/storeandforward/esb/IncomingMail.groovy" language="groovy"/>
</u:inSequence>
<u:inDestination>
<u:address>mailto:afiswork@host.com</u:address>
<u:property name="from" value="nistarchive@host.com"/>
</u:inDestination>
</u:target>
</u:proxy>
-->



<!--
<bean id="mail-sender"
class="org.adroitlogic.ultraesb.transport.mail.MailTransportSender">
<property name="properties">
<map>
<entry key="mail.smtp.host" value="localhost" />
<entry key="mail.smtp.port" value="25" />
</map>
</property>
</bean>
-->


2011-03-10 14:48:48,115 [-] [null-SimpleThreadPoolWorker-1] ERROR MessageProcessor Error processing message for : des@host.com of service : mail-proxy
java.lang.IllegalArgumentException: Attachment filename must not be null
at org.springframework.util.Assert.notNull(Assert.java:112)
at org.springframework.mail.javamail.MimeMessageHelper.addAttachment(MimeMessageHelper.java:976)
at org.adroitlogic.ultraesb.transport.mail.MailTransportSender.send(MailTransportSender.java:137)
at org.adroitlogic.ultraesb.core.endpoint.Endpoint.sendToAddress(Endpoint.java:520)
at org.adroitlogic.ultraesb.core.endpoint.Endpoint.submitNewMessage(Endpoint.java:402)
at org.adroitlogic.ultraesb.core.ProxyService.processFlow(ProxyService.java:221)
at org.adroitlogic.ultraesb.core.ProxyService.doRealWork(ProxyService.java:171)
at org.adroitlogic.ultraesb.core.work.SimpleQueueWorkManager.doRealWork(SimpleQueueWorkManager.java:284)
at org.adroitlogic.ultraesb.core.work.SimpleQueueWorkManager.submitNewMessage(SimpleQueueWorkManager.java:216)
at org.adroitlogic.ultraesb.core.ProxyService.submitNewMessage(ProxyService.java:129)
at org.adroitlogic.ultraesb.transport.mail.MessageProcessor.processMailMessageThroughBus(MessageProcessor.java:165)
at org.adroitlogic.ultraesb.transport.mail.MessageProcessor.process(MessageProcessor.java:89)
at org.adroitlogic.ultraesb.transport.mail.MailTransportListener.processEmailMessage(MailTransportListener.java:340)
at org.adroitlogic.ultraesb.transport.mail.MailTransportListener.processFolder(MailTransportListener.java:296)
at org.adroitlogic.ultraesb.transport.mail.MailTransportListener.onPoll(MailTransportListener.java:207)
at org.adroitlogic.ultraesb.transport.base.AbstractPollingTransportListener.execute(AbstractPollingTransportListener.java:175)
at org.adroitlogic.ultraesb.transport.base.AbstractPollingTransportListener$PollingJob.execute(AbstractPollingTransportListener.java:148)
at org.quartz.core.JobRunShell.run(JobRunShell.java:199)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:546)
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 ..
1 person has
this question
+1
Reply
  • 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
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited

  • Brian

    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 https://bitbucket.org/adroitlogic/ult... for more details and to download the patch, which you must place under lib/patches

    thanks
    asankha
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited

  • 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.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited