Receive E-mail (IMAP4)

Operation Name

Receive E-mail (IMAP4)

Function Overview

Receives emails from Gmail IMAP4 server.

Data Model

Data model of this type of component is table model type.

Properties

For details on using variables, refer to “Variables".
Basic Settings
Item name Required/Optional Use of variables Description Remarks
Name Required Not Available Enter the name on the script canvas.  
Required Settings
Item name Required/Optional Use of variables Description Remarks
Destination Required Not Available Select Global Resources.
For details on global resource settings, refer to "Global Resource Properties (Destination)".
  • [Add]:
    Add a new global resource.
  • [Edit list]:
    Allows you to edit the global resource settings in "Edit resource list".
 
Authentication mode Required Not Available Select the authentication mode when receiving mail.
  • [OAuth 2.0 AUTH]:(default)
    Perform OAuth 2.0 authentication.
  • [Password AUTH]:
    Perform authentication by using [User name] and [Password].
User name Required Available Enter the user name.
  • Enter the value in either of the following formats: “<G Suite user name>” or “<G Suite user name>@<G Suite domain name>”.
Password Required Available Enter the password.
  • This is enabled when [Password AUTH] is selected in [Authentication mode].
Authentication (Gmail OAuth 2.0) Required Not Available Select a global resource to use for authentication.
For details on global resource settings, refer to "Global Resource Properties (OAuth 2.0)".
  • [Add]:
    Add a new global resource.
  • [Edit list]:
    Allows you to edit the global resource settings in "Edit resource list".
  • This is enabled when [OAuth 2.0 AUTH] is selected in [Authentication mode].
Property Action
Item name Description Remarks
Authentication test
  • Perform an authentication test by using the selected [Authentication mode].
  • If the following happens, [Authentication test] is disabled.
    • [Password AUTH] is selected in [Authentication mode].
      • [User name] or [Password] are not entered.
      • A variable is specified in [User name] or [Password].
    • [OAuth 2.0 AUTH] is selected in [Authentication mode].
      • [User name] or [Authentication (Gmail OAuth 2.0)] is not entered.
      • A variable is specified in [User name].
Receive Settings
Item name Required/Optional Use of variables Description Remarks
After receiving e-mail Required Not Available Select whether to delete received messages from the server.
  • [Do not delete]: (default)
  • [Delete]:
 
Mark as read after receiving Optional Not Available Select whether to read the received message.
  • [Checked]: (default)
    Read the received message.
  • [Not Checked]:
    Do not read received messages.
    The status of read messages will remain read. The status of unread messages will remain unread
  • Read means a message is marked with the SEEN flag.
Encoding Optional Available Select or enter an encoding when receiving mail.
  • [Japanese auto detect (JISAutoDetect)]: (default)
  • [Japanese (JIS)]: (If omitted)
  • [Japanese (Shift JIS)]:
  • [Japanese (EUC)]:
  • [US-ASCII]:
  • [ISO 8859-1]:
  • [UTF-8]:
  • [EUC-KR]:
