Code Monkey home page Code Monkey logo

modoboa-imap-migration's Introduction

Modoboa (website)

workflow codecov Latest version on Pypi

Modoboa is a mail hosting and management platform including a modern and simplified Web User Interface. It provides useful components such as an administration panel and webmail.

Modoboa integrates with well known software such as Postfix or Dovecot. A SQL database (MySQL, PostgreSQL or SQLite) is used as a central point of communication between all components.

Modoboa is developed with modularity in mind, expanding it is really easy. Actually, all current features are extensions.

It is written in Python 3 and uses the Django, jQuery and Bootstrap frameworks.

Main features

Installation

The easiest way to install modoboa is to use the official installer. More information is available in the documentation.

Documentation

A detailed documentation will help you to install, use or extend Modoboa.

Demo Installation

If you want to try out Modoboa, check out our demo installation.

Getting help

Modoboa is a free software and is totally open source BUT you can hire the team if you need professional services. More information here: https://modoboa.org/en/professional-services/.

Contracting a support plan if a good way to ensure your installation stays available and up-to-date and it will help the project to be sustainable :)

Community

If you have any questions, you can get help through the following platforms:

  • Discord
  • Github: open an issue if you found a bug

External code

The following external libraries are provided with Modoboa:

modoboa-imap-migration's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar dugite-code avatar kryskool avatar nomad2k avatar stooj avatar tonioo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

modoboa-imap-migration's Issues

Setup fails with "No module named req"

Here is the output I get when I try to run "python setup.py install":

root@host:/home/user/modoboa-imap-migration# python setup.py install
Traceback (most recent call last):
File "setup.py", line 15, in
from pip.req import parse_requirements
ImportError: No module named req

From what I can tell from reading similar reports online, this is caused by using the pip.req module (as it was meant to be an internal module and its use was discouraged) being moved as of pip version 10.

I hope this information is useful to you; While I do know a little python, I have tried every fix I can think of (even using an alternate "parse_requirements" function as seen here (https://stackoverflow.com/questions/25192794/no-module-named-pip-req) but all I've managed to do is make things worse!

Logging in fails: value too long for type character varying(100)

Trying to set this up, but I may be missing something as my modoboa_imap_migration_migration table is empty and generate_offlineimap_config generates an empty config (no accounts).

When I try to log in as a user (doesn't exist in the new server, existed on the old imap server), I get the following:

Request Method:	POST
Request URL:	https://mail.example.com/accounts/login/
Django Version:	1.10.8
Exception Type:	DataError
Exception Value:	
value too long for type character varying(100)
Exception Location:	/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/backends/utils.py in execute, line 64
Python Executable:	/usr/bin/uwsgi-core
Python Version:	2.7.12
Python Path:	
['.',
 '',
 '/srv/modoboa/env/lib/python2.7',
 '/srv/modoboa/env/lib/python2.7/plat-x86_64-linux-gnu',
 '/srv/modoboa/env/lib/python2.7/lib-tk',
 '/srv/modoboa/env/lib/python2.7/lib-old',
 '/srv/modoboa/env/lib/python2.7/lib-dynload',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-x86_64-linux-gnu',
 '/usr/lib/python2.7/lib-tk',
 '/srv/modoboa/env/local/lib/python2.7/site-packages']
Server time:	Mon, 25 Sep 2017 16:04:45 +0100

Here's the traceback:

Environment:


Request Method: POST
Request URL: https://mail.example.com/accounts/login/

Django Version: 1.10.8
Python Version: 2.7.12
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.sites',
 'django.contrib.staticfiles',
 'reversion',
 'ckeditor',
 'ckeditor_uploader',
 'rest_framework',
 'rest_framework.authtoken',
 'modoboa',
 'modoboa.core',
 'modoboa.lib',
 'modoboa.admin',
 'modoboa.relaydomains',
 'modoboa.limits',
 'modoboa.parameters',
 'modoboa_amavis',
 'modoboa_pdfcredentials',
 'modoboa_postfix_autoreply',
 'modoboa_sievefilters',
 'modoboa_stats',
 'modoboa_webmail',
 'modoboa_contacts',
 'modoboa_dmarc',
 'modoboa_imap_migration',
 'webpack_loader')
Installed Middleware:
('x_forwarded_for.middleware.XForwardedForMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'modoboa.core.middleware.LocalConfigMiddleware',
 'modoboa.lib.middleware.AjaxLoginRedirect',
 'modoboa.lib.middleware.CommonExceptionCatcher',
 'modoboa.lib.middleware.RequestCatcherMiddleware')



Traceback:

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/handlers/exception.py" in inner
  42.             response = get_response(request)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _legacy_get_response
  249.             response = self._get_response(request)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
  187.                 response = self.process_exception_by_middleware(e, request)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
  185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/utils/decorators.py" in inner
  185.                     return func(*args, **kwargs)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/utils/decorators.py" in inner
  185.                     return func(*args, **kwargs)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  57.         response = view_func(request, *args, **kwargs)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/core/views/auth.py" in dologin
  34.                                 password=form.cleaned_data["password"])

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/contrib/auth/__init__.py" in authenticate
  74.             user = backend.authenticate(**credentials)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_imap_migration/auth_backends.py" in authenticate
  46.         return self.get_or_create_user(username, password)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_imap_migration/auth_backends.py" in get_or_create_user
  64.             Migration.objects.create(mailbox=user.mailbox, password=password)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/manager.py" in manager_method
  85.                 return getattr(self.get_queryset(), name)(*args, **kwargs)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/query.py" in create
  399.         obj.save(force_insert=True, using=self.db)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/base.py" in save
  796.                        force_update=force_update, update_fields=update_fields)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/base.py" in save_base
  824.             updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/base.py" in _save_table
  908.             result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/base.py" in _do_insert
  947.                                using=using, raw=raw)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/manager.py" in manager_method
  85.                 return getattr(self.get_queryset(), name)(*args, **kwargs)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/query.py" in _insert
  1045.         return query.get_compiler(using=using).execute_sql(return_id)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in execute_sql
  1054.                 cursor.execute(sql, params)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/backends/utils.py" in execute
  79.             return super(CursorDebugWrapper, self).execute(sql, params)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/backends/utils.py" in execute
  64.                 return self.cursor.execute(sql, params)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/utils.py" in __exit__
  94.                 six.reraise(dj_exc_type, dj_exc_value, traceback)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/backends/utils.py" in execute
  64.                 return self.cursor.execute(sql, params)

