Difference between revisions of "Sponsored Development: Zimbra Integration"

From ADempiere
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.
(System Config (new records in AD_SysConfig Table))
 
(5 intermediate revisions by the same user not shown)
Line 53: Line 53:
  
 
# Apply the dictionary migration script: this will add a field on the user window to select the outbound mail client and two system configuration values. If you are migrating from release version, use the provided script, if you are migrating from trunk, use the scripts from contribution tracker (see below).
 
# Apply the dictionary migration script: this will add a field on the user window to select the outbound mail client and two system configuration values. If you are migrating from release version, use the provided script, if you are migrating from trunk, use the scripts from contribution tracker (see below).
# Copy **zimbra-integration-desktop** package under ADEMPIERE_HOME/lib/packages (compiled or the zip contained within the binary distribution)
+
# Copy '''zimbra-integration-desktop''' package under ADEMPIERE_HOME/lib/packages (compiled or the zip contained within the binary distribution)
# Copy **zimbra-integration-zkwebui** package under ADEMPIERE_HOME/lib/zkpackages (compiled or the zip contained within the binary distribution)
+
# Copy '''zimbra-integration-zkwebui''' package under ADEMPIERE_HOME/lib/zkpackages (compiled or the zip contained within the binary distribution)
 
# Update the installation via RUN_setup, RUN_silentsetup or RUN_update.
 
# Update the installation via RUN_setup, RUN_silentsetup or RUN_update.
 +
# Packin Zimbra_Integration_Additionals.zip (2pack file)
  
 
====Zimbra====
 
====Zimbra====
Line 63: Line 64:
 
To install the new skin:
 
To install the new skin:
  
# Unzip **enhanced-skin.zip** (or copy from your local copy of an svn checkout) to** /opt/zimbra/jetty/webapps/zimbra/skins** (adjust the path if you are not using the standard installation path)
+
# Unzip '''enhanced-skin.zip''' (or copy from your local copy of an svn checkout) to '''/opt/zimbra/jetty/webapps/zimbra/skins''' (adjust the path if you are not using the standard installation path)
 
# To deploy the skin (from http://files.zimbra.com/docs/skins/Themes.html#deployingskins ):
 
# To deploy the skin (from http://files.zimbra.com/docs/skins/Themes.html#deployingskins ):
 
## cd /opt/zimbra/jetty/webapps/zimbra/skins/
 
## cd /opt/zimbra/jetty/webapps/zimbra/skins/
Line 75: Line 76:
  
 
====Known issues====
 
====Known issues====
 
+
If multiple messages are generated, it may result in more then one zimbra window to be opened, one for each message. Desktop (Swing) client opens a new browser window for each mail, web client (Zk) opens a new window and then reuses that one. It is possible to disable the opening of zimbra ui through sysconfig entry (see System Config)
If more then one signature is present, the first one will be used.
+
 
+
If multiple messages are generated, it may result in more then one zimbra window to be opened, one for each message.
+
  
 
====Configuration====
 
====Configuration====
Line 105: Line 103:
  
 
Example: http://zimbra.freetest.it:80
 
Example: http://zimbra.freetest.it:80
 +
 +
'''ZCLIENT_ADD_SIGNATURE'''
 +
 +
Enable or disable signature appending. Boolean value, default to false.
 +
 +
'''ZCLIENT_OPEN_ZIMBRAUI'''
 +
 +
Enable or disable opening of the zimbra web ui. Boolean value, default to true.
 +
 +
'''ZCLIENT_FORCEHTML'''
 +
 +
Force creation of draft mail in html format. Boolean value, default to false.
  
 
===Future===
 
===Future===

Latest revision as of 10:13, 11 January 2011

Project Team

Coordinator

??

Functional Specs

JCMac Freepath

Developers

Freepath

Trifon Trifonov

Testers

JCMac

Trifon Trifonov

Sponsors

Phase1: JCMac ??

Introduction

Adempiere "Mail Client" has some limitations:

  • Outbound only
  • Only access it from the print previewer
  • You cannot attach additional files to the message
  • Can only have 1 To recipient
  • Can only have 1 cc recipient
  • Can't have bcc recipients
  • The "history" it records not only does not include the attached document you sent, but is truncated at 2000 characters.
  • It is currently difficult to access the message history (only through the "User" window?)
  • Users will not willingly give up their favorite email client for Adempiere's current functionality

