Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space WBRIDGE and version 22.1

...

Multiexcerpt
MultiExcerptNamereadMessages
Info
titleOptional: IPgpKeyProvider Implementation

For PGP decryption to work, be sure to register your implementation of IPgpKeyProvider (see Keys and Certificates). If not provided, PGP encrypted messages will still be retrieved, with two attachments that contain the encrypted message information.

ParameterTypeDirectionDescription
connectionConnectioninSpecify the Connection object defining the mail server connection parameters to use (see Mail Server Connection).
flagsReadFlagsinSpecify an instance of ReadFlags to set some mail reading flags.
folderPathStringinSpecify a path to a folder to read from. See note regarding folder handling.

...

Multiexcerpt
MultiExcerptNamereadMessagesFiltered
Parameterconnection
Info
TypesDirectionDescription
titleOptional: IPgpKeyProvider Implementation

For PGP decryption to work, be sure to register your implementation of IPgpKeyProvider (see Keys and Certificates). If not provided, PGP encrypted messages will still be retrieved, with two attachments that contain the encrypted message information.

ParameterTypesDirectionDescription
connectionConnectioninSpecify the Connection object defining the mail server connection parameters to use (see Mail Server Connection).
flagsReadFlagsinSpecify an instance of ReadFlags (see below).
folderPathStringinSpecify a path to a folder to read from. See note regarding folder handling.
filterFilterinSpecify an instance of Filter containing the filter criteria.

...

Multiexcerpt
MultiExcerptNamedeleteMessagesFiltered
ParameterTypesDirectionDescriptionAllowed Values / Example
connectionConnectioninSpecify the Connection object defining the mail server connection parameters to use (see Mail Server Connection).
folderPath

String

inSpecify a path to a folder to delete from. See note regarding folder handling.

orders/incoming

filterFilterin

Specify an instance of Filter containing the filter criteria.

moveMessage

Multiexcerpt
MultiExcerptNamemoveMessage
ParameterTypesDirectionDescriptionAllowed Values / Example
connectionConnectioninSpecify the Connection object defining the mail server connection parameters to use (see Mail Server Connection).mailReceivedMailinProvide an array previously received mail object.folderPath

String

in
Specify
Note

If no filter criteria are set, i.e. if you provide an empty filter, all messages will be deleted.


affectedMessagesIntegeroutReturns the number of deleted messages.

This might be lower than the total number of messages matching the filter if that number is huge, as mail servers may restrict the maximum number of messages processed in one call. If you want to be sure that all messages matching the filter are actually deleted, call this operation in a loop until affectedMessages becomes 0.

moveMessage

Multiexcerpt
MultiExcerptNamemoveMessage
ParameterTypesDirectionDescriptionAllowed Values / Example
connectionConnectioninSpecify the Connection object defining the mail server connection parameters to use (see Mail Server Connection).
mailReceivedMailinProvide an array previously received mail object.
folderPath

String

in

Specify a path to a specific sub-folder to move the message to. See note regarding folder handling.

Info
iconfalse

POP3 connections will cause an exception to be thrown here, as POP3 does not support the concept of folders.

orders/incoming/accepted

...

Multiexcerpt
MultiExcerptNamesendMessage
ParameterTypesDirectionDescription
connectionConnectioninSpecify the Connection object defining the mail server connection parameters to use (see Mail Server Connection).
mail

Mail

inPrepare a mail object to send.

...

sendPgpMessage

existsFolderPath
Multiexcerpt
MultiExcerptNamelistFolderssendPgpMessage
Multiexcerpt
MultiExcerptNameParameter
Info
Types
connection
title
DirectionDescriptionAllowed Values / Example
Requires IPgpKeyProvider Implementation

For PGP encryption to work, be sure to register your implementation of IPgpKeyProvider (see Keys and Certificates).

parentFolderString
ParameterTypesDirectionDescriptionAllowed Values / Example
connectionConnectioninSpecify the Connection object defining the mail server connection parameters to use (see Mail Server Connection).

mail

Mail

inSpecify the path to the parent folder. See note regarding folder handling.NULLList folders below <Inbox>.
\List folders below root folder.
a pathList folders below given path.
foldersArray of Stringreturn

Returns a recursive list of sub-folder paths.

  • orders
  • orders/incoming
  • orders/incoming/accepted

existsFolderPath

Prepare a mail object to send.

encryptionMode

String

inSpecify one of the encryption modes.

PREFER

