Mail Attach Service (com.ibi.agents.XDMailAttachAgent)

Syntax:

com.ibi.agents.XDMailAttachAgent

iIT Service Object:

misc: Mail Attach Agent

Description:

This service is used to process an email attachment.

Parameters:

Parameter

Description

Attachment Tag *

Tag used to identify an attachment (attachment is the default).

Encode

If set to true, everything is base64 encoded. If false, only non-txt is encoded.

Target

Target of attachments.

Output Directory

The target output directory.

Output File Name

The output file name, which can contain an asterisk character (*) and is expanded to a timestamp, if an empty attachment name is used.

Note: If you want to preserve the original name of the attachment, do not specify a value for this parameter.

Delete Mail Object

If no other component needs the mail object, it should be deleted.

Edges:

The following table lists the available line edges for the Mail Attach Service (com.ibi.agents.XDMailAttachAgent).

Line Edge

Description

OnError

Error

OnSuccess

Success

OnFailure

Failure

OnCustom

  • OnError
  • OnSuccess
  • OnFailure
  • fail_parse
  • fail_operation

Example:

In a sample scenario, a channel can be configured that uses an Email listener as an inlet, and a Mail Attach service as a route. The Mail Attach service processes the attachment from the incoming email and places the resulting document within the attachment tag. The following is an example of configuration settings for a Mail Attach service object in iIT Designer:

When an email containing simple HTML <Test><hello>hi</hello></Test> with an attachment file (test.xml) is sent to the address specified for the email listener, the channel runs and the Mail Attach service processes the email producing the following output document:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<Test><hello>hi</hello><attachment mime="text/xml" file="c:\out\mailattch2009-05-13T20_05_57.986Z" name="test.xml"/></Test>

Notice that the attachment element was added to the original email, along with the location of the emitted attachment file, which you can locate as specified.