# MIAB stop working

**URL:** <https://discourse.mailinabox.email/t/miab-stop-working/9940>\
**Category:** Maintenance\
**Created:** [December 23, 2022, 1:29am UTC](https://discourse.mailinabox.email/t/miab-stop-working/9940 "2022-12-23T01:29:04Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![spec3](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/s/df705f/32.png) [@spec3](https://discourse.mailinabox.email/u/spec3)\
**Post date:** [December 23, 2022, 1:29am UTC](https://discourse.mailinabox.email/t/miab-stop-working/9940/1 "2022-12-23T01:29:05Z")

</div>

No sure how to explain my situation or how did started happening, 2 weeks ago it was working and sending emails and receiving emails normally, did a few ubuntu upgrades including php lastest version (no sure if the problem is from that)  
I guess after upgrades the services from Ubuntu and stopped working and I see errors on the logs but I can’t understand it at all, I have been searching answer but no solution yet.

\*From /var/log/mail.err  
Dec 22 20:21:35 mail postfix/trivial-rewrite[25210]: fatal: dict\_sqlite\_lookup: /etc/postfix/virtual-alias-maps.cf: SQL prepare failed: disk I/O error?

\*From /var/log/mail.log  
Dec 22 20:24:39 mail postfix/submission/smtpd[24013]: warning: problem talking to service rewrite: Application error  
Dec 22 20:24:39 mail postfix/master[14507]: warning: process /usr/lib/postfix/sbin/trivial-rewrite pid 25290 exit status 1  
Dec 22 20:24:39 mail postfix/smtpd[24628]: warning: problem talking to service rewrite: Connection reset by peer  
Dec 22 20:24:39 mail postfix/smtpd[25253]: warning: problem talking to service rewrite: Connection reset by peer  
Dec 22 20:24:39 mail postfix/smtpd[24669]: warning: problem talking to service rewrite: Application error  
Dec 22 20:24:39 mail postfix/master[14507]: warning: process /usr/lib/postfix/sbin/trivial-rewrite pid 25291 exit status 1

_From /var/log/nginx/error.log2022/12/22 20:12:20 [error] 23251#23251: 17 upstream timed out (110: Unknown error) while reading response header from upstream, client: **.**.__._\*\*, server: \*\*\*\*\*\*\*, request: “POST /mail/?\_task=mail&\_unlock=loading1671757870356&\_framed=1 HTTP/2.0”, upstream: “fastcgi://unix:/var/run/php/php8.0-fpm.sock”,

NOTE: _ **.** _.\*_ **.** _ is the IP just taking it off.

---

<div class="post-metadata">

**Author:** ![spec3](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/s/df705f/32.png) [@spec3](https://discourse.mailinabox.email/u/spec3)\
**Post date:** [December 23, 2022, 1:43am UTC](https://discourse.mailinabox.email/t/miab-stop-working/9940/2 "2022-12-23T01:43:45Z")

</div>

from var log mail.log  
Dec 22 20:41:54 mail postfix/submission/smtpd[37014]: connect from localhost[127.0.0.1]  
Dec 22 20:42:19 mail postfix/trivial-rewrite[37017]: fatal: dict\_sqlite\_lookup: /etc/postfix/virtual-alias-maps.cf: SQL prepare failed: disk I/O error?  
Dec 22 20:42:19 mail postfix/trivial-rewrite[37018]: fatal: dict\_sqlite\_lookup: /etc/postfix/virtual-alias-maps.cf: SQL prepare failed: disk I/O error?  
Dec 22 20:42:20 mail postfix/submission/smtpd[36677]: warning: problem talking to service rewrite: Application error  
Dec 22 20:42:20 mail postfix/smtpd[34497]: warning: problem talking to service rewrite: Connection reset by peer  
Dec 22 20:42:20 mail postfix/master[31473]: warning: process /usr/lib/postfix/sbin/trivial-rewrite pid 37017 exit status 1  
Dec 22 20:42:20 mail postfix/master[31473]: warning: /usr/lib/postfix/sbin/trivial-rewrite: bad command startup – throttling  
Dec 22 20:42:20 mail postfix/master[31473]: warning: process /usr/lib/postfix/sbin/trivial-rewrite pid 37018 exit status 1

after a while I get Connection error server cannot be reached

---

<div class="post-metadata">

**Author:** ![eXTric](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/e/bb73d2/32.png) [@eXTric](https://discourse.mailinabox.email/u/eXTric)\
**Post date:** [December 23, 2022, 11:35am UTC](https://discourse.mailinabox.email/t/miab-stop-working/9940/3 "2022-12-23T11:35:40Z")

</div>

Search is your friend

> [@Attempt of list Nr. 1 failed. ClientError: An error occurred (403) when calling the HeadBucket operation: Forbidden](https://discourse.mailinabox.email/t/attempt-of-list-nr-1-failed-clienterror-an-error-occurred-403-when-calling-the-headbucket-operation-forbidden/9925):
>
> This upgrade has been a nightmare. It took me hours to get it setup because of the SSL issue. I thought everything was good for a full week and now out of the blue no accounts will send/receive. This started after I added 3 new emails this morning. Sometime between closing the laptop and landing at my destination all send/receive stopped. I have checked the logs and there are messages but nothing helpful that I can find. I can log in and all old emails are there. Just can’t send/receive. After …

---

<div class="post-metadata">

**Author:** ![spec3](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/s/df705f/32.png) [@spec3](https://discourse.mailinabox.email/u/spec3)\
**Post date:** [December 23, 2022, 2:03pm UTC](https://discourse.mailinabox.email/t/miab-stop-working/9940/4 "2022-12-23T14:03:21Z")

</div>

actually I found out there is an issue when the password are changed, and I get that search if your friend. This is a forum to ask for help, then why bother having a maintenance forum or a forum at all?

---

<div class="post-metadata">

**Author:** ![spec3](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/s/df705f/32.png) [@spec3](https://discourse.mailinabox.email/u/spec3)\
**Post date:** [December 23, 2022, 3:48pm UTC](https://discourse.mailinabox.email/t/miab-stop-working/9940/5 "2022-12-23T15:48:21Z")

</div>

cd /home/user-data/mail  
sudo sqlite3 users.sqlite ‘PRAGMA journal\_mode=delete;’;

this is not a permanent fix, as if user keep trying to change their password would brick it again.

NOTE: if you get and Error: stepping, database is locked (5), wait 5minutes to rerun the command

---

<div class="post-metadata">

**Author:** ![eXTric](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/e/bb73d2/32.png) [@eXTric](https://discourse.mailinabox.email/u/eXTric)\
**Post date:** [December 23, 2022, 5:15pm UTC](https://discourse.mailinabox.email/t/miab-stop-working/9940/6 "2022-12-23T17:15:04Z")

</div>

The possible temporary fixes are discussed in the github thread which i linked in the above. Unfortunately there is no easy fix for MiaB as the issue is coming from 3th party packages.

> <https://github.com/mail-in-a-box/mailinabox/issues/2185>
>
> Changing the password via the Roundcube settings does not work. See report \[here…\](https://discourse.mailinabox.email/t/cannot-update-password-through-roundcubemail-settings/9683).
> 
> The error reported via /var/log/roundcubemail/errors.log:
> \`DB Error: \[1\] near "%": syntax error (SQL Query: UPDATE users SET password=%D WHERE email='a@b.c') in /usr/local/lib/roundcubemail/program/lib/Roundcube/rcube\_db.php on line 564 (POST /mail/?\_task=settings&\_action=plugin.password-save)\`
> The sql update query contains %D which was removed from the 1.6.0 version of roundcube (see \[1.6.0\](https://github.com/roundcube/roundcubemail/blob/993b888afe29c383bf45c84f17090f4db96367ba/plugins/password/config.inc.php.dist#L105) versus \[1.5.3\](https://github.com/roundcube/roundcubemail/blob/0121082842400ce1919ff4b4d36c991630b6988c/plugins/password/config.inc.php.dist#L133))
> 
> Several observations:
> \- \`$config\['password\_algorithm'\] = 'clear';\` should probably be set to \`dovecot\`
> \- There is a \[MIAB password driver\](https://github.com/roundcube/roundcubemail/pull/7824) in the Roundcube password plugin. No idea if it works. Also needs you to configure the admin password so does not feel nice to use.

> <https://github.com/ddavness/power-mailinabox/pull/92>
>
> Fixes #85
> Related to mail-in-a-box/mailinabox#2185
> 
> The Mail-in-a-Box driver …has a fallback mode where it can use the logged-in user's credentials to authenticate itself against the API. This is our next best solution (the first would be getting the root API key from \`/var/lib/mailinabox/api.key\`, but the driver does not support this and there isn't a fix we can do on our end).
> 
> \*\*Right now there are two problems with this approach:\*\*
> \- The endpoint used is admin-only (that means only admins can change their own password)
> \- - This is because this endpoint is used to change the password of any account. \*\*Fixable on our end; if the user does not have admin privileges it can only change their own password\*\*
> \- The authentication method used by the driver fails if the user has 2FA enabled
> \- - This is a security measure and I'm not willing to waive the 2FA part. The API as-is pretty much only allows admins to enroll in 2FA anyway, so they can still change their own password from within the admin panel, too. But removing 2FA from an admin user would keep their 2FA enrolment, and at this point they'd be unable to change their own password.
> \- - \*\*Solution:\*\* Allow non-admins to change their own passwords from within the admin panel (and also enroll in 2FA if they want to, ~~but that's future work~~ ).

---

<div class="post-metadata">

**Author:** ![spec3](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/s/df705f/32.png) [@spec3](https://discourse.mailinabox.email/u/spec3)\
**Post date:** [December 29, 2022, 8:22pm UTC](https://discourse.mailinabox.email/t/miab-stop-working/9940/7 "2022-12-29T20:22:37Z")

</div>

> <https://github.com/ddavness/power-mailinabox/pull/92>
>
> Fixes #85
> Related to mail-in-a-box/mailinabox#2185
> 
> The Mail-in-a-Box driver …has a fallback mode where it can use the logged-in user's credentials to authenticate itself against the API. This is our next best solution (the first would be getting the root API key from \`/var/lib/mailinabox/api.key\`, but the driver does not support this and there isn't a fix we can do on our end).
> 
> \*\*Right now there are two problems with this approach:\*\*
> \- The endpoint used is admin-only (that means only admins can change their own password)
> \- - This is because this endpoint is used to change the password of any account. \*\*Fixable on our end; if the user does not have admin privileges it can only change their own password\*\*
> \- The authentication method used by the driver fails if the user has 2FA enabled
> \- - This is a security measure and I'm not willing to waive the 2FA part. The API as-is pretty much only allows admins to enroll in 2FA anyway, so they can still change their own password from within the admin panel, too. But removing 2FA from an admin user would keep their 2FA enrolment, and at this point they'd be unable to change their own password.
> \- - \*\*Solution:\*\* Allow non-admins to change their own passwords from within the admin panel (and also enroll in 2FA if they want to, ~~but that's future work~~ ).

No sure how is this done, I am new to this would you have a step by step guide?

---

<div class="post-metadata">

**Author:** ![weeix](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/weeix/32/2411_2.png) [@weeix](https://discourse.mailinabox.email/u/weeix)\
**Post date:** [January 20, 2023, 5:58am UTC](https://discourse.mailinabox.email/t/miab-stop-working/9940/8 "2023-01-20T05:58:32Z")

</div>

After changing the `users.sqlite` logging mode back to _delete_, I ended up disabling Roundcube’s password plugin (to prevent users from changing their passwords) by using this command:

```auto
sudo nano /usr/local/lib/roundcubemail/config/config.inc.php

```

Then delete the password plugin from line 28, followed by Ctrl+O, Enter, and Ctrl+X. Alternatively, use `sed` (untested):

```auto
sudo sed -i "s/'password', //g" /usr/local/lib/roundcubemail/config/config.inc.php

```

---

<div class="post-metadata">

**Author:** ![system](https://discourse.mailinabox.email/uploads/default/original/2X/4/4d0933d13c456b7e57f296aa6cc344525b6f0c70.png) [@system](https://discourse.mailinabox.email/u/system)\
**Post date:** [March 1, 2023, 5:59am UTC](https://discourse.mailinabox.email/t/miab-stop-working/9940/9 "2023-03-01T05:59:03Z")

</div>

This topic was automatically closed 40 days after the last reply. New replies are no longer allowed.
