[GH-ISSUE #1582] Problem with API and mailboxes-list and mailboxes-read #1244

Closed
opened 2026-02-27 11:16:05 +03:00 by kerem · 4 comments
Owner

Originally created by @stefaweb on GitHub (Oct 10, 2018).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/1582

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.

Originally created by @stefaweb on GitHub (Oct 10, 2018). Original GitHub issue: https://github.com/modoboa/modoboa/issues/1582 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.
kerem closed this issue 2026-02-27 11:16:05 +03:00
Author
Owner

@stefaweb commented on GitHub (Oct 10, 2018):

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.

<!-- gh-comment-id:428490236 --> @stefaweb commented on GitHub (Oct 10, 2018): 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.
Author
Owner

@tonioo commented on GitHub (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?

<!-- gh-comment-id:428866508 --> @tonioo commented on GitHub (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=<ID> What do you think about this ? Anyway, could you open an issue in the appropriate repository?
Author
Owner

@stefaweb commented on GitHub (Oct 12, 2018):

@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.

<!-- gh-comment-id:429374068 --> @stefaweb commented on GitHub (Oct 12, 2018): @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.
Author
Owner

@stefaweb commented on GitHub (Oct 16, 2018):

See in https://github.com/modoboa/modoboa-radicale/issues/40

<!-- gh-comment-id:430274540 --> @stefaweb commented on GitHub (Oct 16, 2018): See in https://github.com/modoboa/modoboa-radicale/issues/40
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#1244
No description provided.