Exception Type: DataError at /accounts/login/
Exception Value: value too long for type character varying(100)

deleteMigration modal/dialog doesn't seem to open when removing a migration.

  • OS Type: CentOS
  • OS Version: CentOS Linux release 7.8.2003 (Core)
  • Modoboa: 1.17.0
  • IMAP migration using OfflineIMAP: 1.3.3
  • Webserver: Nginx

When removing an IMAP Migration, the delete button appears to do nothing. When debugging in the browser, I can hit a breakpoint inside the deleteMigration function but nothing appears to happen with the dialog confirm function. I'm a total amateur when it comes to Javascript frameworks, so I can't seem to see anything obvious.

Every thing else seems to be working normally, (with a bit of heavy tweaking to accomodate OfflineIMAP and it's python2 reqs)

And ideas would be most welcome, purely so I don't make OfflineIMAP balloon out of control with redundant sync jobs.

Only blank page gets displayed

I'm running Ubuntu 18.04, I made a clean install of the OS and then installed Modoboa using modoboa-installer and confirmed it was working.

I then installed the modoboa-imap-migration extension and it seemed to install fine, I followed all of the instructions and it shows up in the admin panel (Modoboa > Parameters > IMAP migration).

However my problem is when I click on IMAP Migration from the menu bar along the top it just displays a blank screen so I have no way of adding any mailboxes that I want migrated over.

Can you help me please?

The cron command yields a traceback and quits

If one sets the shell of modoboa's vmail user to /bin/bash in /etc/passwd, the following can be reproduced with an updated modoboa instance:

# su - vmail
$ cat /etc/cron.d/modoboa
$ export PYTHON=/srv/modoboa/env/bin/python
$ export INSTANCE=/srv/modoboa/instance
$ $PYTHON $INSTANCE/manage.py generate_offlineimap_config --output .offlineimaprc

The following traceback reads

Traceback (most recent call last):
  File "/srv/modoboa/instance/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
    utility.execute()
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 345, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 348, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 399, in execute
    output = self.handle(*args, **options)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_imap_migration/management/commands/generate_offlineimap_config.py", line 42, in handle
    "modoboa_imap_migration/offlineimap.conf", context)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/loader.py", line 97, in render_to_string
    return template.render(context, request)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/backends/django.py", line 95, in render
    return self.template.render(context)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/base.py", line 206, in render
    return self._render(context)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/base.py", line 197, in _render
    return self.nodelist.render(context)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/base.py", line 992, in render
    bit = node.render_annotated(context)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/base.py", line 959, in render_annotated
    return self.render(context)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/base.py", line 1043, in render
    output = self.filter_expression.resolve(context)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/base.py", line 734, in resolve
    new_obj = func(obj, autoescape=context.autoescape, *arg_vals)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/defaultfilters.py", line 561, in join
    value = map(force_text, value)
TypeError: argument 2 to map() must support iteration

Triaging the errored ended up to be looking at https://github.com/modoboa/modoboa-imap-migration/blob/master/modoboa_imap_migration/management/commands/generate_offlineimap_config.py#L38 and https://github.com/modoboa/modoboa-imap-migration/blob/master/modoboa_imap_migration/templates/modoboa_imap_migration/offlineimap.conf where we learned the migrations object may not be correctly populated, but that's just a guess.

.offlineimaprc is then existing, but empty.

Rolling back such a failing plugin installation attempt is yet another story.

Per email provider configuration

Store IMAP configuration per email provider (like Gmail, Outlook, etc.) to allow migration from different domains and servers.

null value in column "name" violates not-null constraint

On a brand new installation, after configuration, I try to connect using a "to-be-migrated" username:

null value in column "name" violates not-null constraint
DETAIL:  Failing row contains (4, null, 0, t, domain, 2018-08-08 13:25:20.644694+00, 2018-08-08 13:25:20.647377+00, t, 0, null, null, modoboa, , , f).
/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/core/models.py in populate_callback 
405.   sender="populate_callback", user=user)
Local vars:
grant_access_to_object | <function grant_access_to_object at 0x7f804473ab90>
group | u'SimpleUsers'
sadmins | <QuerySet [<User: admin>]>
user | <User: drzraf>


/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/admin/handlers.py in account_auto_created
170.  domain.save(creator=sadmins[0])
Local vars:
domain | <Domain: None>
domname | None
kwargs | {'signal': <django.dispatch.dispatcher.Signal object at 0x7f804482a050>}
label | None
localpart | u'drzraf'
sadmins | <QuerySet [<User: admin>]>
sender | u'populate_callback'
user | <User: drzraf>

Can we reactivate account sync?

Hello!

I've see that in admin panel -> identities we can stop sync clicking on the blue icon.

Is it possible to reactivate the sync ?

Sincerely,

Authentication issue with python3

The authentication backend fails on Python3 with the following error:

Environment:


Request Method: POST
Request URL: https://modoboa.example.net/accounts/login/

Django Version: 1.11.25
Python Version: 3.7.3
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.sites',
 'django.contrib.staticfiles',
 'reversion',
 'ckeditor',
 'ckeditor_uploader',
 'rest_framework',
 'rest_framework.authtoken',
 'modoboa',
 'modoboa.core',
 'modoboa.lib',
 'modoboa.admin',
 'modoboa.transport',
 'modoboa.relaydomains',
 'modoboa.limits',
 'modoboa.parameters',
 'modoboa.dnstools',
 'modoboa_webmail',
 'modoboa_stats',
 'modoboa_sievefilters',
 'modoboa_radicale',
 'modoboa_postfix_autoreply',
 'modoboa_amavis',
 'modoboa_dmarc',
 'modoboa_imap_migration',
 'webpack_loader')
Installed Middleware:
('x_forwarded_for.middleware.XForwardedForMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'modoboa.core.middleware.LocalConfigMiddleware',
 'modoboa.lib.middleware.AjaxLoginRedirect',
 'modoboa.lib.middleware.CommonExceptionCatcher',
 'modoboa.lib.middleware.RequestCatcherMiddleware')



Traceback:

File "/srv/modoboa/env/lib/python3.7/site-packages/django/core/handlers/exception.py" in inner
  41.             response = get_response(request)

File "/srv/modoboa/env/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
  187.                 response = self.process_exception_by_middleware(e, request)

