Author Topic: Failed to generate a key pair - Roundcube v1.2.2 on ISPConfig3  (Read 5211 times)

Offline Ta Nho Sy

  • Newbie
  • *
  • Posts: 3
Failed to generate a key pair - Roundcube v1.2.2 on ISPConfig3
« on: October 11, 2016, 01:47:17 AM »
Hello,
I setup Roundcube v1.2.2 on Ubuntu 16 x64 with ISPConfig 3.
I enabled enigma plugin for PGP but when I add key with "CREATE A NEW KEY PAIR", it generated error "Failed to generate a key pair".

Nothing happent on my website log: /var/www/mail.semail.vn/web/logs/errors or /var/www/mail.semail.vn/log/error.log

This is my config.inc.php in /var/www/mail.semail.vn/web/plugins/enigma/

<?php

$config['enigma_pgp_driver'] = 'gnupg';

$config['enigma_smime_driver'] = 'phpssl';

$config['enigma_debug'] = false;

$config['enigma_pgp_homedir'] = '/var/www/mail.semail.vn/web/plugins/enigma/home';

$config['enigma_pgp_binary'] = '/usr/bin/gpg';

$config['enigma_pgp_agent'] = '/usr/bin/gpg-agent';

$config['enigma_signatures'] = true;

$config['enigma_decryption'] = true;

$config['enigma_encryption'] = true;

$config['enigma_sign_all'] = false;

$config['enigma_encrypt_all'] = false;

$config['enigma_attach_pubkey'] = false;

$config['enigma_password_time'] = 5;

$config['enigma_keygen_server'] = false;

$config['enigma_options_lock'] = array();
This is my apache2 vhost config

<Directory .../mail.semail.vn>
                AllowOverride None
                                Require all denied
                </Directory>

<VirtualHost *:80>

                                                                        DocumentRoot .../web

                ServerName mail.semail.vn
                ServerAdmin webmaster@mail.semail.vn

                ErrorLog .../error.log

                Alias /error/ ".../web/error/"
                ErrorDocument 400 /error/400.html
                ErrorDocument 401 /error/401.html
                ErrorDocument 403 /error/403.html
                ErrorDocument 404 /error/404.html
                ErrorDocument 405 /error/405.html
                ErrorDocument 500 /error/500.html
                ErrorDocument 502 /error/502.html
                ErrorDocument 503 /error/503.html

                <IfModule mod_ssl.c>
                </IfModule>

                <Directory .../web>
                                # Clear PHP settings of this website
                                <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                                                SetHandler None
                                </FilesMatch>
                                Options +FollowSymLinks
                                AllowOverride All
                                                                Require all granted
                                                </Directory>
                <Directory .../web>
                                # Clear PHP settings of this website
                                <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                                                SetHandler None
                                </FilesMatch>
                                Options +FollowSymLinks
                                AllowOverride All
                                                                Require all granted
                                                </Directory>
                <Directory .../web>
                                # Clear PHP settings of this website
                                <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                                                SetHandler None
                                </FilesMatch>
                                Options +FollowSymLinks
                                AllowOverride All
                                                                Require all granted
                                                </Directory>




                # mod_php enabled
                AddType application/x-httpd-php .php .php3 .php4 .php5
                SetEnv TMP /var/www/clients/client5/web9/tmp
                SetEnv TMPDIR /var/www/clients/client5/web9/tmp
                SetEnv TEMP /var/www/clients/client5/web9/tmp
                php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -fwebmaster@mail.semail.vn"
                php_admin_value upload_tmp_dir /var/www/clients/client5/web9/tmp
                php_admin_value session.save_path /var/www/clients/client5/web9/tmp
        # PHPIniDir /var/www/conf/web9
                php_admin_value open_basedir /usr/bin:/usr/bin/gpg:/usr/bin/gpg-agent:.../web:.../private:.../web9/$



                # add support for apache mpm_itk
                <IfModule mpm_itk_module>
                        AssignUserId web9 client5
                </IfModule>
              <IfModule mod_dav_fs.c>
                # Do not execute PHP files in webdav directory
                        <Directory .../web9/webdav>
                                <ifModule mod_security2.c>
                                        SecRuleRemoveById 960015
                                        SecRuleRemoveById 960032
                                </ifModule>
                                <FilesMatch "\.ph(p3?|tml)$">
                                        SetHandler None
                                </FilesMatch>
                        </Directory>
                        DavLockDB .../web9/tmp/DavLock
                        # DO NOT REMOVE THE COMMENTS!
                        # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
      # WEBDAV BEGIN
                        # WEBDAV END
                </IfModule>



</VirtualHost>

Please help me.
Thanks in advanced.

Offline alec

  • Hero Member
  • *****
  • Posts: 1,363
Re: Failed to generate a key pair - Roundcube v1.2.2 on ISPConfig3
« Reply #1 on: October 11, 2016, 02:19:32 AM »
This error comes from openpgp.js library, which we use in the browser to generate a key pair. What browser and version did you use? Did you try with other browser?

Offline Ta Nho Sy

  • Newbie
  • *
  • Posts: 3
Re: Failed to generate a key pair - Roundcube v1.2.2 on ISPConfig3
« Reply #2 on: October 11, 2016, 04:50:09 AM »
Thank you for you quick reply.

I used Chrome 53.0.2785.143 m. It out error "Failed to generate a key pair"

When I used Mozilla Forefox 49.01 it give me error "Unable to import key(s)! Internal error."

Can you show me how to resovle this issue?

Offline alec

  • Hero Member
  • *****
  • Posts: 1,363
Re: Failed to generate a key pair - Roundcube v1.2.2 on ISPConfig3
« Reply #3 on: October 11, 2016, 08:56:20 AM »
These are two different issues. In case of "internal error" there must be something in the log. Search also for similar issues at https://github.com/roundcube/roundcubemail/issues

Offline Ta Nho Sy

  • Newbie
  • *
  • Posts: 3
Re: Failed to generate a key pair - Roundcube v1.2.2 on ISPConfig3
« Reply #4 on: October 11, 2016, 09:42:21 AM »
Please tell me how to enable log for Crypt_GPG or enigma?
Thanks alot.