Apply encryption when PGP keys can be retrieved (see Keys and Certificates), otherwise do not apply any encryption.

ENFORCE

Apply encryption when PGP keys can be retrieved, otherwise throw an exception.

NONE

Do not apply any encryption (default, same behavior as sendMessage()).

listFolders

Multiexcerpt
MultiExcerptNamelistFolders
to check
ParameterTypesDirectionDescriptionAllowed Values / Example
connectionConnectioninSpecify the Connection object defining the mail server connection parameters to use (see Mail Server Connection).folderPath
parentFolder

String

inSpecify the path to the parent folder. See note regarding folder handling.orders/outgoing
existsBooleanreturn

Returns if the given folder is existent on the mail server.

trueFolder exists.
falseFolder does not exist.

...

NULLList folders below <Inbox>.
\List folders below root folder.
a pathList folders below given path.
foldersArray of Stringreturn

Returns a recursive list of sub-folder paths.

  • orders
  • orders/incoming
  • orders/incoming/accepted

existsFolderPath

Multiexcerpt
MultiExcerptNamecreateFolderPathexistsFolderPath
ParameterTypesDirectionDescriptionAllowed Values / Example
connectionConnectioninSpecify the Connection object defining the mail server connection parameters to use (see Mail Server Connection).
folderPath

String

inSpecify the path to the  the folder to be createdcheck. See note regarding folder handling.orders/outgoing
exists

...

Boolean
Multiexcerpt
MultiExcerptNamedeleteFolderPath
Allowed
ParameterTypesDirectionDescriptionreturn

Returns if the given folder is existent on the mail server.

trueFolder exists.
falseFolder does not exist.

createFolderPath

Multiexcerpt
MultiExcerptNamecreateFolderPath
ParameterTypesDirectionDescriptionAllowed Values / Example
connectionConnectioninSpecify the Connection object defining the mail server connection parameters to use (see Mail Server Connection).
folderPath

String

