public abstract class MailListener<M,A,S extends IMailFileSystem<M,A>> extends FileSystemListener<M,S>
FileSystemListener
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>
Modifier and Type | Field and Description |
---|---|
String |
EMAIL_MESSAGE_TYPE |
String |
MIME_MESSAGE_TYPE |
FILENAME_KEY, FILEPATH_KEY, log, ORIGINAL_FILENAME_KEY
Constructor and Description |
---|
MailListener() |
Modifier and Type | Method and Description |
---|---|
Message |
extractMessage(RawMessageWrapper<M> rawMessage,
Map<String,Object> context)
Returns the filename, or the contents
|
void |
setMessageType(String messageType)
Determines the contents of the message that is sent to the Pipeline.
|
void |
setSimple(boolean b)
Deprecated.
|
void |
setStoreEmailAsStreamInSessionKey(String string)
Deprecated.
|
afterMessageProcessed, changeProcessState, checkForExistenceOfFolder, close, closeThread, configure, createFileSystem, extractMessageProperties, getDomain, getMessageBrowser, getPhysicalDestinationName, getRawMessage, getStateFolder, knownProcessStates, open, openThread, setCharset, setCreateFolders, setCreateInputDirectory, setDelete, setDisableMessageBrowsers, setErrorFolder, setExcludeWildcard, setExcludeWildCard, setFileTimeSensitive, setHoldFolder, setInProcessFolder, setInputDirectory, setInputFolder, setLogFolder, setMessageIdPropertyKey, setMinStableTime, setName, setNumberOfBackups, setOutputDirectory, setOutputFormat, setOverwrite, setProcessedDirectory, setProcessedFolder, setStoreMetadataInSessionKey, setWildcard, setWildCard, targetProcessStates
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName
getApplicationContext, getName
getConfigurationClassLoader
public final String EMAIL_MESSAGE_TYPE
public final String MIME_MESSAGE_TYPE
public Message extractMessage(@Nonnull RawMessageWrapper<M> rawMessage, @Nonnull Map<String,Object> context) throws ListenerException
FileSystemListener
extractMessage
in interface IListener<M>
extractMessage
in class FileSystemListener<M,S extends IMailFileSystem<M,A>>
rawMessage
- The RawMessageWrapper
from which to extract the Message
.context
- Context to populate. Either a PipeLineSession
or a Map
threadContext depending on caller.Message
for adapter.ListenerException
@Deprecated @ConfigurationWarning(value="Please use <code>messageType</code> to control the message produced by the listener") public void setSimple(boolean b)
true
, the xml string passed to the pipeline only contains the subject of the mail (to save memory)@Deprecated @ConfigurationWarning(value="Please use <code>messageType=mime</code> and sessionKey originalMessage") public void setStoreEmailAsStreamInSessionKey(String string)
public void setMessageType(String messageType)
email
, for an XML containing most relevant information, except the body and the attachmentscontents
, for the body of the messagemime
, for the MIME contents of the messagename
or path
, for an internal handle of mail message, that can be used by a related MailFileSystemSendersetMessageType
in class FileSystemListener<M,S extends IMailFileSystem<M,A>>
Copyright © 2023 Frank!Framework. All rights reserved.