8000 Problem with API and mailboxes-list and mailboxes-read · Issue #1582 · modoboa/modoboa · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Problem with API and mailboxes-list and mailboxes-read #1582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
stefaweb opened this issue Oct 10, 2018 · 4 comments
Closed

Problem with API and mailboxes-list and mailboxes-read #1582

stefaweb opened this issue Oct 10, 2018 · 4 comments

Comments

@stefaweb
Copy link
stefaweb commented Oct 10, 2018

Seems the API is no longer working with last modoboa version.

If I go to https://mailserver/docs/api/#mailboxes-list/api/v1/mailboxes/, I got an error 500.

In /var/log/uwsgi/app/modoboa_instance.log:
GET /api/v1/mailboxes/ => generated 870 bytes in 217 msecs (HTTP/1.1 500) 5 headers in 181 bytes (1 switches on core 0)

Same if I use /api/v1/mailboxes/{id}/.

"<!DOCTYPE html>

<html lang="">
  <head>
    <meta charset="utf-8" />
    <title></title>
    <link rel="icon" type="image/png" href="/sitestatic/css/logo-icon.png" />
    <link rel="stylesheet" type="text/css" href="/sitestatic/bootstrap/dist/css/bootstrap.min.css" />
    <script src="/sitestatic/bootstrap/dist/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="/sitestatic/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="/jsi18n/"></script>
    <style>
      body {
          padding-top: 60px;
      }
    </style>
  </head>

  <body>
    <div class="container-fluid">
      <div class="row-fluid">
        
<div class="alert alert-danger">
  <h4>Sorry</h4>
  <p>An internal error occured.</p>
</div>

      </div>
    </div>
  </body>
</html>

EDIT : The new API module /api/v1/armessages/ seems to work but as /mailboxes don't work, I can access to the data.

@stefaweb
Copy link
Author

Again me.

How to found armessages ID?

I was thinking that we can have it with /api/v1/accounts/mailboxes but I don't know as the API doesn't work.

With /api/v1/accounts/ we don't get it (only mailbox pk ID) and in /armessages we can only search with the armessages ID. Maybe adding the accounts ID in armessages would be easier to access to the data.

@tonioo
Copy link
Member
tonioo commented Oct 11, 2018

@stefaweb I think the bug you encounter with API is due to the radicale plugin. Are you browsing the API as default administrator? (which has no mailbox) If so, just switch to a user with a mailbox and it will work again.
About the ARmessage API, I can add a filter. Something like:
GET /api/v1/armessages/?mailbox=
What do you think about this ?
Anyway, could you open an issue in the appropriate repository?

@stefaweb
Copy link
Author

@tonioo

Sorry for this late answer. I was too busy.

For the error 500, you're right. I was using admin. No 500 error using a login with mailbox.
For ARmessage API, you suggestion seems interesting. I open a issue in the right part.

@stefaweb
Copy link
Author

See in modoboa/modoboa-radicale#40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0