inSpecify the path to the  folder to be deleted recursivelycreated. See note regarding folder handling.orders/incoming/accepted
Delete folder accepted from folder incoming.
  • orders
    Delete folder orders and all sub-folders and contents.
  • ...

    outgoing

    deleteFolderPath

    Multiexcerpt
    MultiExcerptNameloadCertificateStoredeleteFolderPath
    ParameterTypesDirectionDescriptionAllowed Values / Example
    keyStoreLocationconnectionStringConnectioninSpecify the path to the  keystore file.opt/bridge/crypto/mailservercerts.jkskeyStorePasswordConnection object defining the mail server connection parameters to use (see Mail Server Connection).
    folderPath

    String

    inSpecify the password of the keystore.

    ...

    path to the  folder to be deleted recursively. See note regarding folder handling.
    • orders/incoming/accepted
      Delete folder accepted from folder incoming.
    • orders
      Delete folder orders and all sub-folders and contents.

    loadCertificateStore

    Multiexcerpt
    MultiExcerptNameloadPgpPublicKeyRingloadCertificateStore
    ParameterTypesDirectionDescriptionAllowed Values / Example
    keyRingLocationkeyStoreLocationStringinSpecify the path to the  keyring keystore file.opt/bridge/crypto/pubkeysmailservercerts.ascjks

    ...

    keyStorePassword

    ...

    String

    Multiexcerpt
    MultiExcerptNameconnection
    Attribute NameTypeDescriptionAllowed Values
    debugBooleanSpecify whether to write additional debug information to the bridgeserver log.trueAdditional debug information is written to the bridgeserver log.
    falseNo additional logs (default).
    exchangeVersionStringSpecify the Microsoft Exchange version (optional).2007_SP1 Exchange 2007 Service Pack 1
    2010Exchange 2010
    2010_SP1Exchange 2010 Service Pack 1
    2010_SP2Exchange 2010 Service Pack 2 and higher (default)
    hostStringSpecify the host name/IP address of the mail server.a valid host name or IP address

    for exchange connections this can be left NULL, triggering Autodiscover (which might fail)

    for  office365 connections this is ignored

    passwordStringSpecify the user's password.a valid passwordSome SMTP servers allow unauthorized sending, in these cases you may leave it as NULL.
    portIntegerSpecify the port of the mail server (optional)a valid port numberIf omitted (NULL), the standard port for the chosen protocol and security is used.
    protocolString

    Specify the protocol used for e-mail retrieval and storage.
    Values are not case sensitive.

    imapUse the IMAP protocol.
    imapsUse IMAP over SSL.
    pop3Use POP3.
    smtpUse the SMTP protocol.
    smtpsUse the SMTPS protocol.
    exchangeUse Exchange Web Service (EWS) API with a hosted Exchange Server
    office365Use Exchange Web Service (EWS) API with a Office 365 Server (will ignore host).
    securityString

    Specify the encryption.
    Values are not case sensitive.

    Info
    iconfalse

    exchange and office365 protocols ignore this setting and use ssl anyway.

    noneNo encryption used.
    exchange and office365 protocol (see attribute protocol) use SSL in any case, this cannot be overridden.
    ssl

    Use SSL encryption. 

    starttls

    Use TLS encryption.
    exchange and office365 protocol (see attribute protocol) use SSL in any case, this cannot be overridden.

    Info
    iconfalse

    Make sure to pick imap, pop3, or smtp with this setting, not imaps, pop3s, or smtps.

    timeoutSecondsIntegerSpecify the number of seconds after which a request (send or receive) times out.

    any positive integer

    Default is 0, which translates to the following defaults:

    • infinite timeout for imap(s), pop3(s), and smtp(s)
    • 100 seconds for exchange
    userStringSpecify the user account on the mail server.a valid userSome SMTP servers allow unauthorized sending. In these cases you may leave it as NULL.
    verifyHostBooleanSpecify whether for SSL connections the mail server host shall be verified or not (optional).trueVerify the mail server's SSL certificate (default, see also security).
    falseDo not verify the mail server.inSpecify the password of the keystore.


    loadPgpPublicKeyRing

    Multiexcerpt
    MultiExcerptNameloadPgpPublicKeyRing
    Info
    titleto be discontinued

    Future versions of the library will rely on setPgpKeyProvider() solely (see below), this operation will disappear. Until then it is still required if you want to verify signatures of unencrypted emails.

    ParameterTypesDirectionDescriptionAllowed Values / Example
    keyRingLocationStringinSpecify the path to the  keyring file.opt/bridge/crypto/pubkeys.asc

    setPgpKeyProvider

    Multiexcerpt
    MultiExcerptNamesetPgpKeyProvider
    ParameterTypesDirectionDescriptionAllowed Values / Example
    providerIPgpKeyProviderinInstance of a class implementing the IPgpKeyProvider interface

    Types

    Connection

    Multiexcerpt
    MultiExcerptNameconnection
    Attribute NameTypeDescriptionAllowed Values
    debugBooleanSpecify whether to write additional debug information to the bridgeserver log.trueAdditional debug information is written to the bridgeserver log.
    falseNo additional logs (default).
    exchangeVersionStringSpecify the Microsoft Exchange version (optional).2007_SP1 Exchange 2007 Service Pack 1
    2010Exchange 2010
    2010_SP1Exchange 2010 Service Pack 1
    2010_SP2Exchange 2010 Service Pack 2 and higher (default)
    hostStringSpecify the host name/IP address of the mail server.a valid host name or IP address

    for exchange connections this can be left NULL, triggering Autodiscover (which might fail)

    for  office365 connections this is ignored

    microsoftOnlineCredentialsObjectSpecify OAuth login credentials for Microsoft Online connectionsa valid set of credentialseither this or usernamePasswordCredentials must be set
    portIntegerSpecify the port of the mail server (optional)a valid port numberIf omitted (NULL), the standard port for the chosen protocol and security is used.
    protocolString

    Specify the protocol used for e-mail retrieval and storage.
    Values are not case sensitive.

    imapUse the IMAP protocol.
    imapsUse IMAP over SSL.
    pop3Use POP3.
    smtpUse the SMTP protocol.
    smtpsUse the SMTPS protocol.
    exchangeUse Exchange Web Service (EWS) API with a hosted Exchange Server
    office365Use Exchange Web Service (EWS) API with a Office 365 Server (will ignore host).
    securityString

    Specify the encryption.
    Values are not case sensitive.

    Info
    iconfalse

    exchange and office365 protocols ignore this setting and use ssl anyway.

    noneNo encryption used.
    exchange and office365 protocol (see attribute protocol) use SSL in any case, this cannot be overridden.
    ssl

    Use SSL encryption. 

    starttls

    Use TLS encryption.
    exchange and office365 protocol (see attribute protocol) use SSL in any case, this cannot be overridden.

    Info
    iconfalse

    Make sure to pick imap, pop3, or smtp with this setting, not imaps, pop3s, or smtps.

    timeoutSecondsIntegerSpecify the number of seconds after which a request (send or receive) times out.

    any positive integer

    Default is 0, which translates to the following defaults:

    • infinite timeout for imap(s), pop3(s), and smtp(s)
    • 100 seconds for exchange
    usernamePasswordCredentialsObjectSpecify the user's credentialsa valid set of credentialseither this or microsoftOnlineCredentials must be set
    verifyHostBooleanSpecify whether for SSL connections the mail server host shall be verified or not (optional).trueVerify the mail server's SSL certificate (default, see also security).
    falseDo not verify the mail server.
    Username and Password Credentials
    usernamePasswordCredentials.username
    StringSpecify the user account on the mail server.a valid user name
    Some SMTP servers allow unauthorized sending, in these cases you may leave it as NULL.
    usernamePasswordCredentials.password
    StringSpecify the user's password.a valid password
    Some SMTP servers allow unauthorized sending, in these cases you may leave it as NULL.
    Microsoft Online Credentials (only applicable to office365 protocol)
    microsoftOnlineCredentials.clientId
    Stringclient id of your app registration


    For details on registering EWS access via OAuth please follow the steps as outlined here: https://docs.microsoft.com/en-us/exchange/client-developer/exchange-web-services/how-to-authenticate-an-ews-application-by-using-oauth

    Make sure to follow the path for "app-only authentication"

    microsoftOnlineCredentials.clientSecret
    Stringclient secret of your app registration
    microsoftOnlineCredentials.tenantId
    Stringtenant id of your microsoft online organization
    microsoftOnlineCredentials.impersonatedUser
    Stringname (email address) of the mailbox you want to impersonatea valid email address
    Provide the email address of the mailbox you want to interact with (e.g. read messages from)

    Proxy Settings (only applicable to HTTP based connections, i.e. exchange or office365 protocol)

    proxy.hostStringSpecify the host name/IP address of the proxy server.a valid host name or IP address
    proxy.portIntegerSpecify the port of the proxy server.a valid port number
    proxy.domainStringSpecify the user domain on the proxy server (optional). Some Windows-based proxy servers might require this for authentication.a valid ActiveDirectory domain name
    proxy.userStringSpecify the user account on the proxy server (optional).a valid user
    proxy.passwordStringSpecify the user's password (optional).a valid password

    ReadFlags

    Multiexcerpt
    MultiExcerptNameReadFlags
    Attribute NameTypeDescriptionAllowed ValuesComment
    maxResultCountInteger

    Specify a limit for the number of messages to be returned.

    Info
    iconfalse

    If you do not provide a filter as parameter, it makes sense to provide a meaningful limit, as the complete result set will be kept in memory.

    any positive integer

    Default is NULL, meaning no limit is imposed.


    deleteOnServerBooleanSpecify whether successfully read messages will automatically be deleted on the server.true

    Delete messages on server after successful read. Messages that cannot be read successfully will not be deleted.

    falseDo not delete messages on server (default).
    markAsReadBooleanSpecify whether successfully read messages will automatically be marked as read on the server.true

    Mark messages as read on server after successful read. Messages that cannot be read successfully will not be marked read.

    falseDo not mark messages read on server (default).
    withContentBooleanSpecify whether the message body (HTML and/or plain text) should be populated.truePopulate message body.
    falseMessage body is empty (default).
    withAttachmentsBooleanSpecify whether attachments should be retrieved.trueRetrieve attachments.
    falseDo not retrieve attachments (default).
    withEmbeddedMailsBooleanSpecify whether attachments with mime type message/rfc822 should be retrieved as embedded messages. Requires withAttachments to be true to have an effect.trueRetrieve attachments with mime type message/rfc822 as embedded messages.
    falseDo not retrieve attachments with mime type message/rfc822 as embedded messages, but as regular attachments (default).
    withHeadersBooleanSpecify whether messaging headers should be populated.truePopulate messaging headers.
    falseMessaging headers are empty (default).
    withRawContentsBooleanSpecify whether the raw message source should be retrieved.true

    Retrieve raw message source.

    Info
    iconfalse

    This is similar to "view source" on most email clients, hence the output can be huge.

    falseDo not retrieve raw message source (default).
    verifySignaturesBooleanSpecify whether for any signed messages a verification of the signature should be attempted.true

    Verify signature.

    Info
    iconfalse

    To successfullly verify PGP signatures, a public key ring must be provided with the connection parameter.

    falseDo not verify signature (default).

    ...