text: Title: imap_migration generates traceback
  Body: # Impacted versions
  
  * OS Type: Ubuntu 
  * OS Version: 22.04 LTS
  * Database Type: MySQL
  * Database version: 8
  * Modoboa: 2.1.2
  * installer used: Yes
  * Webserver: Nginx
  
  # Steps to reproduce
  - have offlineimap installed and configured for a domain
  - I double checked: all migrations are applied successfully
  - got to the shell and run the following command:
  - `python manage.py generate_offlineimap_config`
  
  # Current behavior
  
  I get the fopllowing error message:
  
  ```
  Traceback (most recent call last):
    File "/srv/modoboa/env/lib/python3.10/site-packages/django/template/base.py", line 829, in _resolve_lookup
      current = current[bit]
  TypeError: 'Migration' object is not subscriptable
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/srv/modoboa/env/lib/python3.10/site-packages/cryptography/fernet.py", line 133, in _verify_signature
      h.verify(data[-32:])
    File "/srv/modoboa/env/lib/python3.10/site-packages/cryptography/hazmat/primitives/hmac.py", line 72, in verify
      ctx.verify(signature)
    File "/srv/modoboa/env/lib/python3.10/site-packages/cryptography/hazmat/backends/openssl/hmac.py", line 85, in verify
      raise InvalidSignature("Signature did not match digest.")
  cryptography.exceptions.InvalidSignature: Signature did not match digest.
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/srv/modoboa/instance/manage.py", line 22, in <module>
      main()
    File "/srv/modoboa/instance/manage.py", line 18, in main
      execute_from_command_line(sys.argv)
    File "/srv/modoboa/env/lib/python3.10/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
      utility.execute()
    File "/srv/modoboa/env/lib/python3.10/site-packages/django/core/management/__init__.py", line 413, in execute
      self.fetch_command(subcommand).run_from_argv(self.argv)
    File "/srv/modoboa/env/lib/python3.10/site-packages/django/core/management/base.py", line 354, in run_from_argv
      self.execute(*args, **cmd_options)
    File "/srv/modoboa/env/lib/python3.10/site-packages/django/core/management/base.py", line 398, in execute
      output = self.handle(*args, **options)
    File "/srv/modoboa/env/lib/python3.10/site-packages/modoboa/imap_migration/management/commands/generate_offlineimap_config.py", line 41, in handle
      content = render_to_string(
    File "/srv/modoboa/env/lib/python3.10/site-packages/django/template/loader.py", line 62, in render_to_string
      return template.render(context, request)
    File "/srv/modoboa/env/lib/python3.10/site-packages/django/template/backends/django.py", line 61, in render
      return self.template.render(context)
    File "/srv/modoboa/env/lib/python3.10/site-packages/django/template/base.py", line 170, in render
      return self._render(context)
    File "/srv/modoboa/env/lib/python3.10/site-packages/django/template/base.py", line 162, in _render
      return self.nodelist.render(context)
    File "/srv/modoboa/env/lib/python3.10/site-packages/django/template/base.py", line 938, in render
      bit = node.render_annotated(context)
    File "/srv/modoboa/env/lib/python3.10/site-packages/django/template/base.py", line 905, in render_annotated
      return self.render(context)
    File "/srv/modoboa/env/lib/python3.10/site-packages/django/template/defaulttags.py", line 214, in render
      nodelist.append(node.render_annotated(context))
    File "/srv/modoboa/env/lib/python3.10/site-packages/django/template/base.py", line 905, in render_annotated
      return self.render(context)
    File "/srv/modoboa/env/lib/python3.10/site-packages/django/template/base.py", line 988, in render
      output = self.filter_expression.resolve(context)
    File "/srv/modoboa/env/lib/python3.10/site-packages/django/template/base.py", line 671, in resolve
      obj = self.var.resolve(context)
    File "/srv/modoboa/env/lib/python3.10/site-packages/django/template/base.py", line 796, in resolve
      value = self._resolve_lookup(context)
    File "/srv/modoboa/env/lib/python3.10/site-packages/django/template/base.py", line 837, in _resolve_lookup
      current = getattr(current, bit)
    File "/srv/modoboa/env/lib/python3.10/site-packages/modoboa/imap_migration/models.py", line 50, in password
      return decrypt(self._password)
    File "/srv/modoboa/env/lib/python3.10/site-packages/modoboa/lib/cryptutils.py", line 42, in decrypt
      return smart_text(_get_fernet().decrypt(smart_bytes(encrypted_value)))
    File "/srv/modoboa/env/lib/python3.10/site-packages/cryptography/fernet.py", line 90, in decrypt
      return self._decrypt_data(data, timestamp, time_info)
    File "/srv/modoboa/env/lib/python3.10/site-packages/cryptography/fernet.py", line 151, in _decrypt_data
      self._verify_signature(data)
    File "/srv/modoboa/env/lib/python3.10/site-packages/cryptography/fernet.py", line 135, in _verify_signature
      raise InvalidToken
  cryptography.fernet.InvalidToken
  ```
  
  # Expected behavior
  
  getting the input files for offlineimap.
  
  