Guide: Postfix Error 'open database /var/virtual.db' - How to Resolve Email Sending and Receiving Problem!

Hardware: AMD64
YunoHost version: 11.2.3 (stable).
I have access to my server: Yes.

Description of the Issue

Hello,

I am encountering an issue with my YunoHost server. Postfix is reporting errors related to missing files, despite not having made any manual file alterations. It’s important to note that all other aspects of the server are functioning properly, and there is no unauthorized access, as the admin interface ports are secured against external connections. I ran the mailq command and observed that there are pending emails (approximately 12xx). I attempted to resolve the issue by executing postsuper -d ALL, followed by a server restart. However, I am still unable to send or receive emails.

Below is a portion of the log messages I retrieved:

journalctl

-- Journal begins at Wed 2023-07-26 16:49:02 CEST, ends at Fri 2023-08-04 17:28:49 CEST. --
aug 04 17:28:05 postfix/cleanup[5672]: warning: hash:/var/virtual is unavailable. open database /var/virtual.db: No such file or directory
aug 04 17:28:05 postfix/cleanup[5672]: warning: hash:/var/virtual lookup error for "root@serverdomain.ltd"
aug 04 17:28:05 postfix/cleanup[5672]: warning: 4402D18055E0: virtual_alias_maps map lookup problem for root@serverdomain.ltd -- message not accepted, try again later
aug 04 17:28:05 postfix/pickup[1707]: 442DD18055E0: uid=0 from=<root>
aug 04 17:28:05 postfix/cleanup[5672]: warning: hash:/var/virtual is unavailable. open database /var/virtual.db: No such file or directory
...

/var/log/mail.err

Aug  4 16:43:45 ECZ-SRV-01 postfix/cleanup[2451461]: error: open database /var/virtual.db: No such file or directory
Aug  4 16:43:45 ECZ-SRV-01 postfix/cleanup[2451464]: error: open database /var/virtual.db: No such file or directory
...

/var/log/mail.log

Aug  4 17:28:05 ECZ-SRV-01 postfix/pickup[1707]: 4483A18055E0: uid=0 from=<root>
Aug  4 17:28:05 ECZ-SRV-01 postsrsd[5673]: srs_forward: <root@serverdomain.ltd> not rewritten: Domain excluded by policy
...

It appears that the error is related to database files, specifically /var/virtual.db. I have not manually modified any configuration files, and the error persists even after attempting the mentioned actions.

Your guidance in resolving this matter would be greatly appreciated.

Thank you.

[Please note that this text retains the original format while ensuring privacy and security considerations.]


The next day

2023-08-04T22:00:00Z

I’ve tried to regenerate the config, but it’s all going wrong?!

yunohost tools regen-conf postfix
Warning: Traceback (most recent call last):
Warning:   File "<stdin>", line 5, in <module>
Warning: AssertionError: Setting file /etc/yunohost/apps/:/settings.yml does not exists ?
Warning: Traceback (most recent call last):
Warning:   File "<stdin>", line 5, in <module>
Warning: AssertionError: Setting file /etc/yunohost/apps/:/settings.yml does not exists ?

Also, what is with the /etc/yunohost/apps/:/settings.yml?

It should not have /:/

The correct path is:/etc/yunohost/settings.yml I can see the file there at least, it has correct values and rights and doesn’t seem to be corrupted.

Any help would mean the world to me… If only, @tituspijean, @Aleks, or @Mamie, you could lend your brilliant minds to my plight with YunoHost. My frustration has escalated to the point where I’m practically tearing my hair out in utter despair :sob:. To make matters worse, I’m being bombarded by complaints from other users about the complete breakdown of our email services. Strangely, I’ve hardly made any changes apart from what should have been routine – installing updates through the admin panel. The only other action I took was a bit of cleaning – merely deleting a handful of old, unused domains to bring the count-down from around 62 to a seemingly modest 32. Even this was advised by the knowledgeable Aleks in a previous discussion. Yet, here I am, drowning in this sea of email turmoil…

It appears that the root of this problem was none other than the troublesome “emailpouble,” similar to the case mentioned in Problème réception et envoi de mails - #3 by vincentux. Regrettably, my grasp of the French language is far from proficient, rendering this topic elusive amidst my English search terms. Nevertheless, I’m relieved to inform that the issue has been successfully resolved. For those facing a similar predicament, consider this post a parallel guide in English. To rectify this ordeal, the recommended course of action is to eradicate the culprit – “emailpouble” (or just remove it in plain English).

EDIT [SOLVED] I figured out thyis issue just before I went to post this. I decided to post anyway to help anyone else having the same issue. Turns out it had to do with my email was somehow under a self signed certificate rather than Let’s Encrypt. Sudo yunohost domain cert install MYDOMAIN.TLD seems to have fixed the following issue:

.

I seem to keep having a similar problem where email neither sends or can be received. The problem fixes itself temporarily when I perform:

yunohost tools regen-conf postfix

…but usually seems to come back after 1-2 months.

So… what exactly is this “emailpouble” that needs deleting to fix this issue? I don’t have any app (I know of) installed by that name?

NOTE: This is solved. Please read the start of this post.

1 Like

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