diff --git a/doc/features/imap-migration.rst b/doc/features/imap-migration.rst new file mode 100644 index 000000000..ad062c266 --- /dev/null +++ b/doc/features/imap-migration.rst @@ -0,0 +1,55 @@ +IMAP Migration for Modoboa +=========================== + +.. _imap: + +A simple `Modoboa `_ extension which provides a +way to transfer your account from another provider/server +provided that you have IMAP access to it. + + +Configuration +------------- + +The plugin configuration is done from the admin panel (*Modoboa > +Parameters > IMAP Migration*). And you have a specific tab to configure +your migration that is visible for SuperAdmins. +These settings are only available on the new admin interface. + +.. warning:: + + You must have enabled "Auto create domain" in modoboa parameters for this extension to work. + +This extension can create `OfflineIMAP `_ +configuration file with the command: + +.. sourcecode:: bash + + > python manage.py generate_offlineimap_config + +You then need to setup `OfflineIMAP `_. + .. +This will sync back-and-forth user mailbox. + + +Providers +--------- + +Mail server can host multiple domains so the provider address +may be different from the domain part of your email address. + +Associated domain is the domain part of the email address. +You can leave "Local Domain" blank if you keep the same domain. +This domain will be auto-created if needed. +you must create the domain beforhand if you want to migrate an account +from `user@domain1.tld` to `user@domain2.tld`. + + +Migrations +---------- + +Migrations are automatically handled when providers have been configured. +Users use their old credential to log and the account is automatically created. +They shall use the new domain on next logins if a local domain was set in the provider configuration. +If you have installed OfflineIMAP, you may delete the migration to stop mailbox sync. +SuperAdmins may check migrations in the `IMAP Migration` tab. diff --git a/doc/index.rst b/doc/index.rst index cf037432a..cb9a85f89 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -34,6 +34,10 @@ It provides built-in features by default : | |containing account | | | |credentials | | +---------------------------------------------------------+-------------------------+------------------------------------------------------+ +|modoboa-imap-migration |Transfer accounts from |:ref:`modoboa_imap-migration Documentation ` | +| |other mail server | | +| |automatically | | ++---------------------------------------------------------+-------------------------+------------------------------------------------------+ And it is extensible by nature and comes with a lot of additional extensions: @@ -49,10 +53,6 @@ And it is extensible by nature and comes with a lot of additional extensions: | | | | | | | | +---------------------------------------------------------+-------------------------+------------------------------------------------------+ -|`modoboa-imap-migration |Migrate mailboxes from an|https://github.com/modoboa/modoboa-imap-migration | -|`_ |existing server using | | -| |IMAP (and offlineimap) | | -+---------------------------------------------------------+-------------------------+------------------------------------------------------+ |`modoboa-pfxadmin-migrate |A tool to migrate from |https://github.com/modoboa/modoboa-pfxadmin-migrate | |`_ |Postfixadmin | | +---------------------------------------------------------+-------------------------+------------------------------------------------------+ diff --git a/frontend/src/components/tools/DomainField.vue b/frontend/src/components/tools/DomainField.vue deleted file mode 100644 index af8e294fa..000000000 --- a/frontend/src/components/tools/DomainField.vue +++ /dev/null @@ -1,174 +0,0 @@ - - - - - diff --git a/modoboa/imap_migration/apps.py b/modoboa/imap_migration/apps.py index 60ce7ec7a..d611d1da0 100644 --- a/modoboa/imap_migration/apps.py +++ b/modoboa/imap_migration/apps.py @@ -31,6 +31,5 @@ class IMAPMigrationConfig(AppConfig): def ready(self): from . import checks # noqa - from . import handlers # noqa load_imapmigration_settings() diff --git a/modoboa/imap_migration/auth_backends.py b/modoboa/imap_migration/auth_backends.py index d87276498..c1ecf79f3 100644 --- a/modoboa/imap_migration/auth_backends.py +++ b/modoboa/imap_migration/auth_backends.py @@ -93,6 +93,11 @@ class IMAPBackend: # No migration => either someone else account, or # migration is done return None + if not user.check_password(password): + # User may have changed its password on modoboa + # Remote password and local now differs + # We block the connection in that case + return None return user def get_user(self, user_pk): diff --git a/modoboa/imap_migration/handlers.py b/modoboa/imap_migration/handlers.py deleted file mode 100644 index 7914af083..000000000 --- a/modoboa/imap_migration/handlers.py +++ /dev/null @@ -1,19 +0,0 @@ -"""IMAP migration handlers.""" - -from django.urls import reverse -from django.dispatch import receiver -from django.utils.translation import ugettext as _ - -from modoboa.core import signals as core_signals - - -@receiver(core_signals.extra_user_menu_entries) -def menu(sender, location, user, **kwargs): - """Return extra menu entry.""" - if location != "top_menu" or not user.is_superuser: - return [] - return [ - {"name": "imap_migrations", - "label": _("IMAP migrations"), - "url": reverse("imap_migration:index")} - ]