File "/srv/modoboa/env/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
  185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/lib/python3.7/contextlib.py" in inner
  74.                 return func(*args, **kwds)

File "/srv/modoboa/env/lib/python3.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  57.         response = view_func(request, *args, **kwargs)

File "/srv/modoboa/env/lib/python3.7/site-packages/modoboa/core/views/auth.py" in dologin
  36.                                 password=form.cleaned_data["password"])

File "/srv/modoboa/env/lib/python3.7/site-packages/django/contrib/auth/__init__.py" in authenticate
  70.             user = _authenticate_with_backend(backend, backend_path, request, credentials)

File "/srv/modoboa/env/lib/python3.7/site-packages/django/contrib/auth/__init__.py" in _authenticate_with_backend
  116.     return backend.authenticate(*args, **credentials)

File "/srv/modoboa/env/lib/python3.7/site-packages/modoboa_imap_migration/auth_backends.py" in authenticate
  49.                 smart_bytes(username), smart_bytes(password))

File "/usr/lib/python3.7/imaplib.py" in login
  596.         typ, dat = self._simple_command('LOGIN', user, self._quote(password))

File "/usr/lib/python3.7/imaplib.py" in _quote
  1188.         arg = arg.replace('\\', '\\\\')

Exception Type: TypeError at /accounts/login/
Exception Value: a bytes-like object is required, not 'str'

Documentation issue

In my fairly fresh install I had to change the AUTHENTICATION_BACKENDS to read

AUTHENTICATION_BACKENDS = (
    'django.contrib.auth.backends.ModelBackend',
    'modoboa_imap_migration.auth_backends.IMAPBackend',
)

rather than 'modoboa.lib.authbackends.SimpleBackend' - which seems to have disappeared with revision 4c1c647.

I'd be happy to create a pull request, only it seems a small fix :-)

Best regards,
Anders Bystrup

status_backend no longer supported

A couple of us have been trying to diagnose syncing issues with Modoboa and offlineimap. After disabling some of the variables, we encountered the below error.

 ERROR: the 'status_backend' configuration option is not supported anymore; please, remove this configuration option.
 ['  File "/usr/local/lib/python2.7/dist-packages/offlineimap/accounts.py", line 268, in syncrunner\n    self.statusrepos = Repository(self, \'status\')\n', '  File "/usr/local/lib/python2.7/dist-packages/offlineimap/repository/__init__.py", line 58, in __new__\n    return LocalStatusRepository(name, account)\n', '  File "/usr/local/lib/python2.7/dist-packages/offlineimap/repository/LocalStatus.py", line 45, in __init__\n    OfflineImapError.ERROR.REPO\n']
 ERROR: Exceptions occurred during the run!
 ERROR: the 'status_backend' configuration option is not supported anymore; please, remove this configuration option.

It looks like as of v7.1.0 of offlineimap, the function is no longer supported.

Problems Generate .offlineimaprc

Hi I installed Imap-migration, I configure without problems, but doesn't work. When I manually execute the script (with vmail user):

/srv/modoboa/env/bin/python /srv/modoboa/instance/manage.py generate_offlineimap_config --output  .offlineimaprc

The command only generate this:

[general]
accounts = 
pythonfile = ~/.offlineimap.py

Is it a bug?

No IMAP Migration tab in Modoboa Parameters

Hallo,

I have followed the installation procedures and after initiallyfailing, because the modoboa installation uses its own instance of python, I got the environment correct (as it is in the cron tab) and tried again. Then it worked and everything ran as expected.

Only problem is that the admin interface does not have the Modoboa > Parameters > IMAP migration tab.

I checked the config files again and restarted the webserver, but still nothing.
Any ideas why?

Thanks
Andre

offlineimap is python2 which is troublesome with modoboa on python3

offlineimap does not fully support python3 and never will. See issues (github) and documentation (website).

Python3 is the only current supported Python: https://www.python.org/doc/sunset-python-2/
So hopefully Modoboa is running in a Python3 environment.
If you do, you run into problems due to libraries/dependencies.
This can be overcome with a wrapper script:

.offlineimap.py

# offlineimap executes as Python2 which is troublesome
# we need to use python3 in a virtualenv
#import sys
import os

pyint = "/srv/modoboa/env/bin/python3"

cmd = pyint + " " + "~/offlineimap.py"

os.system(cmd)

where the original .offlineimap.py as published in the ReadMe.md section Helper script on https://github.com/modoboa/modoboa-imap-migration
is now stored as offlineimap.py. see: https://github.com/modoboa/modoboa-imap-migration#helper-script-for-offlineimap

Empty modoboa_imap_migration_migration table

Hello,

My first message : thank your for the good job.

Probably more a question than an issue : I'm trying to use modoboa-imap-migration to migrate a modoboa 1.1 instance to a 1.3.5 on another server with no luck.

The domains/identities and aliases export/import have been done without any errors.
Problem is : generate_offlineimap_config script does not detect any account to migrate. The modoboa_imap_migration_migration MySQL table is empty.

The modoboa modules versions on the destination server are :
modoboa (1.3.5)
modoboa-admin (1.1.2)
modoboa-admin-limits (1.0.2)
modoboa-admin-relaydomains (1.1.0)
modoboa-amavis (1.0.3)
modoboa-imap-migration (1.0.3)
modoboa-pdfcredentials (1.0.0)
modoboa-postfix-autoreply (1.1.1)
modoboa-radicale (1.0.3)
modoboa-sievefilters (1.0.3)
modoboa-stats (1.0.2)
modoboa-webmail (1.0.2)

The generated offlineimap.conf is :
[general]
accounts =
pythonfile = ~/.offlineimap.py

Am I doing something wrong ?

Extra oflineimap settings

Currently I am modifying the offlineimap.conf to add the folderfilter option folderfilter = lambda folder: not re.search('(^Contacts|Rss Feed)', folder). It would be nice if this was achievable in the GUI.

Perhaps an arbitrary options input field?

Error when using imap-migration

  • Modoboa 1.13.1
  • Modoboa-imap-migration 1.2.1

When I enter a email/password, I got an error.

sc

I don't know when the feature stopped to work as I've not used it for a long time.

I receive a very long mail with many technicals informations (activated in settings.py). The remote auth seems to work.

sc2

sc3

unrecognized arguments: --output .offlineimaprc

