Automate webtop or roundcube

NethServer Version: 7.7.1908
Module: EMail


This question is a bit more bespoke than the average question so cmpletely understand if it’s not possible but is it possible to automate webtop or roundcube.

To be more specific we have our own in house crm/ erp solution but the email part of it has always been a little on the poor side and now that our mail is hosted on a nethserver server we’re looking at maybe using webmail for internal group mailboxes.
However in order for this to work we need to be able to link various db fileds axtracted from the mail to the webmail so if a mail is clicked in the app we’d like to be able to open amil with a messageid of 1234 for example.
There are a few other things implicit in this, that we’d like to be able to login automatically without supplying credentials every time, and extract text from sent mails etc.
Is any of this possible with the exisitng roundcube/ webtop frameworks?
If not it’s not a problem just didn’t see the point in re0inventing the wheel. :slight_smile:


Hi James

AFAIK most CRM (by extension also ERP, TTS) have their own mail handling component.
SugarCRM / SuiteCRM as example. If it’s not your mailserver (!) you’re expected to add in a redirect in your mailserver, forwarding mails to your CRM (or whatever) so it can be handled (Like extrating times, recipients, etc) and later on maybe forwarded into a mailbox for “normal” use.

There’s usually also a module to connect to your PBX, so all calls also get logged/annotated in your CRM…

This method would work in NethServer…

A bit on the cheeky side: You could set up a vanilla SuiteCRM for the mail handling, and tap into the SuiteCRMs database tables with your CRM… :slight_smile:
SuiteCRM is AFAIK a fork of the last open SugarCRM version, enhanced…

My 2 cents

Hi Andy,

Thanks for your reply, yes that’s essentilly what we have now, all relevant data is extracted from mails and inserted into a db but the actual mail client component used is just not very good particualrly with mails with embedded images. Hence wondering if i could just point an exisitng mail client at the right mail by url or similar.

Maybe I’ll have a look at the source for suitecrm but probably we’ll just have to build a new reader based on different libraries.

As regards automating/interfacing and using Webtop mail with a CRM/ERP, I’d like to ask the @webtop_team first.

Roundcube for instance allows to show mail number 5 from logged in user with:


Available APIs:

Get message id in roundcube:

Maybe keep session in Roundcube active for a longer time…

1 Like

Accessing the email via uid is totally useless unless you have control of the session and the folder on the imap server: uids may easily change, expecially when you move an email.
Also there I find it useless to acess via an URL that requires a session to be active.
We may instead add rest apis (with their own auth and one time session) to access mail data, but this would need a better analysis of what needs to be done.

1 Like

Thanks that looks really interesting! I’ll take a look.

Hi Gabrielle,

I can give you an idea of what we do currently and therefore want to duplicate but that may not fit every case. We have a mail collection agent that checks a number of predefined addresses every 5 minutes it then checks which inbox they were sent to creates a relevant entry in a database table this entry includes a toaddess, fromaddress, ccaddress, msgid and current folder/ sub location. The current method downloads the mail as a combination of text and eml files and gives the file a name based on inbox and msgid.

When viewing that mail through the email client the email content is called back based on that filename and entry in the db. Replies are constucted in exactly the same way.
The problem with this method is that the current interface was written in a very old IDE and the email viewing component is a prorietary one that frankly just isn’t very good.

Any replacement interface would need to be able to work in a similar way to the exisitng one in that we could call back mails based on entries in our db (via some unique mail and account reference) and then we’d use the db to find other mails related by customer subject, year, account etc etc.

It was on my list of tasks to look into this and I’ve been thinking that webmail was a possible way of doing it anyway and then I could do awya with the file donload altogether. Also as we’d recently moved our internal email hosting to nethserver I was curious whether I could make use of webtop for this as it already provides a nice polished interface to display a mail through.

There are of course other ways of doing this, (like continuing to download the email as files) and then using a better embedded eml viewer for example and I’m looking into these as well but I was just exploring all possbilities at this stage.

Thanks for your help

The best thing I can see, is to rewrite your client as a new service for WebTop :slight_smile:
Here you would be able to integrate directly with the webtop mail service and have all the solution web based and into one place.
Obviously we would need to give you details on how to setup a development environment for webtop.

Hi Gabrielle,

Apologies for the delay in getting back to you I’ve been mulling over several options along with the usual botat load of other jobs :slight_smile: That sounds really interesting yes if you could give me the details on how to start looking at a plugin for webtop that’d be great.