When specifying the encoding directly in the field, use the encoding supported by Java SE Runtime Environment 8.
For details, refer to "Supported Encodings"(http://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html).
  • If [Prefer encoding of the message] is [Checked], then priority is given to that encoding.
Prioritize the encoding of the message Optional Not Available Select whether to prioritize the encoding specified in the message when receiving mails.
  • [Checked]:(default)
    If encoding (charset parameter of Content-Type header) is specified in the message, use the encoding specified in the message.
    Otherwise, use [Encoding] setting.
  • [Not Checked]:
    Regardless of whether encoding is specified in the message, use the [Encoding] setting.
 
Folder name Optional Available Enter the name of the receiving folder.
  • The default value is "inbox".
  • If omitted, the mail is dreceive in "inbox".
Receive in order of newest arrival Optional Not Available Select whether to receive messages in the order of new arrival.
  • [Checked]:
    Obtain messages in the order of the newest arrival received by the mail server.
    The last message received is obtained first.
  • [Not Checked]: (default)
    Obtain messages in the order of the oldest arrival received by the mail server.
    The first message received is obtained first.
 
Set the maximum number of messages to be received Optional Not Available Select whether to specify the maximum number of messages received.
  • [Checked]:
    Receive the number of messages specified as the maximum number to receive.
  • [Not Checked]: (default)
    Receive all messages.
 
Maximum reception number Required Available Specifies the maximum number of messages received.
For example, when the server contains 100 messages, and the maximum reception number is set to 10, only the top 10 messages will be received and the remaining 90 messages will remain unread.
  • This is enabled when [Maximum reception number] is [Checked].
Skip message that cannot be received Optional Not Available Select the operation to execute when a message that cannot be received is received.
  • [Checked]:
    Messages that cannot be received will be skipped and continue to process.
  • [Not Checked]: (default)
    An error occurs when a message is received that cannot be received.
  • If checked, when an error occurs when receiving messages, the receiving messages process will be skipped and continue to process.
  • For connection errors that occur when a host that cannot be connected is specified, the error will persist even if this property is checked, because processing cannot continue.
  • Message cannot be received is output as a "WARN level log".
Get only address Optional Not Available When you acquire data that contains an email address (From, To, Cc, Reply-To), select the form from either "Description <mail address>" or "mail address". "Description <mail address>” "mail address"

      • [Checked]:
        Receive in "mail address" format.
      • [Not Checked]: (default)
        Receive in "Description <address>" format.
      • If omitted, "address" will be selected.
      Get UID Optional Not Available Select whether to get the UID.
      • [Checked]:
        Get the UID.
      • [Not Checked]: (default)
        Do not get the UID.
      • If this item is checked, the UID column is added to the output schema.
        For details, refer to the "Editing Schema".
      Attachments
      Item name Required/Optional Use of variables Description Remarks
      Receive attachment Optional Not Available Select whether to receive attachments.
      • [Checked]: (default)
        Receive files attached to message.
      • [Not checked]:
        Do not receive files attached to message.
       
      Attachment storage location Required Available Enter the directory where attachments are to be stored.

      Click the [Browse] button to activate the directory chooser and select the directory.

      The path of the stored attachment is <Stored directory>/<Message ID>/Attachment file name.
      In addition, <message ID> is the variable set by the mail server.

      If the store destination is set to /tmp and attached to the test.txt, it will be generated as follows.
      Example: /tmp/18926678.1130237227441.JavaMail.account@mail.com/test.txt
      When file with the same name exist in attachments Required Not Available Select an operation to execute when files with same name exist in attachments.
      • [Overwrite]: (default)
        Overwrite file.
      • [Append sequence number]:
        Append sequence number as "<file name>_1.csv". When the file has an extension, a sequence number is appended before the extension.
      • This is enabled when [Receive attached file] is [Checked].
      Filter
      Item name Required/Optional Use of variables Description Remarks
      Received unread messages only Optional Not Available Select whether to receive unread messages (SEEN flag messages are not marked)
      • [Checked]:
        Receive only unread messages.
      • [Not Checked]: (default)
        Receive all messages.
       
      Header
      Item name Required/Optional Use of variables Description Remarks
      Header list Optional - Specify the header retrieved.
      • Refer to schema if you set the schema information for the header.
      Header list / Header Required Available Enter key to retrieve the header.
      • Double-byte key values are not supported.
      • If the header value contains a double-byte value, the header values that must be encoded according to RFC 2047 compliant encoding.
      Data Processing Method
      Item name Required/Optional Use of variables Description Remarks
      Data processing method Required Not Available Select the data processing method.
      • [Use script settings]:(default)
        Use the settings of mass data processing of script property for the adapter.
      • [Do not perform mass data processing]:
        Mass data processing is not performed.
      • [Perform mass data processing]:
        Mass data processing is performed.
       
      Comment
      Item name Required/Optional Use of variables Description Remarks
      Comment Optional Not Available You can write a short description of this adapter.
      The description will be applied to the specifications.
       

      Schema

      Input Schema

      None

      Output Schema

      <?xml version="1.0" encoding="UTF-8" ?>
       <table>
         <row>
           <column>Message ID</column>
           <column>UID</column>
           <column>Sent Date</column>
           <column>Header 1</column>
           <column>Header 2</column>
             : <column>From</column>
           <column>To</column>
           <column>CC</column>
           <column>BCC</column>
           <column>Reply To</column>
           <column>Subject</column>
           <column>Content-Type</column>
           <column>Message</column>
           <column>Attachments</column>
         </row>
         <row>
           : </row>
       </table>
      
      Column name Description Remarks
      Message ID    
      UID  
      • Retrieved when [Retrieves UID] is checked.
      Sent Date    
      Header The element occurs for each key specified in the [Header List].
      • If a single key holds multiple values, they are represented as a comma-delimited string.
      • No element occurs if nothing is specified in the [Header List].
      From  
      • If there are multiple values specified, they are represented as a comma-delimited string.
      To  
      • If there are multiple values specified, they are represented as a comma-delimited string.
      CC  
      • If there are multiple values specified, they are represented as a comma-delimited string.
      BCC  
      • If there are multiple values specified, they are represented as a comma-delimited string.
      Reply To  
      • If there are multiple values specified, they are represented as a comma-delimited string.
      Subject    
      Content-Type    
      Message    
      Attachments  
      • If there are multiple values specified, they are represented as a comma-delimited string.

      Loading Schema on Mapper

      Schema is loaded automatically.
      For details, refer to "Edit schema".

      Mass Data Processing

      Mass data processing is supported.

      PSP usage

      PSP cannot be used.

      Available Component Variables

      Component variable name Description Remarks
      count Returns the number of emails received.
      • The value defaults to null.
      message_category When an error occurs, the category of the message code corresponding to the error that occurred is stored.
      • Default value is null.
      message_code When an error occurs, the code of the message code corresponding to the error that occurred is stored.
      • The default value is null.
      message_level When an error occurs, the severity of the message code corresponding to the error that occurred is stored.
      • The default value is null.
      error_type When an error occurs, the type of error that occurred is stored.
      • The default value is null.
      • The error type is in the following format.
        Ex: “java.io.FileNotFoundException”
      • The contents to be stored may vary depending on the version of DataSpider Servista.
      error_message When an error occurs, the error message of the error that occurred is stored.
      • The default value is null.
      • The contents to be stored may vary depending on the version of DataSpider Servista.
      error_trace When an error occurs, the trace information of the error that occurred is stored.
      • The default value is null.
      • The contents to be stored may vary depending on the version and client applications of DataSpider Servista.

      Specification Limits

      Major Exceptions

      Exception Name Cause Solution
      ResourceNotFoundException
      Resource definition is not found. Name:[]
      [Destination] or [Authentication (Gmail OAuth 2.0)] is not specified. Specify [Destination] or [Authentication (Gmail OAuth 2.0)].
      ResourceNotFoundException
      Resource definition is not found. Name : [<Global Resource name>]
      The resource definition selected in [Destination] or [Authentication (Gmail OAuth 2.0)] is not found. Check the global resource specified in [Destination] or [Authentication (Gmail OAuth 2.0)].
      InvalidPropertyConfigurationException
      <Property name> is not specified.
      [Property name>] is not specified Specify [<Property name>].
      java.io.UnsupportedEncodingException Encoding set to [Encoding] is not supported. Check the specified encoding in [Encoding].
      javax.mail.AuthenticationFailedException:
      [ALERT] Your account is not enabled for IMAP use. Please visit your Gmail settings page and enable your account for IMAP access. (Failure)
      IMAP is not enabled in the Gmail settings of the target user. To use IMAP, you will need to enable IMAP in the Gmail settings of the target user.
      javax.mail.AuthenticationFailedException:
      Invalid credentials <String>
      [User name] or [Password] is incorrect. Check [User name] or [Password].
      javax.mail.AuthenticationFailedException:
      [AUTHENTICATIONFAILED] Invalid credentials (Failure)
      [User name] or [Password] is incorrect. Check [User name] or [Password].
      com.sun.mail.util.MailConnectException: Failed to establish a connection to the Gmail IMAP4 server. Check the network reachability.
      OAuth2AuthenticationFailedException
      OAuth 2.0 authorization has failed.
      [User name] or [Authentication (Gmail OAuth 2.0)] is invalid. Check [User name] or [Authentication (Gmail OAuth 2.0)].

      Notes