Modoboa 1.7.2
IMAP migration using OfflineIMAP 1.1.0

Did an upgrade from Modoboa 1.6 a little while ago and I noticed my IMAP migration wasn't working any longer. When attempting to manually run the migration I get the following error:

(env)$ /srv/modoboa/instance/manage.py generate_offlineimap_config --output .offlineimaprc
usage: manage.py generate_offlineimap_config [-h] [--version] [-v {0,1,2,3}]
                                             [--settings SETTINGS]
                                             [--pythonpath PYTHONPATH]
                                             [--traceback] [--no-color]
manage.py generate_offlineimap_config: error: unrecognized arguments: --output .offlineimaprc

Everything appears installed, but configuration pages are empty:

-Ubuntu 18.04.3
-No errors in logs
-CronJob Runs

Name | Installed version | Last version | Description
-- | -- | -- | --
Modoboa | 1.14.0 | 1.14.0 | The core part of Modoboa
Amavis frontend | 1.2.3 | 1.2.3 | Simple amavis management frontend
Contacts | 0.7.3 | 0.7.3 | Address book
IMAP migration using OfflineIMAP | 1.3.3 | 1.3.3 | Migrate existing mailboxes using IMAP and OfflineIMAP
PDF credentials | 1.3.2 | 1.3.2 | Generate PDF documents containing users' credentials
Postfix autoreply | 1.5.1 | 1.5.1 | Auto-reply (vacation) functionality using Postfix
Radicale management | 1.3.6 | 1.3.6 | Management frontend for Radicale, a simple calendar and contact server.
Sieve filters | 1.4.2 | 1.4.2 | Plugin to easily create server-side filters
Statistics | 1.4.1 | 1.4.1 | Graphical statistics about emails traffic using RRDtool
Webmail | 1.5.0 | 1.5.0 | Simple IMAP webmail

Can't find where to enter information about old servers, either I am missing something in the setup or there's a problem.

Under the main page "Imap Migrations" tab, the resulting page is blank. View source shows no content at all.

Under ModoBoa -> Parameters -> Imap Migration

Current Sync Jobs 1
Create Folders Yes
Folder filter Exclusions Blank
Folder Filter Inclusions blank

Save  

What am I doing wrong?

Install Error

Hi,
Tried to install this extension on a clean Modoboa Install (Ubuntu 16.04 using the modoboa installer metho) but got the following error on running python setup.py install:

Traceback (most recent call last): File "setup.py", line 19, in <module> from pip._internal.req import parse_requirements ImportError: No module named pip._internal.req

Error on login with old system credentials

I was able to get modo boa and modoboa-imap-migration installed, but when I tried logging in with the credentials for a user on the old system I got an error as follows:

Environment:

Request Method: POST
Request URL: https://mail.email.wheatstatewooddesign.com/accounts/login/

Django Version: 1.10.8
Python Version: 2.7.12
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.sites',
'django.contrib.staticfiles',
'reversion',
'ckeditor',
'ckeditor_uploader',
'rest_framework',
'rest_framework.authtoken',
'modoboa',
'modoboa.core',
'modoboa.lib',
'modoboa.admin',
'modoboa.relaydomains',
'modoboa.limits',
'modoboa.parameters',
'modoboa_amavis',
'modoboa_pdfcredentials',
'modoboa_postfix_autoreply',
'modoboa_sievefilters',
'modoboa_stats',
'modoboa_webmail',
'modoboa_contacts',
'modoboa_imap_migration',
'webpack_loader')
Installed Middleware:
('x_forwarded_for.middleware.XForwardedForMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'modoboa.core.middleware.LocalConfigMiddleware',
'modoboa.lib.middleware.AjaxLoginRedirect',
'modoboa.lib.middleware.CommonExceptionCatcher',
'modoboa.lib.middleware.RequestCatcherMiddleware')

Traceback:

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/handlers/exception.py" in inner
42. response = get_response(request)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _legacy_get_response
249. response = self._get_response(request)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
187. response = self.process_exception_by_middleware(e, request)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
185. response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/utils/decorators.py" in inner
185. return func(*args, **kwargs)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/utils/decorators.py" in inner
185. return func(*args, **kwargs)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
57. response = view_func(request, *args, **kwargs)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/core/views/auth.py" in dologin
34. password=form.cleaned_data["password"])

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/contrib/auth/init.py" in authenticate
74. user = backend.authenticate(**credentials)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_imap_migration/auth_backends.py" in authenticate
46. return self.get_or_create_user(username, password)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_imap_migration/auth_backends.py" in get_or_create_user
64. Migration.objects.create(mailbox=user.mailbox, password=password)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/manager.py" in manager_method
85. return getattr(self.get_queryset(), name)(*args, **kwargs)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/query.py" in create
399. obj.save(force_insert=True, using=self.db)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/base.py" in save
796. force_update=force_update, update_fields=update_fields)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/base.py" in save_base
824. updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/base.py" in _save_table
908. result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/base.py" in _do_insert
947. using=using, raw=raw)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/manager.py" in manager_method
85. return getattr(self.get_queryset(), name)(*args, **kwargs)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/query.py" in _insert
1045. return query.get_compiler(using=using).execute_sql(return_id)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in execute_sql
1054. cursor.execute(sql, params)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/backends/utils.py" in execute
79. return super(CursorDebugWrapper, self).execute(sql, params)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/backends/utils.py" in execute
64. return self.cursor.execute(sql, params)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/utils.py" in exit
94. six.reraise(dj_exc_type, dj_exc_value, traceback)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/backends/utils.py" in execute
64. return self.cursor.execute(sql, params)

Exception Type: DataError at /accounts/login/
Exception Value: value too long for type character varying(100)

OSError at /modoboa_imap_migration/

I just finished installing the plugin successfully by downloading the code from this repository. When I click on the IMAP migrations tab, I see the following error (with debug turned on):

Error reading /srv/modoboa/env/lib/python3.8/site-packages/modoboa_imap_migration-1.3.4.dev10+g1123a58-py3.8.egg/modoboa_imap_migration/static/webpack-stats.json. Are you sure webpack has generated the file and the path is correct?

It does seem that the folder static does not exist. I followed the steps in the README and the 3 standard commands that need to be executed after every plugin installation.

Did I miss a step somewhere?

offline imap fails

