its older but here is my how to for Ubuntu 18.04
Install the Requirements.
apt install fetchmail libproc-daemon-perl
by installing fetchmail you see the following strings like this:
Adding system user fetchmail' (UID 119) ... Adding new user fetchmail’ (UID 119) with group nogroup' ... Creating home directory /var/lib/fetchmail’ …
Download and unzip the fetchmail-1.0.zip to the ‘plugins’ folder in your kopano-webapp installation (default:
/usr/share/kopano-webapp/plugins/
cd /tmp
wget https://github.com/olia-dev/kopano-webapp-fetchmail/archive/master.zip
unzip master.zip -d /tmp/fetchmail
cd /tmp/fetchmail/kopano-webapp-fetchmail-master/builds
unzip fetchmail-1.0.2.zip -d /usr/share/kopano-webapp/plugins/
cd /usr/share/kopano-webapp/plugins/fetchmail
mv example.config.php /etc/kopano/webapp/config-fetchmail.php
ln -s /etc/kopano/webapp/config-fetchmail.php config.php
Create Fetchmail User & Database in MYSQL
sudo mysql -u root -p
CREATE DATABASE kopano_fetchmail DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE USER 'kopano_fetchmail'@'localhost' IDENTIFIED BY 'SeCrEtPasSwOrD';
GRANT ALL PRIVILEGES ON kopano_fetchmail.* TO 'kopano_fetchmail'@'localhost';
FLUSH PRIVILEGES;
quit
Edit your settings:
nano /etc/kopano/webapp/config-fetchmail.php
Edit if you used non-standard options (none in my case)
nano /php/daemon/kopano_fetchmail.pl
Start the daemon with
perl /usr/share/kopano-webapp/plugins/fetchmail/php/daemon/kopano_fetchmail.pl --start
Create System startup script. (see kopano_fetchmail.service.example for a systemd config).
use this example to /etc/systemd/system/
mv /usr/share/kopano-webapp/plugins/fetchmail/kopano_fetchmail.service.example /usr/share/kopano-webapp/plugins/fetchmail/kopano_fetchmail.service
ln -s /usr/share/kopano-webapp/plugins/fetchmail/kopano_fetchmail.service /etc/systemd/system/kopano_fetchmail.service
The system service script shows at following
nano /etc/systemd/system/kopano_fetchmail.service```
[Unit]
Description=Fetchmail daemon for kopano-webapp plugin 'fetchmail'
After=mysql.service kopano-server.service
[Service]
Type=forking
Environment=LC_ALL=C LANG=C
PIDFile=/var/lib/fetchmail/kopano_fetchmail_daemon.pid
ExecStart=/usr/bin/perl /usr/share/kopano-webapp/plugins/fetchmail/php/daemon/kopano_fetchmail.pl --start
ExecStop=/usr/bin/perl /usr/share/kopano-webapp/plugins/fetchmail/php/daemon/kopano_fetchmail.pl --stop
TimeoutStopSec=60
[Install]
WantedBy=multi-user.target
Stop the daemon
perl /usr/share/kopano-webapp/plugins/fetchmail/php/daemon/kopano_fetchmail.pl --stop
Enable fail2rest service to run at startup
systemctl enable kopano_fetchmail.service
Run the following systemd command to start the fail2rest service
systemctl start kopano_fetchmail.service
Verify that the fail2rest service it is active and running
systemctl status kopano_fetchmail.service