Class AbstractMailListener<M,A,S extends IMailFileSystem<M,A>>

java.lang.Object
org.frankframework.filesystem.AbstractFileSystemListener<M,S>
org.frankframework.filesystem.AbstractMailListener<M,A,S>
All Implemented Interfaces:
FrankElement, HasApplicationContext, HasName, HasPhysicalDestination, IConfigurable, IHasProcessState<M>, IListener<M>, IProvidesMessageBrowsers<M>, IPullingListener<M>, IScopeProvider, NameAware, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware
Direct Known Subclasses:
ImapListener

public abstract class AbstractMailListener<M,A,S extends IMailFileSystem<M,A>> extends AbstractFileSystemListener<M,S>
Implementation of a AbstractFileSystemListener that enables a Receiver to look in a folder for received mails. When a mail is found, it is moved to an output folder (or it's deleted), so that it isn't found more then once. A xml string with information about the mail is passed to the pipeline.

example:

   <email>
      <recipients>
         <recipient type="to">***@nn.nl</recipient>
         <recipient type="cc">***@nn.nl</recipient>
      </recipients>
      <from>***@nn.nl</from>
      <subject>this is the subject</subject>
      <headers>
         <header name="prop1">value of first header property</header>
         <header name="prop2">value of second header property</header>
      </headers>
      <dateTimeSent>2015-11-18T11:40:19.000+0100</dateTimeSent>
      <dateTimeReceived>2015-11-18T11:41:04.000+0100</dateTimeReceived>
   </email>
 

Author:
Peter Leeuwenburgh, Gerrit van Brakel
  • Constructor Details

    • AbstractMailListener

      public AbstractMailListener()
  • Method Details

    • extractMessage

      public Message extractMessage(@Nonnull RawMessageWrapper<M> rawMessage, @Nonnull Map<String,Object> context) throws ListenerException
      Description copied from class: AbstractFileSystemListener
      Returns the filename, or the contents
      Specified by:
      extractMessage in interface IListener<M>
      Overrides:
      extractMessage in class AbstractFileSystemListener<M,S extends IMailFileSystem<M,A>>
      Parameters:
      rawMessage - The RawMessageWrapper from which to extract the Message.
      context - Context to populate. Either a PipeLineSession or a Map threadContext depending on caller.
      Returns:
      input Message for adapter.
      Throws:
      ListenerException
    • setSimple

      @Deprecated(since="7.7", forRemoval=true) @ConfigurationWarning("Please use <code>messageType</code> to control the message produced by the listener") public void setSimple(boolean b)
      Deprecated, for removal: This API element is subject to removal in a future version.
      when set to true, the xml string passed to the pipeline only contains the subject of the mail (to save memory)
      Default value
      false
    • setStoreEmailAsStreamInSessionKey

      @Deprecated(since="7.5", forRemoval=true) @ConfigurationWarning("Please use <code>messageType=mime</code> and sessionKey originalMessage") public void setStoreEmailAsStreamInSessionKey(String string)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setMessageType

      public void setMessageType(AbstractMailListener.MessageType messageType)
      Determines the contents of the message that is sent to the Pipeline. can be one of:
      • EMAIL, for an XML containing most relevant information, except the body and the attachments
      • CONTENTS, for the body of the message
      • MIME, for the MIME contents of the message
      • NAME or PATH, for an internal handle of mail message, that can be used by a related MailFileSystemSender
      • HEADER, for the value of the header matching the searchKey in the message context
      Default value
      EMAIL