{"action":"created","issue":{"url":"https://api.github.com/repos/modoboa/modoboa-imap-migration/issues/17","repository_url":"https://api.github.com/repos/modoboa/modoboa-imap-migration","labels_url":"https://api.github.com/repos/modoboa/modoboa-imap-migration/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/modoboa/modoboa-imap-migration/issues/17/comments","events_url":"https://api.github.com/repos/modoboa/modoboa-imap-migration/issues/17/events","html_url":"https://github.com/modoboa/modoboa-imap-migration/issues/17","id":255587913,"number":17,"title":"Error retrieving password from modoboa","user":{"login":"InToSSH","id":6452373,"avatar_url":"https://avatars1.githubusercontent.com/u/6452373?v=4","gravatar_id":"","url":"https://api.github.com/users/InToSSH","html_url":"https://github.com/InToSSH","followers_url":"https://api.github.com/users/InToSSH/followers","following_url":"https://api.github.com/users/InToSSH/following{/other_user}","gists_url":"https://api.github.com/users/InToSSH/gists{/gist_id}","starred_url":"https://api.github.com/users/InToSSH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/InToSSH/subscriptions","organizations_url":"https://api.github.com/users/InToSSH/orgs","repos_url":"https://api.github.com/users/InToSSH/repos","events_url":"https://api.github.com/users/InToSSH/events{/privacy}","received_events_url":"https://api.github.com/users/InToSSH/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-09-06T12:35:19Z","updated_at":"2017-09-07T14:19:00Z","closed_at":null,"author_association":"NONE","body":"Hi, there was an error while offlineimap was running, so I tried to manually run the function `get_user_password`. Problem is that this function returns an error, which I am not able to fix.\r\n\r\n```\r\nFile \".offlineimap.py\", line 21, in <module>\r\n    get_user_password(\"test@example.com\");\r\n  File \".offlineimap.py\", line 17, in get_user_password\r\n    mailbox__user__username=username\r\n  File \"/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_imap_migration/models.py\", line 24, in password\r\n    return decrypt(self._password)\r\n  File \"/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/lib/cryptutils.py\", line 52, in decrypt\r\n    clear = decryptor.update(ct) + decryptor.finalize()\r\n  File \"/srv/modoboa/env/local/lib/python2.7/site-packages/cryptography/hazmat/primitives/ciphers/base.py\", line 159, in finalize\r\n    data = self._ctx.finalize()\r\n  File \"/srv/modoboa/env/local/lib/python2.7/site-packages/cryptography/hazmat/backends/openssl/ciphers.py\", line 172, in finalize\r\n    \"The length of the provided data is not a multiple of \"\r\nValueError: The length of the provided data is not a multiple of the block length.\r\n\r\n```\r\nIs there anything to do to fix it? I tried running it with and without modoboa environment.\r\nModoboa is the latest version installed using modoboa-installer.\r\nThanks"},"comment":{"url":"https://api.github.com/repos/modoboa/modoboa-imap-migration/issues/comments/327813836","html_url":"https://github.com/modoboa/modoboa-imap-migration/issues/17#issuecomment-327813836","issue_url":"https://api.github.com/repos/modoboa/modoboa-imap-migration/issues/17","id":327813836,"user":{"login":"InToSSH","id":6452373,"avatar_url":"https://avatars1.githubusercontent.com/u/6452373?v=4","gravatar_id":"","url":"https://api.github.com/users/InToSSH","html_url":"https://github.com/InToSSH","followers_url":"https://api.github.com/users/InToSSH/followers","following_url":"https://api.github.com/users/InToSSH/following{/other_user}","gists_url":"https://api.github.com/users/InToSSH/gists{/gist_id}","starred_url":"https://api.github.com/users/InToSSH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/InToSSH/subscriptions","organizations_url":"https://api.github.com/users/InToSSH/orgs","repos_url":"https://api.github.com/users/InToSSH/repos","events_url":"https://api.github.com/users/InToSSH/events{/privacy}","received_events_url":"https://api.github.com/users/InToSSH/received_events","type":"User","site_admin":false},"created_at":"2017-09-07T14:19:00Z","updated_at":"2017-09-07T14:19:00Z","author_association":"NONE","body":"So after some elaborating, I found the problem in DB. In table `modoboa_imap_migration_migration` the size for varchar field `_password` is 100 characters, which was not enough for the encrypted password to be saved. I raised this value to 255, readded the account to be migrated and now the password works fine."}}
{"actor":{"display_login":"InToSSH"}}