The default configuration for offline imap as generated by modoboa (.offlineimaprc) seems to require some additional details to work. I'm not sure how it could ever work without some "tweaking" if you are using a secure connection. I think you must reference a security certificate.

In my case, I am NOT making a secure connection to the source server. I am using port 143, but it fails. I think the default for offlineimap is to assume a secure connection. I searched for a way to change this default, but couldn't find one. To resolve this I put ssl = false and it started working. The problem now is the .offlineimaprc file gets regenerated and overwritten from the CRON job every time this runs.

urllib3 (1.22) or chardet (2.3.0) doesn't match a supported version!

runuser -l vmail -c '/srv/modoboa/env/bin/python /srv/modoboa/instance/manage.py generate_offlineimap_config --output .offlineimaprc && /usr/bin/offlineimap'

OfflineIMAP 7.0.12
  Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception)
/srv/modoboa/env/lib/python2.7/site-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.22) or chardet (2.3.0) doesn't match a supported version!
  RequestsDependencyWarning)

Is this a Problem?
Modoboa-installer: yes

Exception Type: KeyError at /modoboa_imap_migration/ | Exception Value: u'IMAP_MIGRATION'

Upgrade:

sudo -u modoboa -i
bash
source env/bin/activate
pip install -U modoboa-imap-migration
$ cd <modoboa_instance_dir>
$ python manage.py migrate modoboa_imap_migration
$ python manage.py load_initial_data

After Upgrading from Version 1.2.1 to 1.3.0 i become this Error.

Request Method: | GET
-- | --
https://mail.secnux.net/modoboa_imap_migration/
1.11.18
KeyError
u'IMAP_MIGRATION'
/srv/modoboa/env/local/lib/python2.7/site-packages/webpack_loader/config.py in load_config, line 33
/usr/bin/uwsgi-core
2.7.13
['.',  '',  '/srv/modoboa/env/lib/python2.7',  '/srv/modoboa/env/lib/python2.7/plat-x86_64-linux-gnu',  '/srv/modoboa/env/lib/python2.7/lib-tk',  '/srv/modoboa/env/lib/python2.7/lib-old',  '/srv/modoboa/env/lib/python2.7/lib-dynload',  '/usr/lib/python2.7',  '/usr/lib/python2.7/plat-x86_64-linux-gnu',  '/usr/lib/python2.7/lib-tk',  '/srv/modoboa/env/local/lib/python2.7/site-packages',  '/srv/modoboa/env/lib/python2.7/site-packages']
Thu, 7 Mar 2019 16:35:58 +0100
Environment:

Request Method: GET
Request URL: https://mail.secnux.net/modoboa_imap_migration/

Django Version: 1.11.18
Python Version: 2.7.13
Installed Applications:
(u'django.contrib.auth',
 u'django.contrib.contenttypes',
 u'django.contrib.sessions',
 u'django.contrib.messages',
 u'django.contrib.sites',
 u'django.contrib.staticfiles',
 u'reversion',
 u'ckeditor',
 u'ckeditor_uploader',
 u'rest_framework',
 u'rest_framework.authtoken',
 u'modoboa',
 u'modoboa.core',
 u'modoboa.lib',
 u'modoboa.admin',
 u'modoboa.transport',
 u'modoboa.relaydomains',
 u'modoboa.limits',
 u'modoboa.parameters',
 u'modoboa.dnstools',
 u'modoboa_amavis',
 u'modoboa_pdfcredentials',
 u'modoboa_postfix_autoreply',
 u'modoboa_sievefilters',
 u'modoboa_stats',
 u'modoboa_webmail',
 u'modoboa_contacts',
 u'modoboa_radicale',
 u'modoboa_dmarc',
 u'modoboa_imap_migration',
 'webpack_loader')
Installed Middleware:
(u'x_forwarded_for.middleware.XForwardedForMiddleware',
 u'django.contrib.sessions.middleware.SessionMiddleware',
 u'django.middleware.common.CommonMiddleware',
 u'django.middleware.csrf.CsrfViewMiddleware',
 u'django.contrib.auth.middleware.AuthenticationMiddleware',
 u'django.contrib.messages.middleware.MessageMiddleware',
 u'django.middleware.locale.LocaleMiddleware',
 u'django.middleware.clickjacking.XFrameOptionsMiddleware',
 u'modoboa.core.middleware.LocalConfigMiddleware',
 u'modoboa.lib.middleware.AjaxLoginRedirect',
 u'modoboa.lib.middleware.CommonExceptionCatcher',
 u'modoboa.lib.middleware.RequestCatcherMiddleware')



Traceback:

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/handlers/exception.py" in inner
  41.             response = get_response(request)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
  217.                 response = self.process_exception_by_middleware(e, request)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
  215.                 response = response.render()

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/response.py" in render
  107.             self.content = self.rendered_content

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/response.py" in rendered_content
  84.         content = template.render(context, self._request)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/backends/django.py" in render
  66.             return self.template.render(context)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/base.py" in render
  207.                     return self._render(context)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/base.py" in _render
  199.         return self.nodelist.render(context)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/base.py" in render
  990.                 bit = node.render_annotated(context)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/base.py" in render_annotated
  957.             return self.render(context)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  177.             return compiled_parent._render(context)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/base.py" in _render
  199.         return self.nodelist.render(context)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/base.py" in render
  990.                 bit = node.render_annotated(context)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/base.py" in render_annotated
  957.             return self.render(context)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  177.             return compiled_parent._render(context)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/base.py" in _render
  199.         return self.nodelist.render(context)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/base.py" in render
  990.                 bit = node.render_annotated(context)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/base.py" in render_annotated
  957.             return self.render(context)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  72.                 result = block.nodelist.render(context)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/base.py" in render
  990.                 bit = node.render_annotated(context)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/base.py" in render_annotated
  957.             return self.render(context)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/defaulttags.py" in render
  322.                 return nodelist.render(context)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/base.py" in render
  990.                 bit = node.render_annotated(context)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/base.py" in render_annotated
  957.             return self.render(context)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/template/library.py" in render
  203.         output = self.func(*resolved_args, **resolved_kwargs)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/webpack_loader/templatetags/webpack_loader.py" in render_bundle
  12.     tags = utils.get_as_tags(bundle_name, extension=extension, config=config, attrs=attrs)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/webpack_loader/utils.py" in get_as_tags
  45.     bundle = _get_bundle(bundle_name, extension, config)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/webpack_loader/utils.py" in _get_bundle
  23.     bundle = get_loader(config).get_bundle(bundle_name)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/webpack_loader/utils.py" in get_loader
  11.         _loaders[config_name] = WebpackLoader(config_name)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/webpack_loader/loader.py" in __init__
  22.         self.config = load_config(self.name)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/webpack_loader/config.py" in load_config
  33.     return user_config[name]