Integrating Adempiere with Zimbra will help solving some of these issues. To support future integration with other clients (Thunderbird, Outlook,...) Adempiere has been modified to support extendibility by abstracting the concept of outbound mail client: each user can now select the mail client he/she wants to use.

Requirements

  • Agile Development: Small Functions implemented in Short Phases
  • All changes included in Trunk and as patches to 3.6.0 (if approved by community)
  • Proper Published Documentation on the WIKI

Installation

Adempiere

The integration contains both the outbound mail client generalization and the zimbra integration.

  1. Apply the dictionary migration script: this will add a field on the user window to select the outbound mail client and two system configuration values. If you are migrating from release version, use the provided script, if you are migrating from trunk, use the scripts from contribution tracker (see below).
  2. Copy zimbra-integration-desktop package under ADEMPIERE_HOME/lib/packages (compiled or the zip contained within the binary distribution)
  3. Copy zimbra-integration-zkwebui package under ADEMPIERE_HOME/lib/zkpackages (compiled or the zip contained within the binary distribution)
  4. Update the installation via RUN_setup, RUN_silentsetup or RUN_update.
  5. Packin Zimbra_Integration_Additionals.zip (2pack file)

Zimbra

A feature provided with the integration is the opening of the newly created message so the user can edit it. This is not working out-of-box with Zimbra, so a new skin providing the edit feature has been created.

