I already found myself unable to send or receive emails with mailcow after few days of working.
Usually I do another docker compose up -d and everything starts working again for another few days.
Only today I noticed that unbound container was restarting but i didn’t check the logs.

My question is: what is the purpose of unbound in mailcow stack? it is possible to remove it since I already runs adguard+unbound in my lan?

Its purpose is to provide reliable DNS resolution for a mail server. Thats an absolute crucial service for SMTP. You saying that you are using adguard is already asking for trouble 😉
No, you cannot remove it. You should not replace/remove any component of mailcow, as this is a matter of dependencies.

Have something to say?

Join the community by quickly registering to participate in this discussion. We'd like to see you joining our great moo-community!

Reliable DNS resolution is crucial for everythin and of course I’m not going to remove any service if it’s not supported.
But I would like my mail server doens’t go down because unbound of mail server goes down.

Why would unbound of mail server go down? That is in 99.9% something not properly configured in the host system/firewall/Host IP stack.
You need to check the logs if that is the case.

There is only mailcow stack on this host.
The stack starts and works for few days but at some later random times mail services become unreachable (SMTP/IMAP/WEB).
Happened alredy few times.

That seems like a hosting problem, not a mailcow problem.
Check also logs on your host (network connectivity/loss)

No one is typing