Exception Type: KeyError at /modoboa_imap_migration/
Exception Value: u'IMAP_MIGRATION'

Logging in a migration account leads to internal error

While a remote maillog shows successful delegated authentication to the migration source from the migration target's IP, logging in to modoboa yields an internal error.

This does not happen with nonexisting accounts at the remote source.

bildschirmfoto von 2016-07-28 20-45-15

setup of database tables failed ("ImportError: No module named modoboa_amavis")

Just got following error message. "modoboa_amavis" is in settings.py, so I dont know why I get this message.
Installing offlineimap caused also some problems, because python3 is installed and I had to downgrade python-imaplib2
I use debian stretch

python manage.py migrate modoboa_imap_migration
Traceback (most recent call last):
File "manage.py", line 22, in
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/Django-1.11.20-py2.7.egg/django/core/management/init.py", line 364, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/Django-1.11.20-py2.7.egg/django/core/management/init.py", line 308, in execute
settings.INSTALLED_APPS
File "/usr/local/lib/python2.7/dist-packages/Django-1.11.20-py2.7.egg/django/conf/init.py", line 56, in getattr
self._setup(name)
File "/usr/local/lib/python2.7/dist-packages/Django-1.11.20-py2.7.egg/django/conf/init.py", line 41, in _setup
self._wrapped = Settings(settings_module)
File "/usr/local/lib/python2.7/dist-packages/Django-1.11.20-py2.7.egg/django/conf/init.py", line 110, in init
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/srv/modoboa/instance/instance/settings.py", line 333, in
from modoboa_amavis import settings as modoboa_amavis_settings
ImportError: No module named modoboa_amavis

Running the installation script previously there were a lot of warnings about missing files, just at the beginning too ...:

python setup.py install
running install
running bdist_egg
running egg_info
creating modoboa_imap_migration.egg-info
writing requirements to modoboa_imap_migration.egg-info/requires.txt
writing modoboa_imap_migration.egg-info/PKG-INFO
writing top-level names to modoboa_imap_migration.egg-info/top_level.txt
writing dependency_links to modoboa_imap_migration.egg-info/dependency_links.txt
writing manifest file 'modoboa_imap_migration.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'COPYING'
warning: no files found matching '.js' under directory 'modoboa_imap_migration'
warning: no files found matching '
.css' under directory 'modoboa_imap_migration'
.....
In between masses of missing files warnings and so on ...
.....

warning: no previously-included files matching '*.py[co]' found anywhere in distribution
no previously-included directories found matching 'docs/_build'
File "build/bdist.linux-x86_64/egg/jinja2/asyncsupport.py", line 22
async def concat_async(async_gen):
^
SyntaxError: invalid syntax

File "build/bdist.linux-x86_64/egg/jinja2/asyncfilters.py", line 7
async def auto_to_seq(value):
^
SyntaxError: invalid syntax

creating /usr/local/lib/python2.7/dist-packages/Jinja2-2.10.1-py2.7.egg
Extracting Jinja2-2.10.1-py2.7.egg to /usr/local/lib/python2.7/dist-packages
File "/usr/local/lib/python2.7/dist-packages/Jinja2-2.10.1-py2.7.egg/jinja2/asyncsupport.py", line 22
async def concat_async(async_gen):
^
SyntaxError: invalid syntax

File "/usr/local/lib/python2.7/dist-packages/Jinja2-2.10.1-py2.7.egg/jinja2/asyncfilters.py", line 7
async def auto_to_seq(value):
^
SyntaxError: invalid syntax

Error retrieving password from modoboa

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.

File ".offlineimap.py", line 21, in <module>
    get_user_password("[email protected]");
  File ".offlineimap.py", line 17, in get_user_password
    mailbox__user__username=username
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_imap_migration/models.py", line 24, in password
    return decrypt(self._password)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/lib/cryptutils.py", line 52, in decrypt
    clear = decryptor.update(ct) + decryptor.finalize()
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/cryptography/hazmat/primitives/ciphers/base.py", line 159, in finalize
    data = self._ctx.finalize()
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/cryptography/hazmat/backends/openssl/ciphers.py", line 172, in finalize
    "The length of the provided data is not a multiple of "
ValueError: The length of the provided data is not a multiple of the block length.

Is there anything to do to fix it? I tried running it with and without modoboa environment.
Modoboa is the latest version installed using modoboa-installer.
Thanks

UID validity problem for folder ... skipping it.

UID validity problem for folder Sent (repo [email protected]) (saved 1551646541; got 1551654809); skipping it. Please see FAQ and manual on how to handle this.

Simply deleting the user is not enough.
Everyone has a Solution for me? :/

runuser -l vmail -c '/srv/modoboa/env/bin/python /srv/modoboa/instance/manage.py generate_offlineimap_config --output .offlineimaprc && /usr/bin/offlineimap'
OfflineIMAP 7.0.12
  Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception)
/srv/modoboa/env/lib/python2.7/site-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.22) or chardet (2.3.0) doesn't match a supported version!
  RequestsDependencyWarning)
Account sync [email protected]:
 *** Processing account [email protected]
 Establishing connection to mail.domain.com:143 ([email protected])
 Establishing connection to localhost:143 ([email protected])
 Creating folder Notes[[email protected]]
 Creating new Local Status db for [email protected]:Notes
Folder Drafts [acc: [email protected]]:
 Syncing Drafts: IMAP -> MappedIMAP
Folder INBOX [acc: [email protected]]:
 Syncing INBOX: IMAP -> MappedIMAP
Folder Drafts [acc: [email protected]]:
 UID validity problem for folder Drafts (repo [email protected]) (saved 1551646538; got 1551654806); skipping it. Please see FAQ and manual on how to handle this.
Folder INBOX [acc: [email protected]]:
 UID validity problem for folder INBOX (repo [email protected]) (saved 1551646542; got 1551654810); skipping it. Please see FAQ and manual on how to handle this.
Folder Junk [acc: [email protected]]:
 Syncing Junk: IMAP -> MappedIMAP
