The Plugin allows the user to configure one or more accounts to be polled via fetchmail inside of Kopano WebApp.
It's recommended to read the fetchmail documentation (http://www.fetchmail.info/fetchmail-man.html or man fetchmail
) to understand how fetchmail delivers emails to the end user.
With this plugin the daemon retrieves and distributes the emails via a MTA on the host machine.
It unifies your mailbox. Instead of checking multiple different email addresses, they can all be retrieved and delivered to your kopano mailbox. Also if your MTA is configured to check for Spam (spamassassin) or Viruses (clamav), you can be sure that all your email is checked before delivery.
Fetchmail Plugin Settings: Create a new Account: Account Status in Plugin Settings and Log Message:
- fetchmail
- libproc-daemon-perl or Proc::Daemon from cpan
- MTA on the host machine (postfix)
- Database to store account informations (At the moment only 'mysql' is supported)
- Install the Requirements.
- Download and unzip the fetchmail-1.0.zip to the 'plugins' folder in your kopano-webapp installation (default:
/usr/share/kopano-webapp/plugins/
).
- Copy the
example.config.php
in the<kopano-webapp>/plugins/fetchmail
folder toconfig.php
and customize the options. - Create a user to run the fetchmail daemon (default: fetchmail/nogroup) with a home directory.
- If you used your distros package manger to install
fetchmail
a user (fetchmail/nogroup) should have been created. - Manual:
useradd -d /var/lib/fetchmail -g nogroup -m -N -s /bin/false fetchmail
- Manual: Set the rights for the home directory to 600.
- If you used your distros package manger to install
- Edit the
<kopano-webapp>/plugins/fetchmail/php/daemon/kopano_fetchmail.pl
if you used non-standard options. - Start the daemon with
perl kopano_fetchmail.pl --start
and create a startup script. (seekopano_fetchmail.service.example
for a systemd config).
- Go to settings section.
- Go to plugins tab.
- Enable the fetchmail plugin and reload webapp.
- You should find a new entry in the settings section.
- Go to settings section.
- Go to plugins tab.
- Disable the fetchmail plugin and reload webapp.
- Database with fetchmail account informations.
- Home directory of the
fetchmail
user (default /var/lib/fetchmail) where a list of already fetched emails (POP3) is saved.
If you need to change the Key used to encrypt the Passwords stored in the Database for any reason (Security Breach, etc), a function "changeAESKey" is implemented in the class PluginFetchmailModule. To call this function, you have to create a simple PHP script and execute it.
An example, of how to call this function:
<?php
$oldkey="changethis!";
$newkey="changethis!";
define('BASE_PATH', "/usr/share/kopano-webapp/");
define('PATH_PLUGIN_DIR' , "plugins" );
require_once (BASE_PATH . PATH_PLUGIN_DIR . "/fetchmail/config.php");
require_once (BASE_PATH . PATH_PLUGIN_DIR . "/fetchmail/php/class.pluginfetchmailmodule.php");
$fetchmailModule = new PluginFetchmailModule(null, null);
$fetchmailModule->changeAESKey($oldkey, $newkey);
?>
Save the above code to (for example): /usr/share/kopano-webapp/plugins/fetchmail/changeAESKey.php
(Modify the parameters $oldkey and $newkey).
Afterwards call it via CLI: php /usr/share/kopano-webapp/plugins/fetchmail/changeAESKey.php
Remember to change the parameter PLUGIN_FETCHMAIL_PASSWORDS_AES_KEY
in /usr/share/kopano-webapp/plugins/fetchmail/config.php
!
- Stop the daemon with
perl kopano_fetchmail.pl --stop
- Remove the
<kopano-webapp>/plugins/fetchmail
folder. - Drop the table from your Database.
- Delete the
fetchmail
user and home directory.
Feedback and Bug Reports are always welcome!
Andreas Brodowski (aka dw2412), haggybear
The Fetchmail Plugin is available under the GNU AGPLv3 license. See LICENSE file.