To install the new skin:

  1. Unzip enhanced-skin.zip (or copy from your local copy of an svn checkout) to /opt/zimbra/jetty/webapps/zimbra/skins (adjust the path if you are not using the standard installation path)
  2. To deploy the skin (from http://files.zimbra.com/docs/skins/Themes.html#deployingskins ):
    1. cd /opt/zimbra/jetty/webapps/zimbra/skins/
    2. zmskindeploy enhanced-skin/ (Note the slash after the name of the skin)

Then each user account has to be configured to use the enhanced-skin. To simplify this it's possibile to set it as the default skin, and eventually disable all others.

Usage

When a new mail, which requires user interaction (send a report by mail, send the errorlogs, or create a support request mail), a draft mail is created in zimbra. Then the mail is opened so the user can modify and eventually send it. If the mail is not send, it remains in the draft folder. If a signature is defined in zimbra, it will be appended to the generated message.

Known issues

If multiple messages are generated, it may result in more then one zimbra window to be opened, one for each message. Desktop (Swing) client opens a new browser window for each mail, web client (Zk) opens a new window and then reuses that one. It is possible to disable the opening of zimbra ui through sysconfig entry (see System Config)

Configuration

User

To use Zimbra as a client, select 'Zimbra' as the OutboundMailClient on the User window.

If Zimbra is choosen, the Email User ID and Email Pwd will be used to authenticate on Zimbra (note: the full account name, domain included, has to be used)

System Config (new records in AD_SysConfig Table)

OUTBOUND_MAIL_DEFAULT_CLIENT

Default client for new users, as of now two values are available:

  • for zimbra client, use com.f3p.adempiere.mail.zimbra.ZimbraOutboundClient
  • for standard adempiere client, use com.f3p.adempiere.mail.StandardOutboundClient

Note: all available values can be seen on OutboundEmailClients reference.

ZCLIENT_BASE_URL

Base url Zimbra web ui, used to build the url to connect to zimbra services, and to build the url to open the created message, has to be in the form. If https is used, be sure to have installed the server certificates in the local vm, or to use well-known authorities signed certificated.

Example: http://zimbra.freetest.it:80

ZCLIENT_ADD_SIGNATURE

Enable or disable signature appending. Boolean value, default to false.

ZCLIENT_OPEN_ZIMBRAUI

Enable or disable opening of the zimbra web ui. Boolean value, default to true.

ZCLIENT_FORCEHTML

Force creation of draft mail in html format. Boolean value, default to false.

Future

Freepath addendum to phase 1

Add to User Window the following fields:

  • Tag Source, comma separated values of 'tag values', expressed a Table.Field . Example: C_BPartner.Name

This will improve the search for sent mails by adding relevant tags in a configurable way.

Add to AD_UserMail the following fields:

  • AD_Table_ID, of the table used in current tab
  • Record_ID, of the record used in current tab

This will enable to easily open the table and record for which was generated the mail, in a similar way as request and workflow does.

Functionality

Phase 1.1: Outbound Email Client w/Email Address

  • If auto Archiving is enabled, the system should still archive
  • Clicking on the Send Mail button in a Print Preview of a document or Report does the following:
  • Opens a select contact screen (Business Partner Info Form from View > Business Partner Info Menu would be perfect)
  • if the Send Mail comes from a Print Preview of a document with a Business Partner & Contact on it (Proposal, Order, PO, invoice, etc) Populates the Business Partner Name and Contact Name in the search fields (with the % wildcard character at the beginning)
  • The user would double click the contact or Highlight the contact and Click the Green Checkbox
  • The focus would switch to an open Zimbra session, change to the compose Email Screen with the PDF Report attached and the Contact's Email address Populated in the To field
  • If auto Archiving is enabled, the system should still archive
  • The action should append a standard message in the AD_UserMail with the external mail flag column=Y. Mail Text could say "External Client called"

Freepath implementation notes, phase 1.1

  • Clicking on the send mail button will open a search window. From that window, it will be possible to filter relevant contacts, and select them for the To,CC,or Bcc fields. Based on context information, some filter may have a pre-populated value. On this window will also be possible to select a mail template (not mandatory) to pre-generate the mail body and subject. Based on the the current context, all possible tag sources will be resolved to a string value, and used to pre-populate a modifiable "tag" text field.
  • When the ok button is pressed, a new draft message will be created in Zimbra, having To, Cc,Bcc, Subject, Body, attachments and tags. The draft message will be created with the current adempiere user mail address (this require that adempiere and zimbra password are equals, or it will not be possible to authenticate the user and create the message).
  • For each selected AD_User, a new record in AD_UserMail will be created.The mail body will be filled with a search string suitable to be used in zimbra to find the sent mail, in the form: #In-Reply-To:<14069108.7.1282117768839.JavaMail.root@intranet.freepath.it>. Pasting such text, in the search field of the zimbra mail interface, will result in the sent mail being found (will not search for the draft mail, but for the sent mail).
  • A browser will be launched to open the newly created message. If the user is not logged in, zimbra will ask for authentication, then the draft will be opened. If the logged user is different from the adempiere user, a message stating the draft cannot be found will be issued.
  • If the mail is not sent, it will be kept as a draft until sent or manually deleted.
  • If the mail is sent, the tags applied to the draft message will be propagated to the mail stored in the "sent mail" folder.

To implement this workflow Zimbra has to be modified to support the ability to open a draft message in edit, and to replicate the tags from the draft message to the sent message. It has been tested with Zimbra 6, previous zimbra versions could miss some needed api. On the adempiere side, the send report functionality will be reworked to support a driver-like architecture, enabling additionals future integrations.

Phase 2+: Ideas

  • Zimlets in Zimbra to:
    • Add a contact to Existing BP
    • Add a contact as a New BP
    • Add a contact to New Location at existing BP
    • Add a Request linked to the BP and Contact
    • Import the Header & body of an email as an Update to an existing Request
    • Address Book export from Adempiere to Zimbra - LDAP?

Freepath addendum to phase 2 ideas

In phase 1 sent mails will be stored in sender maibox and will can be viewed only by the creator. To allow adempiere to keep a copy of the sent mail, the adempiere server could implement a milter (a protocol implemented by sendmail and postfix to allow filtering on mail, via tcp or socket connection), and postfix configured to send the mails to such milter. By adding one or more headers to the generated draft mail, it will be possible to import such mail into a newly created table, and match that mail with the ad_usermail record. Such mail archiving can be linked through the Table_ID/Record_ID couple to the 'source' record. This integration can be expanded using the mail header to create a 'conversation' linking the archived mails. Such mail can be automatically or manually associated to Business partner, Campain, Projects and so on.

Link to Zimbra-Salesforce integration:[1]

Links

Contribution with All Application Dictionary changes: ADempiere Zimbra intergation

Original Idea on SF Forum: [2]

Another wiki page about the integration: [[3]]

SVN Location of contributions: contribution

Prebuilt binaries can be found here


Comments, ideas, Issues

  • Different user logged into the Zimbra Session than Adempiere > From address??
  • If a Zimbra session is not Open, what should happen??
  • "I think is better to have the corporative e-mails centralized and controlled from adempiere."
    • Preference would allow this. Zimbra and other collaboration software can be configured to keep copies of sent emails for audit purposes
  • "... contacts should be in adempiere otherwise you loose control of your enterprise contacts. Also, you loose the logging of the business partner contacts in email and the singular view of the relationship"
    • Again, user preference allows this to be a business policy decision. In terms of logging, above comment applies
  • Where do we Store the preference: Preferences vs. Configurator vs. User Window
    • Preferences > No: Insecure and uncontrolled
    • Configurator = No: system wide