Folder Notes [acc: [email protected]]:
 Syncing Notes: IMAP -> MappedIMAP
Folder Sent [acc: [email protected]]:
 Syncing Sent: IMAP -> MappedIMAP
 UID validity problem for folder Sent (repo [email protected]) (saved 1551646541; got 1551654809); skipping it. Please see FAQ and manual on how to handle this.
Folder Trash [acc: [email protected]]:
 Syncing Trash: IMAP -> MappedIMAP
Account sync [email protected]:
 *** Finished account '[email protected]' in 0:01
At least one folder skipped due to UID validity problem

SSL not enabled in offlineimap configuration

Version: 1.1.1

I've enabled SSL using modoboa settings:

2017-09-28-102520_3440x1440_scrot

The generated configuration has ssl disabled:

[general]
accounts = [email protected]
pythonfile = ~/.offlineimap.py


[Account [email protected]]
localrepository = [email protected]
remoterepository = [email protected]
status_backend = sqlite

[Repository [email protected]]
type = IMAP
ssl = false
remotehost = localhost
remoteuser = [email protected]
remotepasseval = get_user_password("[email protected]")

[Repository [email protected]]
type = IMAP
remotehost = mail.example.com
remoteport = 993

ssl = no

remoteuser = [email protected]
remotepasseval = get_user_password("[email protected]")
readonly = true

only user name login without domain

Hello!

Is there a way to make the plugin work with only user names, instead of [email protected] logins?
On my old IMAP server the users are stored without domain names, but on the Modoboa admin panel the associated domains can not be left blank, (nor does it work with assumed special characters "*" , ".")

Thanks,
cserem

How to use migration extension

Hey,

I'm somewhat embarrassed to post this but I really don't understand the way this extension is to be used. I think my main issue is the following:-

A user from the old server logs into Modoboa using the same credentials

A new account is automatically created and a new migration task is created using the provided credentials

How does a user log in if there isn't an account already created? When I try and do this my server running modoboa doesn't allow the connection.

If it helps, I'm attempting to migrate from a mailcow install to modoboa and assumed this was the best way of doing it?

Thanks,
Jamie.

offlineimap is deprecated

The project is no longer in active development. The author(s) have moved on to imapfw.
This new project has not yet matured and is not a full replacement according to the projects website.
Both projects are documented on the same website.
offlineimap is python2 only with stalled plans to move to python3. python2 is depreciated as well.
Most of these things have been facts for years.

see:

offlineimap.py missing django-urls in python2.7

Hey,
I’m trying to setup this migration tool wich can be really useful
Here is the error I get when I try to use offlineimap

vmail@mail:~$ offlineimap 
OfflineIMAP 7.2.3
  Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception)
imaplib2 v2.57 (system), Python v2.7.16, OpenSSL 1.1.1d  10 Sep 2019
ERROR: No module named urls
ERROR: Exceptions occurred during the run!
ERROR: No module named urls

Some input

.offlineimap.py

import os
import site
import sys

site.addsitedir("/srv/modoboa/env/lib/python2.7/site-packages")
sys.path.append("/srv/modoboa/instance")
os.environ["DJANGO_SETTINGS_MODULE"] = "instance.settings"

from django.apps import apps
from django.conf import settings
apps.populate(settings.INSTALLED_APPS)

from modoboa_imap_migration.models import Migration

def get_user_password(username):
    """Retrieve a password from Modoboa's database."""
    return Migration.objects.select_related().get(
        mailbox__user__username=username
    ).password

~.offlineimaprc

[general]
accounts = XXX@YYY
pythonfile = ~/.offlineimap.py


[Account XXX@YYY]
localrepository = Local_XXX@YYY
remoterepository = Remote_XXX@YYY

[Repository Local_XXX@YYY]
type = IMAP
ssl = false
remotehost = localhost
remoteuser = XXX@YYY
remotepasseval = get_user_password("XXX@YYY")


[Repository Remote_XXX@YYY]
type = IMAP
remotehost = ssl0.ovh.net
remoteport = 993

ssl = yes
sslcacertfile = /etc/ssl/certs/ca-certificates.crt

remoteuser = XXX@YYY
remotepasseval = get_user_password("XXX@YYY")
readonly = true
(env) modoboa@mail:~$ pip install django-urls
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting django-urls
  Using cached https://files.pythonhosted.org/packages/85/2e/d9fd07d8e500a19f5158990884eec6bf6a76935b849ea9c23ad79de4f331/django_urls-1.0.3.tar.gz
