Email Watch
- Import emails from a specific email account
- Filter spam or unwanted messages out
- Import emails from one email account with multiple aliases
- Map email fields to document indexes
- Exclude signature images and other attachments from being imported.
- Import emails from Office365 OAuth - Delegated Access
- Import emails from Office365 OAuth - Application Access
- Troubleshooting email imports:
- Polling mail servers with a self-signed certificate
- Issues polling mail servers with TLS
- Issues with Remote host closed connection during handshake
- Polling email servers via a Proxy
Import emails from a specific email account
- Add a new Import Management -> Email Account.
- Add a new Import Management -> Email Import.
- Name – Specify the name of the import - this will be recorded under the history tab.
- Select the Node to import the document into.
- Select the Account created in step 1.
- Select an Attachment Policy
* _Body Only_ - Import the .html or .txt email body only. * _Attachments Only_ – Import attachments only e.g .pdf, .word. * _Source Only_ - Import the email as a .eml suitable for search an preview. * _Document Archive_ – Used in conjunction with the autoExport rule. * _Threads_ – Update the original email with any replies – The Document.response event can be used to trigger notifications / workflows etc.
- Click Add.
Filter spam or unwanted messages out
- Create one or more Email Imports with a Rule Order of 1.
- Specify unwanted terms under the Field Tab e.g.
- Create all other Email Imports with a Rule Order larger than 1.
Import emails from one email account with multiple aliases
- Create one email account.
- Create one or more email import and specify the alias under the Rules -> To and Rules -> CC fields.
- Select the email account created under step 1.
Map email fields to document indexes
- Select the node to import the emails to.
- Map the fields under the Fields tab.
Exclude signature images and other attachments from being imported.
- Under the rules tab, specify a semi-colon separated list of unwanted extensions under Attachment Exclusion Filter. e.g. .gif;.jpeg;*.png
OR
- Specify only the attachments you want to import under Attachment Inclusion Filter. .pdf;.doc*
Update the original email when a reply is received (threading)
Import emails from Office365 OAuth - Delegated Access
To set up:
URL = https://login.microsoftonline.com/
Add username
Add password
Add the tenantId in Advanced
Add the clientId in Advanced
Add the resource in Advanced
e.g. in Advanced:
tenantId=12345
clientId=abcde
resource=EWS.AccessAsUser.All
Import emails from Office365 OAuth - Application Access
To set up:
URL = https://login.microsoftonline.com/
Add User Email as username
Add Client Secret as password
Add the tenantId
in Advanced
Add the clientId
in Advanced
Add the resource
in Advanced
Add the secret=true
in Advance
e.g. in Advanced:
tenantId=12345
clientId=abcde
resource=https://outlook.office.com/.default
secret=true
Troubleshooting email imports:
- Ensure that standard email clients can connect over the POP and IMAP Protocols.
- Check Services -> Properties -> Imports -> Debug POP/IMAP to record the conversion with the POP/IMAP server to if it returns any error messages.
Polling mail servers with a self-signed certificate
Should you not be able to connect to a mailbox, with the below error in the logfile, the issue is due to a certificate not in the Java cacerts file:
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
- Obtain a copy of the CER file for the mailserver and save on disk to the PaperTrail server (mailserver.cer in this example)
- Run CMD prompt as administrator / Linux shell as root
- Navigate to the Java bin directory:
- Windows:
C:\Program Files\Java\jre1.8.0_221\bin
- Linux:
/usr/lib/jvm/java-8-oracle/jre/bin
- Windows:
- Import the certificate to the Java Security cacerts file
- Windows:
keytool -importcert -trustcacerts -file "C:\Downloads\mailserver.cer" -keystore "C:\Program Files\Java\jre1.8.0_221\lib\security\cacerts" -alias "mailserver"
- Linux:
keytool -importcert -trustcacerts -file /root/mailserver.cer -keystore /usr/lib/jvm/java-8-oracle/jre/lib/security/cacerts -alias mailserver
- Windows:
- Set the password to
changeit
and trust the certificate - Restart PaperTrail
- If there is still an issue, try adding this line to run.sh / service_x64.vmoptions and restart PaperTrail
- Windows
-Djavax.net.ssl.trustStore=C:\Program Files\Java\jre1.8.0_221\lib\security\cacerts
- Linux
-Djavax.net.ssl.trustStore=/usr/lib/jvm/java-8-oracle/jre/lib/security/cacerts
- Windows
How to obtain the self-signed certificate file
- OpenSSL command is available on Linux or Install OpenSSL for Windows (releases under the OpenSSL node)
- On Linux systems, openssl should be available to run in the CLI
- Windows only: Open CMD prompt as Administrator, Navigate to C:\Program Files\OpenSSL-Win64\bin
echo | openssl s_client -connect mymailserver.com:port 2>&1 > mailserver.cer
- Replace
mymailserver.com:port
with the relevant details, e.g.mail.server.co.za:993
- Edit mailserver.cer and add BEGIN CERTIFICATE AND END CERTIFICATE lines around the certificate as below
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
Issues polling mail servers with TLS
Should you not be able to connect to a mailbox, with the below error in the logfile, the issue is due to a Java update which disables legacy TLS protocols:
Failed to connect to: mailbox@outlook.office365.com:993 javax.mail.MessagingException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate); nested exception is: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
It appears that a release of Java around April 2021 disables TLSv1 and TLSv1.1.
The below lines in the java.security file (\Java\jre1.8.0_291\lib\security) should be commented out and PaperTrail restarted:
#jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA, \
# DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, \
# include jdk.disabled.namedCurves
Issues with Remote host closed connection during handshake
Should you not be able to connect to a mailbox, with the below error in the logfile, the issue is due to an outdated mail.jar file in the PaperTrail libs directory
Failed to connect to: mailbox@mail.com@mailserver:993 javax.mail.MessagingException: Remote host closed connection during handshake;
The offending mail.jar is v1.4.4, with the updated jar being v1.6.2
- Remove
mail.jar
from the libs directory - Obtain v1.6.2 of
javax.mail.jar
, rename tomail.jar
and place in the libs directory (https://javaee.github.io/javamail/#Download_JavaMail_Release) - Restart PaperTrail
See also PPT-11861
Polling email servers via a Proxy
Should PaperTrail be forced to use a proxy server for outside connectivity, PaperTrail 889 b2479 onward is required with the below settings:
mail.ewsstore.proxy.host=myproxyhost
(proxy host - required)
mail.ewsstore.proxy.port=80
(proxy port - required)
If the proxy requires authentication, the following settings are required:
mail.ewsstore.proxy.user=myuser
mail.ewsstore.proxy.password=mypassword
Note that these proxy settings are specific to email imports and differ from the general proxy settings needed to reach, for example, SMS gateways