[New Plugin] Configure and use fetchmail from the WebApp

No problem, happens to the best of us ;-)

now indeed it comes up fine. Thanks a lot!

Question @Kopano

Do you think it would be worth having a common area, sourcecode, packages or whatever where plugins like this are available for all users?

I.e. a central repository where people can go in and search which plugins are available in addition to the official Kopano ones?

@mcostan yes, we have that already on our agenda. As a matter of fact I just added some more links and made it public. You can find it at https://stash.z-hub.io/projects/COM/repos/projects-and-resources/browse

@olia would you be so kind to run through the explained workflow in https://stash.z-hub.io/projects/COM/repos/projects-and-resources/browse/CONTRIBUTING.md and add your project? I am interested if the instructions are clear enough or need to be clarified/simplified. Thanks!

@fbartels
I’ve read the document, and followed it (waiting to hear back for write access to the repo).
Also the instructions are clear enough.

@olia thanks, I just replied to your request.

Hi,
I am not a very skilled Linux user, but i come as far as getting the Fetchmail plugin show up as a plugin. But as soon as i go to the Options in Kopano, i get a Http 500 internal server error as long as the plugin is enabled. So i must be doing something wrong. I’ll try to describe what i have done:

I use a Univention debian distro in a virtual machine. I installed Kopano-core & Kopano-webapp & got that working, including sending mail via a smart relay host.

Installed Requierements ( i think)

  • fetchmail: dpkg -l | grep fetchmail shows it as installed
  • libproc-daemon-perl: installed via apt-get
  • MTA on the host machine (postfix): is working, i can send mail
  • Database to store account informations (At the moment only ‘mysql’ is supported): i did not take specific action on this, i presume Kopano-core install took care of this?

I was able to download, install & activate the plugin; it shows up in the options in kopano-webapp.

I copied the example.config.php in the <kopano-webapp>/plugins/fetchmail folder to config.php ** in the same folder ** and customized the ‘changethis!’ part in define(‘PLUGIN_FETCHMAIL_PASSWORDS_AES_KEY’, “changethis!”)

i did not create a user to run the fetchmail daemon (i found the (default: fetchmail/nogroup) )
i did not Manual: Set the rights for the home directory to 600.
i did not Edit the <kopano-webapp>/plugins/fetchmail/php/daemon/kopano_fetchmail.pl if you used non-standard options.

i Started the daemon with perl kopano_fetchmail.pl --start and no errors where shown.

I still have to create a startup script. (see kopano_fetchmail.service.example for a systemd config).

I did not make any symlinks as previously posted?

Thanks in advance

@pwhooftman said in [New Plugin] Configure and use fetchmail from the WebApp:

Hi,
I am not a very skilled Linux user, but i come as far as getting the Fetchmail plugin show up as a plugin. But as soon as i go to the Options in Kopano, i get a Http 500 internal server error as long as the plugin is enabled. So i must be doing something wrong. I’ll try to describe what i have done:

mmm, it seems i have to do something in the database department after all:
[Mon May 07 11:17:14.629544 2018] [:error] [pid 2652] [client 10.0.0.225:3311] PHP Fatal error: Uncaught Error: Class ’

mysqli’ not found in /usr/share/kopano-webapp/plugins/fetchmail/php/drivers/class.MysqlDatabaseDriver.php:39\nStack trac

e:\n#0 /usr/share/kopano-webapp/plugins/fetchmail/php/class.pluginfetchmailmodule.php(167): MysqlDatabaseDriver->__const

ruct(‘localhost’, ‘3306’, ‘kopano’, ‘kopano_fetchmai…’, ‘kopano_fetchmai…’, ‘password’, ‘********’)\n#1 /usr/shar

e/kopano-webapp/plugins/fetchmail/php/class.pluginfetchmailmodule.php(180): PluginFetchmailModule->getDatabaseConnection

()\n#2 /usr/share/kopano-webapp/plugins/fetchmail/php/class.pluginfetchmailmodule.php(86): PluginFetchmailModule->getLis

tOfFetchmailAccounts()\n#3 /usr/share/kopano-webapp/server/includes/core/class.jsonrequest.php(57): PluginFetchmailModul

e->execute()\n#4 /usr/share/kopano-webapp/kopano.php(137): JSONRequest->execute(’{“zarafa”:{"plu…’)\n#5 {main}\n thro

wn in /usr/share/kopano-webapp/plugins/fetchmail/php/drivers/class.MysqlDatabaseDriver.php on line 39, referer: http://1

0.0.0.168/webapp/

@pwhooftman
Update: i reinstalled phpmyadmin, and now the error states: Cannot connect to database. So, progress :-)

But if i look in phpmyadmin no fetchmail user or table(s) for the plugin are present. Do i have to set up the mysql for the plugin myself (user, tables, etc) , or is that something the daemon should take care of?

Update: got it working

  1. Fetchmail was not installed yet :-|
  2. set mysql root users password
  3. changed mysql user & password to root in config.php

Do you think it would be possible to have a plugin for the the other direction so that it’s possible to set for each User Account several smtp Server in the same way as you made it possible for the fetchmail function.

Best Carmen

I have install the Plugin.
In the Webapp is all running fine.
But the kopano_fetchmail.pl make Errors

Odd number of elements in hash assignment at kopano_fetchmail.pl line 142, <$fetchmail_api> line 1.
Use of uninitialized value $account{“entryid”} in concatenation (.) or string at kopano_fetchmail.pl line 161, <$fetchmail_api> line 1.
Use of uninitialized value $account{“entryid”} in concatenation (.) or string at kopano_fetchmail.pl line 168, <$fetchmail_api> line 1.
Use of uninitialized value $account{“src_server”} in concatenation (.) or string at kopano_fetchmail.pl line 170, <$fetchmail_api> line 1.
Use of uninitialized value in concatenation (.) or string at kopano_fetchmail.pl line 170, <$fetchmail_api> line 1.
Use of uninitialized value in concatenation (.) or string at kopano_fetchmail.pl line 170, <$fetchmail_api> line 1.

Can Anyone help me???