ERROR: Could not find a version that satisfies the requirement django>=2.0 (from django-urls) (from versions: 1.1.3, 1.1.4, 1.2, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.2.6, 1.2.7, 1.3, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.3.7, 1.4, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 1.4.7, 1.4.8, 1.4.9, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 1.4.14, 1.4.15, 1.4.16, 1.4.17, 1.4.18, 1.4.19, 1.4.20, 1.4.21, 1.4.22, 1.5, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.5.9, 1.5.10, 1.5.11, 1.5.12, 1.6, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6, 1.6.7, 1.6.8, 1.6.9, 1.6.10, 1.6.11, 1.7, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.7.5, 1.7.6, 1.7.7, 1.7.8, 1.7.9, 1.7.10, 1.7.11, 1.8a1, 1.8b1, 1.8b2, 1.8rc1, 1.8, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.8.5, 1.8.6, 1.8.7, 1.8.8, 1.8.9, 1.8.10, 1.8.11, 1.8.12, 1.8.13, 1.8.14, 1.8.15, 1.8.16, 1.8.17, 1.8.18, 1.8.19, 1.9a1, 1.9b1, 1.9rc1, 1.9rc2, 1.9, 1.9.1, 1.9.2, 1.9.3, 1.9.4, 1.9.5, 1.9.6, 1.9.7, 1.9.8, 1.9.9, 1.9.10, 1.9.11, 1.9.12, 1.9.13, 1.10a1, 1.10b1, 1.10rc1, 1.10, 1.10.1, 1.10.2, 1.10.3, 1.10.4, 1.10.5, 1.10.6, 1.10.7, 1.10.8, 1.11a1, 1.11b1, 1.11rc1, 1.11, 1.11.1, 1.11.2, 1.11.3, 1.11.4, 1.11.5, 1.11.6, 1.11.7, 1.11.8, 1.11.9, 1.11.10, 1.11.11, 1.11.12, 1.11.13, 1.11.14, 1.11.15, 1.11.16, 1.11.17, 1.11.18, 1.11.20, 1.11.21, 1.11.22, 1.11.23, 1.11.24, 1.11.25)
ERROR: No matching distribution found for django>=2.0 (from django-urls)
(env) modoboa@mail:~$ pip list
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Package                         Version  
------------------------------- ---------
backports.csv                   1.0.7    
bcrypt                          3.1.4    
certifi                         2019.9.11
cffi                            1.13.1   
chardet                         3.0.4    
Click                           7.0      
coreapi                         2.3.3    
coreapi-cli                     1.0.6    
coreschema                      0.0.4    
cryptography                    2.8      
dj-database-url                 0.5.0    
Django                          1.11.25  
django-braces                   1.11.0   
django-ckeditor                 5.2.2    
django-compat                   1.0.15   
django-filter                   1.1.0    
django-reversion                2.0.12   
django-subcommand2              0.1.1    
django-webpack-loader           0.6.0    
django-xforwardedfor-middleware 2.0      
djangorestframework             3.7.3    
dnspython                       1.15.0   
enum34                          1.1.6    
feedparser                      5.2.1    
future                          0.18.1   
futures                         3.3.0    
gevent                          1.4.0    
greenlet                        0.4.15   
html2text                       2019.8.11
idna                            2.8      
ipaddress                       1.0.23   
itypes                          1.1.0    
Jinja2                          2.10.3   
jsonfield                       2.0.2    
LEPL                            5.1.3    
lxml                            4.4.1    
MarkupSafe                      1.1.1    
modoboa                         1.14.0   
modoboa-admin                   1.1.2    
modoboa-amavis                  1.2.3    
modoboa-dmarc                   1.1.0    
modoboa-imap-migration          1.3.3    
modoboa-postfix-autoreply       1.5.1    
modoboa-sievefilters            1.4.2    
modoboa-stats                   1.4.1    
modoboa-webmail                 1.5.0    
passlib                         1.7.1    
Pillow                          6.2.1    
pip                             19.3.1   
pkg-resources                   0.0.0    
progressbar-latest              2.4      
progressbar33                   2.4      
psycopg2                        2.8.4    
py-dateutil                     2.2      
pycparser                       2.19     
pytz                            2019.3   
requests                        2.22.0   
requests-file                   1.4.3    
rfc6266                         0.0.4    
rrdtool                         0.1.15   
setuptools                      41.4.0   
sievelib                        1.1.1    
six                             1.12.0   
tldextract                      2.2.2    
uritemplate                     3.0.0    
urllib3                         1.25.6   
wheel                           0.33.6   
root@mail:/srv/vmail# lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 10 (buster)
Release:	10
Codename:	buster

imap migration does not sync inboxes

I followed instructions, emails are created after login but inbox sync does not happen. there is no error when I run the cron job manually via below command:

runuser -l vmail -c '/srv/modoboa/env/bin/python /srv/modoboa/instance/manage.py generate_offlineimap_config --output .offlineimaprc && /usr/local/bin/offlineimap'

.offlineimaprc

[general]
accounts = [email protected]
pythonfile = ~/.offlineimap.py


[Account [email protected]]
localrepository = [email protected]
remoterepository = [email protected]
status_backend = sqlite

[Repository [email protected]]
type = IMAP
remotehost = localhost
remoteuser = [email protected]
remotepasseval = get_user_password("[email protected]")

[Repository [email protected]]
type = IMAP
remotehost = mail.camva.ir
remoteport = 993
ssl = yes
remoteuser = [email protected]
remotepasseval = get_user_password("[email protected]")
readonly = true

migration issues

I have imported all the domains and user accounts into modoboa from a csv file. I want to kick off the offline imap to sync everything up from the server I am migrating from. It looks like the workflow you have designed for imap migration is to rely on an end user to first login to modoboa with the same username and password which as part of that process "seads" a table for offline imap to inspect and use.

Since I am loading everything up in advance (with the same username/password), is there a way to tell offline imap to just start syncing everything?

Bug with cancel button for imap migration

Impacted versions

  • Modoboa: 1.13.1
  • Safari OSX

If we have an account with active imap migration.
If we click on the button, and if we click on "cancel", the imap migration is stopped anyway (and the blue button disappears anyway).

sc

Another bug: the button show "Annuler" (cancel) unless we are using English language.

'modoboa_imap_migration' is not a registered namespace

I tried to migrate my mail server from my old server to my new one through the Modoboa IMAP migration plugin but I cannot make it work. I spent the whole day on it to finally be stuck upon this error :

image

The web interface works fine if I remove the occurrences of the IMAP migration plugin in the settings.py file.

offlineimap cronjob "NO OUTPUT GENERATED"

Hi,
I have problem cron job.
Modoboa IMAP migratiion dont synchronise old message.

if cron run manualy-

Execute Cron Job
Output from command cd /srv/vmail && $PYTHON /srv/modoboa/instance/manage.py generate_offlineimap_config --output .offlineimaprc && /usr/local/bin/offlineimap > /dev/null 2>&1 ..
NO OUTPUT GENERATED

HTTP 500

Hello!

Installing and enabling the module gives internal server error for imap_migration (https://myhost/modoboa_imap_migration/), the Modoboa > Parameters page loads fine, and I am able to save settings with it.

Steps to reproduce:

Fresh install with modoboa-installer:

root@mail:~# ./run.py --interactive mydomain.com
root@mail:~# su - modoboa
$ bash
modoboa@mail:~$ . env/bin/activate
(env) modoboa@mail:~$ pip install modoboa-imap-migration
 modoboa@mail:~/instance/instance$ #editing the config as documented: diff settings.py settings.py.ORIG
92c92
<     'modoboa_imap_migration',
---
>
352,354d351
<
< from modoboa_imap_migration import settings as modoboa_imap_migration_settings
< modoboa_imap_migration_settings.apply(globals())
root@mail:/srv/modoboa/instance/instance# systemctl restart uwsgi

I have tried setting Debug = True (in settings.py), but that introduces a new error message for calendar/contacts/imap_imgration modules:
Error reading /srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_contacts/../frontend/webpack-stats.json. Are you sure webpack has generated the file and the path is correct?" (the modoboa_xxxx module part changes with the modules)

Could you help me debug the initial internernal server error in imap_migration?

Thanks
cserem

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.