diff --git a/README.md b/README.md index 6b9683d..a6ef82c 100644 --- a/README.md +++ b/README.md @@ -19,12 +19,12 @@ For information on Siddhi and i ## Latest API Docs -Latest API Docs is 2.0.2. +Latest API Docs is 2.0.3. ## Features -* email *(Sink)*

The email sink uses the 'smtp' server to publish events via emails. The events can be published in 'text', 'xml' or 'json' formats. The user can define email sink parameters in either the '<SP_HOME>/conf/<PROFILE>/deployment yaml' file or in the stream definition. The email sink first checks the stream definition for parameters, and if they are no configured there, it checks the 'deployment.yaml' file. If the parameters are not configured in either place, default values are considered for optional parameters. If you need to configure server system parameters that are not provided as options in the stream definition, then those parameters need to be defined them in the 'deployment.yaml' file under 'email sink properties'.

For more information about the SMTP server parameters, see https://javaee.github.io/javamail/SMTP-Transport.

Further, some email accounts are required to enable the 'access to less secure apps' option. For gmail accounts, you can enable this option via https://myaccount.google.com/lesssecureapps.

-* email *(Source)*

The 'Email' source allows you to receive events via emails. An 'Email' source can be configured using the 'imap' or 'pop3' server to receive events. This allows you to filter the messages that satisfy the criteria specified under the 'search term' option. The email source parameters can be defined in either the '<SP_HOME>/conf/<PROFILE>/deployment yaml' file or the stream definition. If the parameter configurations are not available in either place, the default values are considered (i.e., if default values are available). If you need to configure server system parameters that are not provided as options in the stream definition, they need to be defined in the 'deployment yaml' file under 'email source properties'. For more information about 'imap' and 'pop3' server system parameters, see the following.
[JavaMail Reference Implementation - IMAP Store](https://javaee.github.io/javamail/IMAP-Store)
[JavaMail Reference Implementation - POP3 Store Store](https://javaee.github.io/javamail/POP3-Store)

+* email *(Sink)*

The email sink uses the 'smtp' server to publish events via emails. The events can be published in 'text', 'xml' or 'json' formats. The user can define email sink parameters in either the '<SP_HOME>/conf/<PROFILE>/deployment yaml' file or in the stream definition. The email sink first checks the stream definition for parameters, and if they are no configured there, it checks the 'deployment.yaml' file. If the parameters are not configured in either place, default values are considered for optional parameters. If you need to configure server system parameters that are not provided as options in the stream definition, then those parameters need to be defined them in the 'deployment.yaml' file under 'email sink properties'.

For more information about the SMTP server parameters, see https://javaee.github.io/javamail/SMTP-Transport.

Further, some email accounts are required to enable the 'access to less secure apps' option. For gmail accounts, you can enable this option via https://myaccount.google.com/lesssecureapps.

+* email *(Source)*

The 'Email' source allows you to receive events via emails. An 'Email' source can be configured using the 'imap' or 'pop3' server to receive events. This allows you to filter the messages that satisfy the criteria specified under the 'search term' option. The email source parameters can be defined in either the '<SP_HOME>/conf/<PROFILE>/deployment yaml' file or the stream definition. If the parameter configurations are not available in either place, the default values are considered (i.e., if default values are available). If you need to configure server system parameters that are not provided as options in the stream definition, they need to be defined in the 'deployment yaml' file under 'email source properties'. For more information about 'imap' and 'pop3' server system parameters, see the following.
[JavaMail Reference Implementation - IMAP Store](https://javaee.github.io/javamail/IMAP-Store)
[JavaMail Reference Implementation - POP3 Store Store](https://javaee.github.io/javamail/POP3-Store)

## Dependencies diff --git a/docs/api/2.0.3.md b/docs/api/2.0.3.md new file mode 100644 index 0000000..8a53e6f --- /dev/null +++ b/docs/api/2.0.3.md @@ -0,0 +1,912 @@ +# API Docs - v2.0.3 + +## Sink + +### email *(Sink)* + +

The email sink uses the 'smtp' server to publish events via emails. The events can be published in 'text', 'xml' or 'json' formats. The user can define email sink parameters in either the '<SP_HOME>/conf/<PROFILE>/deployment yaml' file or in the stream definition. The email sink first checks the stream definition for parameters, and if they are no configured there, it checks the 'deployment.yaml' file. If the parameters are not configured in either place, default values are considered for optional parameters. If you need to configure server system parameters that are not provided as options in the stream definition, then those parameters need to be defined them in the 'deployment.yaml' file under 'email sink properties'.

For more information about the SMTP server parameters, see https://javaee.github.io/javamail/SMTP-Transport.

Further, some email accounts are required to enable the 'access to less secure apps' option. For gmail accounts, you can enable this option via https://myaccount.google.com/lesssecureapps.

+ +Syntax +``` +@sink(type="email", username="", address="", password="", host="", port="", ssl.enable="", auth="", content.type="", subject="", to="", cc="", bcc="", attachments="", @map(...))) +``` + +QUERY PARAMETERS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
usernameThe username of the email account that is used to send emails.
e.g., 'abc' is the username of the 'abc@gmail.com' account.
STRINGNoNo
addressThe address of the email account that is used to send emails.STRINGNoNo
passwordThe password of the email account.STRINGNoNo
hostThe host name of the SMTP server. e.g., 'smtp.gmail.com' is a host name for a gmail account. The default value 'smtp.gmail.com' is only valid if the email account is a gmail account.smtp.gmail.comSTRINGYesNo
portThe port that is used to create the connection.'465' the default value is only valid is SSL is enabled.INTYesNo
ssl.enableThis parameter specifies whether the connection should be established via a secure connection or not. The value can be either 'true' or 'false'. If it is 'true', then the connection is establish via the 493 port which is a secure connection.trueBOOLYesNo
authThis parameter specifies whether to use the 'AUTH' command when authenticating or not. If the parameter is set to 'true', an attempt is made to authenticate the user using the 'AUTH' command.trueBOOLYesNo
content.typeThe content type can be either 'text/plain' or 'text/html'.text/plainSTRINGYesNo
subjectThe subject of the mail to be send.STRINGNoYes
toThe address of the 'to' recipient. If there are more than one 'to' recipients, then all the required addresses can be given as a comma-separated list.STRINGNoYes
ccThe address of the 'cc' recipient. If there are more than one 'cc' recipients, then all the required addresses can be given as a comma-separated list.NoneSTRINGYesNo
bccThe address of the 'bcc' recipient. If there are more than one 'bcc' recipients, then all the required addresses can be given as a comma-separated list.NoneSTRINGYesNo
attachmentsFile paths of the files that need to be attached to the email.
These paths should be absolute paths.
They can be either directories or files
. If the path is to a directory, all the files located at the first level (i.e., not within another sub directory) are attached.
NoneSTRINGYesYes
+ +System Parameters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescriptionDefault ValuePossible Parameters
mail.smtp.ssl.trustIf this parameter is se, and a socket factory has not been specified, it enables the use of a MailSSLSocketFactory. If this parameter is set to "*", all the hosts are trusted. If it is set to a whitespace-separated list of hosts, only those specified hosts are trusted. If not, the hosts trusted depends on the certificate presented by the server.*String
mail.smtp.connectiontimeoutThe socket connection timeout value in milliseconds. infinite timeoutAny Integer
mail.smtp.timeoutThe socket I/O timeout value in milliseconds. infinite timeoutAny Integer
mail.smtp.fromThe email address to use for the SMTP MAIL command. This sets the envelope return address.Defaults to msg.getFrom() or InternetAddress.getLocalAddress().Any valid email address
mail.smtp.localportThe local port number to bind to when creating the SMTP socket.Defaults to the port number picked by the Socket class.Any Integer
mail.smtp.ehloIf this parameter is set to 'false', you must not attempt to sign in with the EHLO command.truetrue or false
mail.smtp.auth.login.disableIf this is set to 'true', it is not allowed to use the 'AUTH LOGIN' command.falsetrue or false
mail.smtp.auth.plain.disableIf this parameter is set to 'true', it is not allowed to use the 'AUTH PLAIN' command.falsetrue or false
mail.smtp.auth.digest-md5.disableIf this parameter is set to 'true', it is not allowed to use the 'AUTH DIGEST-MD5' command.falsetrue or false
mail.smtp.auth.ntlm.disableIf this parameter is set to 'true', it is not allowed to use the 'AUTH NTLM' commandfalsetrue or false
mail.smtp.auth.ntlm.domainThe NTLM authentication domain.NoneThe valid NTLM authentication domain name.
mail.smtp.auth.ntlm.flagsNTLM protocol-specific flags. For more details, see http://curl.haxx.se/rfc/ntlm.html#theNtlmFlags.NoneValid NTLM protocol-specific flags.
mail.smtp.dsn.notifyThe NOTIFY option to the RCPT command.NoneEither 'NEVER', or a combination of 'SUCCESS', 'FAILURE', and 'DELAY' (separated by commas).
mail.smtp.dsn.retThe 'RET' option to the 'MAIL' command.NoneEither 'FULL' or 'HDRS'.
mail.smtp.sendpartialIf this parameter is set to 'true' and a message is addressed to both valid and invalid addresses, the message is sent with a log that reports the partial failure with a 'SendFailedException' error. If this parameter is set to 'false' (which is default), the message is not sent to any of the recipients when the recipient lists contain one or more invalid addresses.falsetrue or false
mail.smtp.sasl.enableIf this parameter is set to 'true', the system attempts to use the 'javax.security.sasl' package to choose an authentication mechanism for the login.falsetrue or false
mail.smtp.sasl.mechanismsEnter a space or a comma-separated list of SASL mechanism names that the system shouldt try to use.None
mail.smtp.sasl.authorizationidThe authorization ID to be used in the SASL authentication. If no value is specified, the authentication ID (i.e., username) is used.usernameValid ID
mail.smtp.sasl.realmThe realm to be used with the 'DIGEST-MD5' authentication.None
mail.smtp.quitwaitIf this parameter is set to 'false', the 'QUIT' command is issued and the connection is immediately closed. If this parameter is set to 'true' (which is default), the transport waits for the response to the QUIT command.falsetrue or false
mail.smtp.reportsuccessIf this parameter is set to 'true', the transport to includes an 'SMTPAddressSucceededException' for each address to which the message is successfully delivered.falsetrue or false
mail.smtp.socketFactoryIf this parameter is set to a class that implements the 'javax.net.SocketFactory' interface, this class is used to create SMTP sockets.NoneSocket Factory
mail.smtp.socketFactory.classIf this parameter is set, it specifies the name of a class that implements the 'javax.net.SocketFactory interface'. This class is used to create SMTP sockets.None
mail.smtp.socketFactory.fallbackIf this parameter is set to 'true', the failure to create a socket using the specified socket factory class causes the socket to be created using the 'java.net.Socket' class.truetrue or false
mail.smtp.socketFactory.portThis specifies the port to connect to when using the specified socket factory.25Valid port number
mail.smtp.ssl.protocolsThis specifies the SSL protocols that need to be enabled for the SSL connections.NoneThis parameter specifies a whitespace separated list of tokens that are acceptable to the 'javax.net.ssl.SSLSocket.setEnabledProtocols' method.
mail.smtp.starttls.enableIf this parameter is set to 'true', it is possible to issue the 'STARTTLS' command (if supported by the server) to switch the connection to a TLS-protected connection before issuing any login commands.falsetrue or false
mail.smtp.starttls.requiredIf this parameter is set to 'true', it is required to use the 'STARTTLS' command. If the server does not support the 'STARTTLS' command, or if the command fails, the connection method will fail.falsetrue or false
mail.smtp.socks.hostThis specifies the host name of a SOCKS5 proxy server to be used for the connections to the mail server.None
mail.smtp.socks.portThis specifies the port number for the SOCKS5 proxy server. This needs to be used only if the proxy server is not using the standard port number 1080.1080valid port number
mail.smtp.auth.ntlm.disableIf this parameter is set to 'true', the AUTH NTLM command cannot be issued.falsetrue or false
mail.smtp.mailextensionThe extension string to be appended to the MAIL command.None
mail.smtp.usersetIf this parameter is set to 'true', you should use the 'RSET' command instead of the 'NOOP' command in the 'isConnected' method. In some scenarios, 'sendmail' responds slowly after many 'NOOP' commands. This is avoided by using 'RSET' instead.falsetrue or false
+ +Examples +EXAMPLE 1 +``` +@sink(type='email', @map(type ='json'), username='sender.account', address='sender.account@gmail.com',password='account.password',subject='Alerts from Wso2 Stream Processor',to='{{email}}',)define stream FooStream (email string, loginId int, name string); +``` +

This example illustrates how to publish events via an email sink based on the values provided for the mandatory parameters. As shown in the example, it publishes events from the 'FooStream' in 'json' format as emails to the specified 'to' recipients via the email sink. The email is sent from the 'sender.account@gmail.com' email address via a secure connection.

+ +EXAMPLE 2 +``` +@sink(type='email', @map(type ='json'), subject='Alerts from Wso2 Stream Processor',to='{{email}}',)define stream FooStream (email string, loginId int, name string); +``` +

This example illustrates how to configure the query parameters and the system parameters in the 'deployment.yaml' file.
 Corresponding parameters need to be configured under 'email', and namespace:'sink' as follows:
  siddhi: extensions:
      - extension:
          name:'email'
          namespace:'sink'
          properties:
            username: <sender's email username>
            address: <sender's email address>
            password: <sender's email password>

As shown in the example, events from the FooStream are published in 'json' format via the email sink as emails to the given 'to' recipients. The email is sent from the 'sender.account@gmail.com' address via a secure connection.

+ +EXAMPLE 3 +``` +@sink(type='email', @map(type ='json'), username='sender.account', address='sender.account@gmail.com',password='account.password',host='smtp.gmail.com',port='465',ssl.enable='true',auth='true',content.type='text/html',subject='Alerts from Wso2 Stream Processor-{{name}}',to='to1.account@gmail.com, to2.account@gmail.com',cc='cc1.account@gmail.com, cc2.account@gmail.com',bcc='bcc1.account@gmail.com)define stream FooStream (name string, age int, country string); +``` +

This example illustrates how to publish events via the email sink. Events from the 'FooStream' stream are published in 'xml' format via the email sink as a text/html message and sent to the specified 'to', 'cc', and 'bcc' recipients via a secure connection. The 'name' namespace in the 'subject' attribute is the value of the 'name' parameter in the corresponding output event.

+ +EXAMPLE 4 +``` +@sink(type='email', @map(type ='json'), username='sender.account', address='sender.account@gmail.com',password='account.password',host='smtp.gmail.com',port='465',ssl.enable='true',auth='true',content.type='text/html',subject='Alerts from Wso2 Stream Processor-{{name}}',to='to1.account@gmail.com, to2.account@gmail.com',cc='cc1.account@gmail.com, cc2.account@gmail.com',bcc='bcc1.account@gmail.comattachments= '{{attachments}}')define stream FooStream (name string, age int, country string, attachments string); +``` +

This example illustrates how to publish events via the email sink. Here, the email also contains attachments.
 Events from the FooStream are published in 'xml' format via the email sink as a 'text/html' message to the specified 'to','cc', and 'bcc' recipients via a secure connection. The 'name' namespace in the 'subject' attribute is the value for the 'name' parameter in the corresponding output event.
The attachments included in the email message are the local files available in the path specified as the value for the 'attachments' attribute.

+ +## Source + +### email *(Source)* + +

The 'Email' source allows you to receive events via emails. An 'Email' source can be configured using the 'imap' or 'pop3' server to receive events. This allows you to filter the messages that satisfy the criteria specified under the 'search term' option. The email source parameters can be defined in either the '<SP_HOME>/conf/<PROFILE>/deployment yaml' file or the stream definition. If the parameter configurations are not available in either place, the default values are considered (i.e., if default values are available). If you need to configure server system parameters that are not provided as options in the stream definition, they need to be defined in the 'deployment yaml' file under 'email source properties'. For more information about 'imap' and 'pop3' server system parameters, see the following.
[JavaMail Reference Implementation - IMAP Store](https://javaee.github.io/javamail/IMAP-Store)
[JavaMail Reference Implementation - POP3 Store Store](https://javaee.github.io/javamail/POP3-Store)

+ +Syntax +``` +@source(type="email", username="", password="", store="", host="", port="", folder="", search.term="", polling.interval="", action.after.processed="", folder.to.move="", content.type="", ssl.enable="", @map(...))) +``` + +QUERY PARAMETERS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
usernameThe user name of the email account. e.g., 'wso2mail' is the username of the 'wso2mail@gmail.com' mail account.STRINGNoNo
passwordThe password of the email accountSTRINGNoNo
storeThe store type that used to receive emails. Possible values are 'imap' and 'pop3'.imapSTRINGYesNo
hostThe host name of the server (e.g., 'imap.gmail.com' is the host name for a gmail account with an IMAP store.). The default value 'imap.gmail.com' is only valid if the email account is a gmail account with IMAP enabled.If store type is 'imap', then the default value is 'imap.gmail.com'. If the store type is 'pop3', then thedefault value is 'pop3.gmail.com'.STRINGYesNo
portThe port that is used to create the connection.'993', the default value is valid only if the store is 'imap' and ssl-enabled.INTYesNo
folderThe name of the folder to which the emails should be fetched.INBOXSTRINGYesNo
search.termThe option that includes conditions such as key-value pairs to search for emails. In a string search term, the key and the value should be separated by a semicolon (';'). Each key-value pair must be within inverted commas (' '). The string search term can define multiple comma-separated key-value pairs. This string search term currently supports only the 'subject', 'from', 'to', 'bcc', and 'cc' keys. e.g., if you enter 'subject:DAS, from:carbon, bcc:wso2', the search term creates a search term instance that filters emails that contain 'DAS' in the subject, 'carbon' in the 'from' address, and 'wso2' in one of the 'bcc' addresses. The string search term carries out sub string matching that is case-sensitive. If '@' in included in the value for any key other than the 'subject' key, it checks for an address that is equal to the value given. e.g., If you search for 'abc@', the string search terms looks for an address that contains 'abc' before the '@' symbol.NoneSTRINGYesNo
polling.intervalThis defines the time interval in seconds at which th email source should poll the account to check for new mail arrivals.in seconds.600LONGYesNo
action.after.processedThe action to be performed by the email source for the processed mail. Possible values are as follows:
'FLAGGED': Sets the flag as 'flagged'.
'SEEN': Sets the flag as 'read'.
'ANSWERED': Sets the flag as 'answered'.
'DELETE': Deletes tha mail after the polling cycle.
'MOVE': Moves the mail to the folder specified in the 'folder.to.move' parameter.
 If the folder specified is 'pop3', then the only option available is 'DELETE'.
NONESTRINGYesNo
folder.to.moveThe name of the folder to which the mail must be moved once it is processed. If the action after processing is 'MOVE', it is required to specify a value for this parameter.STRINGNoNo
content.typeThe content type of the email. It can be either 'text/plain' or 'text/html.'text/plainSTRINGYesNo
ssl.enableIf this is set to 'true', a secure port is used to establish the connection. The possible values are 'true' and 'false'.trueBOOLYesNo
+ +System Parameters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescriptionDefault ValuePossible Parameters
mail.imap.partialfetchThis determines whether the IMAP partial-fetch capability should be used.truetrue or false
mail.imap.fetchsizeThe partial fetch size in bytes.16Kvalue in bytes
mail.imap.peekIf this is set to 'true', the IMAP PEEK option should be used when fetching body parts to avoid setting the 'SEEN' flag on messages. The default value is 'false'. This can be overridden on a per-message basis by the 'setPeek method' in 'IMAPMessage'.falsetrue or false
mail.imap.connectiontimeoutThe socket connection timeout value in milliseconds. This timeout is implemented by 'java.net.Socket'.infinity timeoutAny Integer value
mail.imap.timeoutThe socket read timeout value in milliseconds. This timeout is implemented by 'java.net.Socket'.infinity timeoutAny Integer value
mail.imap.writetimeoutThe socket write timeout value in milliseconds. This timeout is implemented by using a 'java.util.concurrent.ScheduledExecutorService' per connection that schedules a thread to close the socket if the timeout period elapses. Therefore, the overhead of using this timeout is one thread per connection.infinity timeoutAny Integer value
mail.imap.statuscachetimeoutThe timeout value in milliseconds for the cache of 'STATUS' command response.1000msTime out in miliseconds
mail.imap.appendbuffersizeThe maximum size of a message to buffer in memory when appending to an IMAP folder.NoneAny Integer value
mail.imap.connectionpoolsizeThe maximum number of available connections in the connection pool.1Any Integer value
mail.imap.connectionpooltimeoutThe timeout value in milliseconds for connection pool connections. 45000msAny Integer
mail.imap.separatestoreconnectionIf this parameter is set to 'true', it indicates that a dedicated store connection needs to be used for store commands.truetrue or false
mail.imap.auth.login.disableIf this is set to 'true', it is not possible to use the non-standard 'AUTHENTICATE LOGIN' command instead of the plain 'LOGIN' command.falsetrue or false
mail.imap.auth.plain.disableIf this is set to 'true', the 'AUTHENTICATE PLAIN' command cannot be used.falsetrue or false
mail.imap.auth.ntlm.disableIf true, prevents use of the AUTHENTICATE NTLM command.falsetrue or false
mail.imap.proxyauth.userIf the server supports the PROXYAUTH extension, this property specifies the name of the user to act as. Authentication to log in to the server is carried out using the administrator's credentials. After authentication, the IMAP provider issues the 'PROXYAUTH' command with the user name specified in this property.NoneValid string value
mail.imap.localaddressThe local address (host name) to bind to when creating the IMAP socket.Defaults to the address picked by the Socket class.Valid string value
mail.imap.localportThe local port number to bind to when creating the IMAP socket.Defaults to the port number picked by the Socket class.Valid String value
mail.imap.sasl.enableIf this parameter is set to 'true', the system attempts to use the 'javax.security.sasl' package to choose an authentication mechanism for the login.falsetrue or false
mail.imap.sasl.mechanismsA list of SASL mechanism names that the system should to try to use. The names can be separated by spaces or commas.NoneValid string value
mail.imap.sasl.authorizationidThe authorization ID to use in the SASL authentication.If this parameter is not set, the authentication ID (username) is used.Valid string value
mail.imap.sasl.realmThe realm to use with SASL authentication mechanisms that require a realm, such as 'DIGEST-MD5'.NoneValid string value
mail.imap.auth.ntlm.domainThe NTLM authentication domain.NoneValid string value
The NTLM authentication domain.NTLM protocol-specific flags.NoneValid integer value
mail.imap.socketFactoryIf this parameter is set to a class that implements the 'javax.net.SocketFactory' interface, this class is used to create IMAP sockets.NoneValid SocketFactory
mail.imap.socketFactory.classIf this parameter is set, it specifies the name of a class that implements the 'javax.net.SocketFactory' interface. This class is used to create IMAP sockets.NoneValid string
mail.imap.socketFactory.fallbackIf this parameter is set to 'true', failure to create a socket using the specified socket factory class results in the socket being created using the 'java.net.Socket' class. truetrue or false
mail.imap.socketFactory.portThis specifies the port to connect to when using the specified socket factory. If this parameter is not set, the default port is used.143Valid Integer
mail.imap.ssl.checkserveridentityIf this parameter is set to 'true', the system checks the server identity as specified by RFC 2595.falsetrue or false
mail.imap.ssl.trustIf this parameter is set and a socket factory has not been specified, it enables the use of a 'MailSSLSocketFactory'.
If this parameter is set to '*', all the hosts are trusted.
If this parameter specifies list of hosts separated by white spaces, only those hosts are trusted.
If the parameter is not set to any of the values mentioned above, trust depends on the certificate presented by the server.
*Valid String
mail.imap.ssl.socketFactoryIf this parameter is set to a class that extends the 'javax.net.ssl.SSLSocketFactory' class this class is used to create IMAP SSL sockets.NoneSSL Socket Factory
mail.imap.ssl.socketFactory.classIf this parameter is set, it specifies the name of a class that extends the 'javax.net.ssl.SSLSocketFactory' class. This class is used to create IMAP SSL sockets.NoneValid String
mail.imap.ssl.socketFactory.portThis specifies the port to connect to when using the specified socket factory.the default port 993 is used.valid port number
mail.imap.ssl.protocolsThis specifies the SSL protocols that are enabled for SSL connections. The property value is a whitespace-separated list of tokens acceptable to the 'javax.net.ssl.SSLSocket.setEnabledProtocols' method.NoneValid string
mail.imap.starttls.enableIf this parameter is set to 'true', it is possible to use the 'STARTTLS' command (if supported by the server) to switch the connection to a TLS-protected connection before issuing any login commands.falsetrue or false
mail.imap.socks.hostThis specifies the host name of a 'SOCKS5' proxy server that is used to connect to the mail server.NoneValid String
mail.imap.socks.portThis specifies the port number for the 'SOCKS5' proxy server. This is needed if the proxy server is not using the standard port number 1080.1080Valid String
mail.imap.minidletimeThis property sets the delay in milliseconds.10 millisecondstime in seconds (Integer)
mail.imap.enableimapeventsIf this property is set to 'true', it enables special IMAP-specific events to be delivered to the 'ConnectionListener' of the store. The unsolicited responses received during the idle method of the store are sent as connection events with 'IMAPStore.RESPONSE' as the type. The event's message is the raw IMAP response string.falsetrue or false
mail.imap.folder.classThe class name of a subclass of 'com.sun.mail.imap.IMAPFolder'. The subclass can be used to provide support for additional IMAP commands. The subclass must have public constructors of the form 'public MyIMAPFolder'(String fullName, char separator, IMAPStore store, Boolean isNamespace) and public 'MyIMAPFolder'(ListInfo li, IMAPStore store)NoneValid String
mail.pop3.connectiontimeoutThe socket connection timeout value in milliseconds.Infinite timeoutInteger value
mail.pop3.timeoutThe socket I/O timeout value in milliseconds. Infinite timeoutInteger value
mail.pop3.message.classThe class name of a subclass of 'com.sun.mail.pop3.POP3Message'.NoneValid String
mail.pop3.localaddressThe local address (host name) to bind to when creating the POP3 socket.Defaults to the address picked by the Socket class.Valid String
mail.pop3.localportThe local port number to bind to when creating the POP3 socket.Defaults to the port number picked by the Socket class.Valid port number
mail.pop3.apop.enableIf this parameter is set to 'true', use 'APOP' instead of 'USER/PASS' to log in to the 'POP3' server (if the 'POP3' server supports 'APOP'). APOP sends a digest of the password instead of clearing the text password.falsetrue or false
mail.pop3.socketFactoryIf this parameter is set to a class that implements the 'javax.net.SocketFactory' interface, this class is used to create 'POP3' sockets.NoneSocket Factory
mail.pop3.socketFactory.classIf this parameter is set, it specifies the name of a class that implements the 'javax.net.SocketFactory' interface. This class is used to create 'POP3' sockets.NoneValid String
mail.pop3.socketFactory.fallbackIf this parameter is set to 'true', failure to create a socket using the specified socket factory class results in the socket being created using the 'java.net.Socket' class.falsetrue or false
mail.pop3.socketFactory.portThis specifies the port to connect to when using the specified socket factory.Default portValid port number
mail.pop3.ssl.checkserveridentityIf this parameter is set to 'true', check the server identity as specified by RFC 2595. falsetrue or false
mail.pop3.ssl.trustIf this parameter is set and a socket factory has not been specified, it is possible to use a 'MailSSLSocketFactory'.
If this parameter is set to '*', all the hosts are trusted.
If the parameter is set to a whitespace-separated list of hosts, only those hosts are trusted.
If the parameter is not set to any of the values mentioned above, trust depends on the certificate presented by the server.
*Valid String
mail.pop3.ssl.socketFactoryIf this parameter is set to a class that extends the 'javax.net.ssl.SSLSocketFactory' class, this class is used to create 'POP3' SSL sockets.NoneSSL Socket Factory
mail.pop3.ssl.checkserveridentityIf this parameter is set to 'true', the system checks the server identity as specified by 'RFC 2595'. falsetrue or false
mail.pop3.ssl.trust If this parameter is set and a socket factory has not been specified, it is possible to use a 'MailSSLSocketFactory'.
If this parameter is set to '*', all the hosts are trusted.
If the parameter is set to a whitespace-separated list of hosts, only those hosts are trusted.
Trust depends on the certificate presented by the server.Valid String
mail.pop3.ssl.socketFactoryIf this parameter is set to a class that extends the 'javax.net.ssl.SSLSocketFactory' class, this class is used to create 'POP3 SSL' sockets.NoneSSL Socket Factory
mail.pop3.ssl.socketFactory.classIf this parameter is set, it specifies the name of a class that extends the 'javax.net.ssl.SSLSocketFactory' class. This class is used to create 'POP3 SSL' sockets. NoneValid String
mail.pop3.ssl.socketFactory.pThis parameter pecifies the port to connect to when using the specified socket factory.995Valid Integer
mail.pop3.ssl.protocolsThis parameter specifies the SSL protocols that are enabled for SSL connections. The property value is a whitespace-separated list of tokens acceptable to the 'javax.net.ssl.SSLSocket.setEnabledProtocols' method.NoneValid String
mail.pop3.starttls.enableIf this parameter is set to 'true', it is possible to use the 'STLS' command (if supported by the server) to switch the connection to a TLS-protected connection before issuing any login commands.falsetrue or false
mail.pop3.starttls.requiredIf this parameter is set to 'true', it is required to use the 'STLS' command. The connect method fails if the server does not support the 'STLS' command or if the command fails.falsetrue or false
mail.pop3.socks.hostThis parameter specifies the host name of a 'SOCKS5' proxy server that can be used to connect to the mail server.NoneValid String
mail.pop3.socks.portThis parameter specifies the port number for the 'SOCKS5' proxy server.NoneValid String
mail.pop3.disabletopIf this parameter is set to 'true', the 'POP3 TOP' command is not used to fetch message headers. falsetrue or false
mail.pop3.forgettopheadersIf this parameter is set to 'true', the headers that might have been retrieved using the 'POP3 TOP' command is forgotten and replaced by the headers retrieved when the 'POP3 RETR' command is executed.falsetrue or false
mail.pop3.filecache.enableIf this parameter is set to 'true', the 'POP3' provider caches message data in a temporary file instead of caching them in memory. Messages are only added to the cache when accessing the message content. Message headers are always cached in memory (on demand). The file cache is removed when the folder is closed or the JVM terminates.falsetrue or false
mail.pop3.filecache.dirIf the file cache is enabled, this property is used to override the default directory used by the JDK for temporary files.NoneValid String
mail.pop3.cachewritetoThis parameter controls the behavior of the 'writeTo' method on a 'POP3' message object. If the parameter is set to 'true', the message content has not been cached yet, and the 'ignoreList' is null, the message is cached before being written. If not, the message is streamed directly to the output stream without being cached.falsetrue or false
mail.pop3.keepmessagecontentIf this property is set to 'true', a hard reference to the cached content is retained, preventing the memory from being reused until the folder is closed, or until the cached content is explicitly invalidated (using the 'invalidate' method). falsetrue or false
+ +Examples +EXAMPLE 1 +``` +@source(type='email', @map(type='xml'), username='receiver.account', password='account.password',)define stream inputStream (name string, age int, country string); +``` +

This example illustrates how to receive events in 'xml' format via the email source. In this example, only the required parameters are defined in the stream definition. The default values are taken for the other parameters. The search term is not defined, and therefore, all the new messages in the inbox folder are polled and taken.

+ +EXAMPLE 2 +``` +@source(type='email', @map(type='xml'), username='receiver.account', password='account.password',store = 'imap',host = 'imap.gmail.com',port = '993',searchTerm = 'subject:Stream Processor, from: from.account@ , cc: cc.account',polling.interval='500',action.after.processed='DELETE',content.type='text/html,)define stream inputStream (name string, age int, country string); +``` +

This example illustrates how to receive events in 'xml' format via the email source. The email source polls the mail account every 500 seconds to check whether any new mails have arrived. It processes new mails only if they satisfy the conditions specified for the email search term (the value for 'from' of the email message should be 'from.account@.<host name>', and the message should contain 'cc.account' in the cc receipient list and the word 'Stream Processor' in the mail subject). in this example, the action after processing is 'DELETE'. Therefore,after processing the event, corresponding mail is deleted from the mail folder.

+ diff --git a/docs/api/latest.md b/docs/api/latest.md index 04be36f..8a53e6f 100644 --- a/docs/api/latest.md +++ b/docs/api/latest.md @@ -1,8 +1,8 @@ -# API Docs - v2.0.2 +# API Docs - v2.0.3 ## Sink -### email *(Sink)* +### email *(Sink)*

The email sink uses the 'smtp' server to publish events via emails. The events can be published in 'text', 'xml' or 'json' formats. The user can define email sink parameters in either the '<SP_HOME>/conf/<PROFILE>/deployment yaml' file or in the stream definition. The email sink first checks the stream definition for parameters, and if they are no configured there, it checks the 'deployment.yaml' file. If the parameters are not configured in either place, default values are considered for optional parameters. If you need to configure server system parameters that are not provided as options in the stream definition, then those parameters need to be defined them in the 'deployment.yaml' file under 'email sink properties'.

For more information about the SMTP server parameters, see https://javaee.github.io/javamail/SMTP-Transport.

Further, some email accounts are required to enable the 'access to less secure apps' option. For gmail accounts, you can enable this option via https://myaccount.google.com/lesssecureapps.

@@ -362,7 +362,7 @@ ## Source -### email *(Source)* +### email *(Source)*

The 'Email' source allows you to receive events via emails. An 'Email' source can be configured using the 'imap' or 'pop3' server to receive events. This allows you to filter the messages that satisfy the criteria specified under the 'search term' option. The email source parameters can be defined in either the '<SP_HOME>/conf/<PROFILE>/deployment yaml' file or the stream definition. If the parameter configurations are not available in either place, the default values are considered (i.e., if default values are available). If you need to configure server system parameters that are not provided as options in the stream definition, they need to be defined in the 'deployment yaml' file under 'email source properties'. For more information about 'imap' and 'pop3' server system parameters, see the following.
[JavaMail Reference Implementation - IMAP Store](https://javaee.github.io/javamail/IMAP-Store)
[JavaMail Reference Implementation - POP3 Store Store](https://javaee.github.io/javamail/POP3-Store)

diff --git a/docs/index.md b/docs/index.md index 6b9683d..a6ef82c 100644 --- a/docs/index.md +++ b/docs/index.md @@ -19,12 +19,12 @@ For information on Siddhi and i ## Latest API Docs -Latest API Docs is 2.0.2. +Latest API Docs is 2.0.3. ## Features -* email *(Sink)*

The email sink uses the 'smtp' server to publish events via emails. The events can be published in 'text', 'xml' or 'json' formats. The user can define email sink parameters in either the '<SP_HOME>/conf/<PROFILE>/deployment yaml' file or in the stream definition. The email sink first checks the stream definition for parameters, and if they are no configured there, it checks the 'deployment.yaml' file. If the parameters are not configured in either place, default values are considered for optional parameters. If you need to configure server system parameters that are not provided as options in the stream definition, then those parameters need to be defined them in the 'deployment.yaml' file under 'email sink properties'.

For more information about the SMTP server parameters, see https://javaee.github.io/javamail/SMTP-Transport.

Further, some email accounts are required to enable the 'access to less secure apps' option. For gmail accounts, you can enable this option via https://myaccount.google.com/lesssecureapps.

-* email *(Source)*

The 'Email' source allows you to receive events via emails. An 'Email' source can be configured using the 'imap' or 'pop3' server to receive events. This allows you to filter the messages that satisfy the criteria specified under the 'search term' option. The email source parameters can be defined in either the '<SP_HOME>/conf/<PROFILE>/deployment yaml' file or the stream definition. If the parameter configurations are not available in either place, the default values are considered (i.e., if default values are available). If you need to configure server system parameters that are not provided as options in the stream definition, they need to be defined in the 'deployment yaml' file under 'email source properties'. For more information about 'imap' and 'pop3' server system parameters, see the following.
[JavaMail Reference Implementation - IMAP Store](https://javaee.github.io/javamail/IMAP-Store)
[JavaMail Reference Implementation - POP3 Store Store](https://javaee.github.io/javamail/POP3-Store)

+* email *(Sink)*

The email sink uses the 'smtp' server to publish events via emails. The events can be published in 'text', 'xml' or 'json' formats. The user can define email sink parameters in either the '<SP_HOME>/conf/<PROFILE>/deployment yaml' file or in the stream definition. The email sink first checks the stream definition for parameters, and if they are no configured there, it checks the 'deployment.yaml' file. If the parameters are not configured in either place, default values are considered for optional parameters. If you need to configure server system parameters that are not provided as options in the stream definition, then those parameters need to be defined them in the 'deployment.yaml' file under 'email sink properties'.

For more information about the SMTP server parameters, see https://javaee.github.io/javamail/SMTP-Transport.

Further, some email accounts are required to enable the 'access to less secure apps' option. For gmail accounts, you can enable this option via https://myaccount.google.com/lesssecureapps.

+* email *(Source)*

The 'Email' source allows you to receive events via emails. An 'Email' source can be configured using the 'imap' or 'pop3' server to receive events. This allows you to filter the messages that satisfy the criteria specified under the 'search term' option. The email source parameters can be defined in either the '<SP_HOME>/conf/<PROFILE>/deployment yaml' file or the stream definition. If the parameter configurations are not available in either place, the default values are considered (i.e., if default values are available). If you need to configure server system parameters that are not provided as options in the stream definition, they need to be defined in the 'deployment yaml' file under 'email source properties'. For more information about 'imap' and 'pop3' server system parameters, see the following.
[JavaMail Reference Implementation - IMAP Store](https://javaee.github.io/javamail/IMAP-Store)
[JavaMail Reference Implementation - POP3 Store Store](https://javaee.github.io/javamail/POP3-Store)

## Dependencies diff --git a/mkdocs.yml b/mkdocs.yml index b31f247..053ffdd 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -33,7 +33,7 @@ markdown_extensions: pages: - Information: index.md - API Docs: - - latest: api/latest.md + - 2.0.3: api/2.0.3.md - 2.0.2: api/2.0.2.md - 2.0.1: api/2.0.1.md - 2.0.0: api/2.0.0.md @@ -65,4 +65,5 @@ pages: - 1.0.2: api/1.0.2.md - 1.0.1: api/1.0.1.md - 1.0.0: api/1.0.0.md + - latest: api/latest.md - License: license.md