ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Problems sending multipart MIME with v6.1 e-mail output node

Post new topic  Reply to topic
 Problems sending multipart MIME with v6.1 e-mail output node « View previous topic :: View next topic » 
Author Message
woofbert
PostPosted: Mon Jun 30, 2008 2:38 am    Post subject: Problems sending multipart MIME with v6.1 e-mail output node Reply with quote

Novice

Joined: 18 Oct 2007
Posts: 10

Hi there,

I tried several ways to send an e-mail using the V6.1 e-mail output node..
1. Plain Text within a BLOB element
2. Mail with attachment using LocalEnvironment variables
3. Mail with attachments defined by MIME element

While Version 1. and 2. are working great for me, I get strange results when trying the MIME version. The node will throw an javax.mail.AuthenticationFailedException and I really have no guess why.
Needless to say, that I have used exactly the same smtp server and security identity setup on all three versions.
I used a MQ Input node with MIME domain parser to be shure that the MIME format is correct. The message I've used is shown some lines down.

Is there anyone who managed sending multipart MIME messages using V6.1 e-mail output node at all?

I did not find a multipart MIME e-mail sample, and no multipart MIME related topics on V6.1 e-mail output node in this forum.

I attached some additional data which could help you to give me an clue...
Any ideas welcome!

--- woofbert
----------------------------------------------

To get the right MIME format I made a simple flow MQ_In -> ESQL_Compute -> E-mail Output and put following message to the queue:
Code:
MIME-version: 1.0
Content-type: multipart/mixed; boundary="frontier"

This is a message with multiple parts in MIME format.
--frontier
Content-type: text/plain

This is the body of the message.
--frontier
Content-type: application/octet-stream
Content-transfer-encoding: base64

PGh0bWw+CiAgPGhlYWQ+CiAgPC9oZWFkPgogIDxib2R5PgogICAgPHA+VGhpcyBpcyB0aGUg
Ym9keSBvZiB0aGUgbWVzc2FnZS48L3A+CiAgPC9ib2R5Pgo8L2h0bWw+Cg==
--frontier--


The input message is parsed without errors, but a trace node will not trace the message to a file, it alway stops tracing at the same point. The tracefile looks like:
Code:

( ['MQROOT' : 0x5a38c78]
  (0x01000000):EmailOutputHeader = (
    (0x03000000):To       = 'mail@local.de' (CHARACTER)
    (0x03000000):From     = 'broker@local.de' (CHARACTER)
    (0x03000000):Reply-To = 'broker@local.de' (CHARACTER)
    (0x03000000):Subject  = 'Das ist das Subject' (CHARACTER)
  )
  (0x01000000):Properties        = ( ['MQPROPERTYPARSER' : 0x40d78e8]
    (0x03000000):MessageSet             =



This is how the MIME looks in the flow debugger:
Code:
MIME
   MIME-version:CHARACTER:1.0
   Content-type:CHARACTER:multipart/mixed; boundary="frontier"
   Parts
         CHARACTER:This is a message with multiple parts in MIME format.
         Part
               Content-type:CHARACTER:text/plain
               Data
                     BLOB
                           BLOB:BLOB:[B@59ec59ec
         Part
               Content-type:CHARACTER:application/octet-stream
               Content-transfer-encoding:CHARACTER:base64
               Data
                     BLOB
                           BLOB:BLOB:[B@5d9a5d9a


The email node will always throw following exception:
Code:

  (0x01000000):RecoverableException = (
    (0x03000000):File                 = 'F:\build\S610_P\src\DataFlowEngine\ImbDataFlowNode.cpp' (CHARACTER)
    (0x03000000):Line                 = 739 (INTEGER)
    (0x03000000):Function             = 'ImbDataFlowNode::createExceptionList' (CHARACTER)
    (0x03000000):Type                 = 'ComIbmEmailOutputNode' (CHARACTER)
    (0x03000000):Name                 = 'MyFlow#FCMComposite_1_4' (CHARACTER)
    (0x03000000):Label                = 'MyFlow.EmailOutput' (CHARACTER)
    (0x03000000):Catalog              = 'BIPv610' (CHARACTER)
    (0x03000000):Severity             = 3 (INTEGER)
    (0x03000000):Number               = 2230 (INTEGER)
    (0x03000000):Text                 = 'Node throwing exception' (CHARACTER)
    (0x01000000):RecoverableException = (
      (0x03000000):File                 = 'MbErrorHandler.java' (CHARACTER)
      (0x03000000):Line                 = 122 (INTEGER)
      (0x03000000):Function             = 'sendMimeEmail()' (CHARACTER)
      (0x03000000):Type                 = '' (CHARACTER)
      (0x03000000):Name                 = '' (CHARACTER)
      (0x03000000):Label                = '' (CHARACTER)
      (0x03000000):Catalog              = 'BIPv610' (CHARACTER)
      (0x03000000):Severity             = 3 (INTEGER)
      (0x03000000):Number               = 4459 (INTEGER)
      (0x03000000):Text                 = 'Exception whilst creating MIME message or getting the Message ID' (CHARACTER)
      (0x01000000):Insert               = (
        (0x03000000):Type = 5 (INTEGER)
        (0x03000000):Text = 'com.ibm.broker.emailnodes.EmailOutputNode : javax.mail.AuthenticationFailedException
   at javax.mail.Service.connect(Service.java:306)
   at javax.mail.Service.connect(Service.java:156)
   at javax.mail.Service.connect(Service.java:105)
   at javax.mail.Transport.send0(Transport.java:168)
   at javax.mail.Transport.send(Transport.java:98)
   at com.ibm.broker.emailnodes.EmailOutputNode.sendMimeEmail(EmailOutputNode.java:655)
   at com.ibm.broker.emailnodes.EmailOutputNode.sendData(EmailOutputNode.java:353)
   at com.ibm.broker.plugin.MbOutputTemplateNode.sendData(MbOutputTemplateNode.java:47)

Back to top
View user's profile Send private message
_dave_
PostPosted: Mon Jun 30, 2008 4:40 am    Post subject: Reply with quote

Apprentice

Joined: 08 Apr 2005
Posts: 33
Location: IBM Hursley

Hello,

The problem would appear to be more with authenticating with the SMTP server than the content of the message (MIME multipart). Certainly I have MIME working through the emailoutput node.

Do you know what (if any) authentication the SMTP server you are trying to connect to has? Is it SMTP AUTH or is it secured SMTP using STARTTLS?

The emailoutput node supports SMTP AUTH but not STARTTLS.

You can find out what your email server supports by logging on to it.

Try telnet you.smtp.server 25

And see if you can type EHLO me.test

Do you see any additional broker messages in the event log?
Back to top
View user's profile Send private message
woofbert
PostPosted: Mon Jun 30, 2008 5:44 am    Post subject: Reply with quote

Novice

Joined: 18 Oct 2007
Posts: 10

Hi _dave_,

I'm using free hMailServer on local for testing and it works great if not using MIME but BLOB or just fill in the fields in for the e-mail (so security model should be fine).
Unfortunately MIME seems the only way to attach more than one attachment, which is needed.

The e-mail plugin isn't quite talkative, so I get no additional information, even with mqsichangetrace to debug.

What makes me mad is that the node works with a simple mail, even with the supplied sample. There must be something about the MIME stuff, I don't know.
Perhaps the node handles MIME mails different from the Environment attribute driven ones, so that a different security model is needed?
Maybe I'm doing something wrong, so if you have a working example with MIME and multiple attachments I could check out what makes the difference...

And yes, I can log on using telnet with following result:
Code:

220 MB6PLUGIN ESMTP
EHLO broker
250-hmailserver
250-SIZE
250 AUTH LOGIN
Back to top
View user's profile Send private message
_dave_
PostPosted: Mon Jun 30, 2008 7:30 am    Post subject: Reply with quote

Apprentice

Joined: 08 Apr 2005
Posts: 33
Location: IBM Hursley

Hi,

You can generate a MIME message, with multiple attachments, by specifying the attachments in the LocalEnvironment. The EmailOutput node will create the MIME message for you. You don't need to pass in a MIME domain message.

Example ESQL which sets up a MIME domain is:

CREATE COMPUTE MODULE ESQLEmail_Create_MIME_Email
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CREATE FIELD OutputRoot.MIME TYPE Name;
DECLARE M REFERENCE TO OutputRoot.MIME;

-- create the Content-Type child of MIME explicitly to ensure the correct order. If we set
-- the ContentType property instead, the field could appear as the last child of MIME.
--CREATE FIELD M."Content-Type" TYPE NameValue VALUE 'multipart/related; boundary=myBoundary';
CREATE FIELD M."Content-Type" TYPE NameValue VALUE 'multipart/mixed; boundary="xxx"; charset="us-ascii"';
CREATE FIELD M."Content-ID" TYPE NameValue VALUE 'new MIME document';
CREATE LASTCHILD OF M TYPE Name NAME 'Parts';

-- some example data – generally this would be available already, perhaps as the result of
-- parsing another subtree.
DECLARE newBlob BLOB '4f6e652074776f2074687265650d0a';

CREATE LASTCHILD OF M.Parts TYPE Name NAME 'Part';
DECLARE P1 REFERENCE TO M.Parts.Part;

CREATE FIELD P1."Content-Type" TYPE NameValue VALUE 'text/plain';
CREATE FIELD P1."Content-Id" TYPE NameValue VALUE 'part one';
CREATE LASTCHILD OF P1 TYPE Name NAME 'Data';
CREATE LASTCHILD OF P1.Data DOMAIN('BLOB') PARSE(newBlob);

CREATE LASTCHILD OF M.Parts TYPE Name NAME 'Part';
DECLARE P2 REFERENCE TO M.Parts.Part[2];

CREATE FIELD P2."Content-Type" TYPE NameValue VALUE 'text/plain';
CREATE FIELD P2."Content-Id" TYPE NameValue VALUE 'part two';
CREATE LASTCHILD OF P2 TYPE Name NAME 'Data';
CREATE LASTCHILD OF P2.Data DOMAIN('BLOB') PARSE(newBlob);

RETURN TRUE;
END;

END MODULE;



Security is the same for MIME domain and non MIME domain.
Back to top
View user's profile Send private message
woofbert
PostPosted: Tue Jul 01, 2008 12:27 am    Post subject: Reply with quote

Novice

Joined: 18 Oct 2007
Posts: 10

Hi _dave_,

I've taken your sample code and get the same error as before.

If I look at the service trace, it seems that there is a problem when the sendMimeEmail() method is called.

But once again: The e-mail output node works fine if using BLOB as payload with the same settings.
Here are the data, I provide in either case:
a) In the Node Tab during development:
    SMTP server and port : localhost
    Security Identity : mailsender
b) During runtime in the message
    SET OutputRoot.EmailOutputHeader.To = 'mail@local.de';
    SET OutputRoot.EmailOutputHeader.From = 'broker@local.de';
    SET OutputRoot.EmailOutputHeader."Reply-To" = 'admin@local.de';
    SET OutputRoot.EmailOutputHeader.Subject = 'Mail with attachment';

--- woofbert
-------------------------------

Service trace snippet (with a few lines before getting the exception to provide some context):
Code:

2008-06-30 22:47:53.161754     6080         } ImbMIMEParser::refreshBitStreamFromElements MyMailTest#FCMComposite_1_2 ComIbmMQInputNode , MyMailTest.BAD
2008-06-30 22:47:53.161766     6080       } ImbParser::refreshBitStreamFromElements MyMailTest#FCMComposite_1_2 ComIbmMQInputNode , MyMailTest.BAD
2008-06-30 22:47:53.161781     6080       { ImbBuffer::~ImbBuffer   ,
2008-06-30 22:47:53.161796     6080         { ImbBuffer::deallocateBuffer   ,
2008-06-30 22:47:53.161808     6080         } ImbBuffer::deallocateBuffer   ,
2008-06-30 22:47:53.161819     6080       } ImbBuffer::~ImbBuffer   ,
2008-06-30 22:47:53.161869     6080     } Java_com_ibm_broker_plugin_MbElement__1toBitstream
2008-06-30 22:47:53.161895     6080   } com.ibm.broker.plugin.MbElement@1400140.toBitStream DynamicSubscriptionEngine DynamicSubscriptionEngine , DynamicSubscriptionEngine
2008-06-30 22:47:53.161972     6080   { com.ibm.broker.emailnodes.EmailOutputNode@1b741b74.addHeaderInformationToEmail() DynamicSubscriptionEngine DynamicSubscriptionEngine , DynamicSubscriptionEngine
2008-06-30 22:47:53.161994     6080     { com.ibm.broker.emailnodes.EmailOutputNode@1b741b74.addFromAddresses() DynamicSubscriptionEngine DynamicSubscriptionEngine , DynamicSubscriptionEngine
2008-06-30 22:47:53.162136     6080     } com.ibm.broker.emailnodes.EmailOutputNode@1b741b74.addFromAddresses() DynamicSubscriptionEngine DynamicSubscriptionEngine , DynamicSubscriptionEngine
2008-06-30 22:47:53.162155     6080     { com.ibm.broker.emailnodes.EmailOutputNode@1b741b74.addRecipientAddresses() DynamicSubscriptionEngine DynamicSubscriptionEngine , DynamicSubscriptionEngine
2008-06-30 22:47:53.162261     6080     } com.ibm.broker.emailnodes.EmailOutputNode@1b741b74.addRecipientAddresses() DynamicSubscriptionEngine DynamicSubscriptionEngine , DynamicSubscriptionEngine
2008-06-30 22:47:53.162284     6080     { com.ibm.broker.emailnodes.EmailOutputNode@1b741b74.addReplyToAddresses() DynamicSubscriptionEngine DynamicSubscriptionEngine , DynamicSubscriptionEngine
2008-06-30 22:47:53.162414     6080     } com.ibm.broker.emailnodes.EmailOutputNode@1b741b74.addReplyToAddresses() DynamicSubscriptionEngine DynamicSubscriptionEngine , DynamicSubscriptionEngine
2008-06-30 22:47:53.162460     6080   } com.ibm.broker.emailnodes.EmailOutputNode@1b741b74.addHeaderInformationToEmail() DynamicSubscriptionEngine DynamicSubscriptionEngine , DynamicSubscriptionEngine
2008-06-30 22:47:53.165607     6080   com.ibm.broker.emailnodes.EmailOutputNode@1b741b74.sendMimeEmail() DynamicSubscriptionEngine DynamicSubscriptionEngine 'No stacktrace available' , '4459, Exception whilst creating MIME message or getting the Message ID, javax.mail.AuthenticationFailedException
   at javax.mail.Service.connect(Service.java:306)
   at javax.mail.Service.connect(Service.java:156)
   at javax.mail.Service.connect(Service.java:105)
   at javax.mail.Transport.send0(Transport.java:168)
   at javax.mail.Transport.send(Transport.java:98)
   at com.ibm.broker.emailnodes.EmailOutputNode.sendMimeEmail(EmailOutputNode.java:655)
   at com.ibm.broker.emailnodes.EmailOutputNode.sendData(EmailOutputNode.java:353)
   at com.ibm.broker.plugin.MbOutputTemplateNode.sendData(MbOutputTemplateNode.java:47)
, javax.mail.AuthenticationFailedException', DynamicSubscriptionEngine
Back to top
View user's profile Send private message
MrSmith
PostPosted: Tue Jul 01, 2008 2:13 am    Post subject: Reply with quote

Master

Joined: 20 Mar 2008
Posts: 215

woofbert

Just as a suggestion have you tried to use a different smtp server, one that you know is completely stable, there are plenty on sourceforge, as how can you be sure the error is in the node not at the server level? The last output you registerewd would to me also indicate that the server is the one not dealing with the issue as the sendMIMEMail method is being caled but there is nothing in your log i could see that would indicate that the connection was sucessful and that the server was happy.
Back to top
View user's profile Send private message
woofbert
PostPosted: Tue Jul 01, 2008 3:10 am    Post subject: Reply with quote

Novice

Joined: 18 Oct 2007
Posts: 10

MrSmith,

thank you for your suggestion.
I tries the same thin with Lotus Domino, which will be the smtp platform in production and guess what? It works.

So the problem seems to be somewhere in the MIME handling of hMailServer which is odd anyway, because sending an attachment using the LocalEnvironment attributes works - And according to the docs this is sent as MIME as well.

But nevertheless - Thank you for your help.

I will go and look for another local server for testing.

--- woofbert
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue Jul 01, 2008 3:42 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

I run the free version ( limited number of users) of Axigen for this type of testing.
I run it in a VM using Fedora 8 as the O/S. Very simple to setup ( no editing of files) as all the configuration is done via 1) a GUI (initial) then 2) WEB Pages ( admin)
The sever has Web Access for the email client and Lookout (sorry MS Outlook) POP connection is a doddle.

Give it a try.

Steve D
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
woofbert
PostPosted: Tue Jul 01, 2008 4:34 am    Post subject: Reply with quote

Novice

Joined: 18 Oct 2007
Posts: 10

Sorry folks,

I blamed the mailserver a bit to fast...(In the happiness that it worked with the other one). Then I saw that the two machines I'm testing with are at different broker codelevel.

When on broker level 6.1.0.0 I can send MIME e-mails with both servers. After upgrading to 6.1.0.2, I'll get the error with both SMTP servers (Lotus Domino and hMailServer)

It seems that the behavior of E-mail Output Node has changed between 6.1.0.0 and 6.1.0.2 ?

--- woofbert
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Problems sending multipart MIME with v6.1 e-mail output node
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.