Advanced Paste in Zimbra9

Advanced Paste

Advanced Paste for composer handles copy/paste from Word, Excel, PowerPoint, PDF, Websites, Paint, etc. When installed, it will be available for Mail and Signature Composers. The Advanced Paste service automatically cleans up content from Microsoft Word, Microsoft Excel, and HTML sources to ensure clean and compliant content. When pasting the data in the composer, users get an option to "Keep formatting", which automatically activates the service when clicked. For basic usage, users don't need to take any action. Simply copy and paste content normally using keyboard shortcuts, or the browser's "Paste" menu item.

Installation of Advanced Paste

Zimbra Advanced Paste depends on Micosoft packages dotnet-sdk and aspnetcore-runtime. Since Microsoft does not provide these dependent packages for Ubuntu 14.04, RHEL 6 and CentOS 6, the Advanced Paste service cannot be used on these Operating Systems.

Installing Prerequisites

Configure Microsoft's package repository and key to install dependent packages dotnet-sdk and aspnetcore-runtime.

For Ubuntu 16.04 and 18.04

  • As root, execute the command to download the key and add into the apt trust store:
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /tmp/microsoft.asc.gpg
mv /tmp/microsoft.asc.gpg /etc/apt/trusted.gpg.d/
  • Replace <version> with 16.04 for Ubuntu 16.04 and 18.04 for Ubuntu 18.04 in the below url:
wget -q https://packages.microsoft.com/config/ubuntu/<version>/prod.list -O /tmp/prod.list
mv /tmp/prod.list /etc/apt/sources.list.d/microsoft-prod.list
chown root:root /etc/apt/sources.list.d/microsoft-prod.list
apt update
  • If you see any error while apt update, run command:
apt -o APT::Sandbox::User=root update

For RHEL 7 and RHEL 8

  • Replace the <version> with exact 7 or 8 in the below url:
wget -q https://packages.microsoft.com/config/rhel/<version>/prod.repo -O /tmp/prod.repo
mv /tmp/prod.repo /etc/yum.repos.d/microsoft-prod.repo
chown root:root /etc/yum.repos.d/microsoft-prod.repo
yum update

For CentOS 7 and CentOS 8

  • Replace the <version> with 7 or 8 in the below url:
wget -q https://packages.microsoft.com/config/centos/<version>/prod.repo -O /tmp/prod.repo
mv /tmp/prod.repo /etc/yum.repos.d/microsoft-prod.repo
chown root:root /etc/yum.repos.d/microsoft-prod.repo
yum update

Installation of Advanced Paste package

Ubuntu 16.04 and 18.04

  • As root, install the package:
apt install zimbra-pasteitcleaned
  • Restart mailbox service as zimbra user:
su - zimbra
zmmailboxdctl restart

RHEL/CentOS 7 and 8

  • As root, install the package:
yum install zimbra-pasteitcleaned
  • Restart mailbox service as zimbra user:
su - zimbra
zmmailboxdctl restart

Verifying Advanced Paste in Modern UI

Server side verification

After successful installation, you could find:

  • Advanced Paste installation directory at: /opt/zimbra/common/lib/pasteitcleaned
  • Extension will be deployed at: /opt/zimbra/lib/ext/pasteitcleaned/
  • Advanced Paste log file updated at: /opt/zimbra/log/pasteitcleaned.log

You should see a similar success message in the log file:

Hosting environment: Production
Content root path: /opt/zimbra
Now listening on: http://0.0.0.0:5000
  • A dotnet service running. As root, execute the command
ps -ef | grep dotnet

You should see a pasteitcleaned process running:

root@apps-development:~# ps -ef | grep dotnet
root      1493  7971  0 09:00 pts/2    00:00:00 grep --color=auto dotnet
zimbra   11408     1  0 Jan07 ?        00:11:26 /usr/bin/dotnet /opt/zimbra/common/lib/pasteitcleaned/PasteItCleaned.Plugin.Standalone.dll --server.urls http://0.0.0.0:5000

Modern UI Verification

Login to Modern UI and copy/paste a well formatted table from any excel document in the Composer. When pasting, Composer will give you an option to "Keep formatting" or "Discard". Click on "Keep formatting" and the formatting of the copied table is retained.

Example:

AdvancedPaste Enabled

Troubleshooting

Logs

The errors/logs for Advanced Paste can be found at /opt/zimbra/log/pasteitcleaned.log.

Formatting not maintained in the Composer

  • If the formatting is not maintained in the Composer for the copied data (as displayed in below image), then perform following steps:

AdvancedPaste Disabled

  • Check the browser console for any errors. Open the Composer and navigate to Developer Console -> Network. Copy the well formatted table and paste in the composer. You might see a similar response (as displayed in below image):

AdvancedPaste Error

  • Check if the pasteitcleaned process is running:
  • As root, execute the command
ps -ef | grep dotnet

In case the pasteitcleaned process is not running, it will not return any process id for it:

root@apps-development:~# ps -ef | grep dotnet
root      1493  7971  0 09:00 pts/2    00:00:00 grep --color=auto dotnet
  • Start the process manually. As zimbra user, execute the command:
su - zimbra
/usr/bin/dotnet /opt/zimbra/common/lib/pasteitcleaned/PasteItCleaned.Plugin.Standalone.dll --server.urls http://0.0.0.0:5000 > /opt/zimbra/log/pasteitcleaned.log 2>&1 &
  • Verify the process is started successfully. As root, execute the command:
ps -ef | grep dotnet

You should see a pasteitcleaned process running:

root@apps-development:~# ps -ef | grep dotnet
root      1493  7971  0 09:00 pts/2    00:00:00 grep --color=auto dotnet
zimbra   11408     1  0 Jan07 ?        00:11:26 /usr/bin/dotnet /opt/zimbra/common/lib/pasteitcleaned/PasteItCleaned.Plugin.Standalone.dll --server.urls http://0.0.0.0:5000
Jump to: navigation, search