Sponsored Development: Zimbra Integration

From ADempiere ERP Wiki

Revision as of 12:31, 25 September 2010 by Trifonnt (Talk | contribs)
Jump to: navigation, search


Project Team



Functional Specs






Trifon Trifonov



Trifon Trifonov


Phase1: JCMac ??


Adempiere "Mail client" 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


  • Agile Development: Small Functions implemented in Short Phases
  • All changes included in Trunk and as patches to 3.4.2s
  • Proper Published Documentation on the WIKI

Phase 1: Outbound Email Client

  • Add option in User Window (Underneath Notice Type): "Outbound Mail Client"

Dropdown offers 2 options: Internal (Default), and Zimbra

  • Add external client flag Column in AD_UserMail

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.

Add to AD_OrgInfo, the following fields:

  • ZimbraUrl, with the base url used to connect to zimbra


Phase 1: Outbound Email Client

  • Clicking on the Send Mail button in the Print Preview of a document or Report shifts the focus to an open Zimbra session on the Send Email Screen with the PDF Report attached.
  • 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"

Phase 1.1: Outbound Email Client w/Email Address

  • 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]


Contribution with All Application Dictionary changes: ADempiere Zimbra intergation

Original Idea on SF Forum: [2]

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

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
Personal tools